Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Pre Instructions #812

Open
tomerikpaulsen opened this issue Nov 6, 2024 · 0 comments
Open

feature: Pre Instructions #812

tomerikpaulsen opened this issue Nov 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@tomerikpaulsen
Copy link

Feature request

Would it be possible to add pre instructions for the chat. In that way i can populate the preinstrutions with vital live data such as file structure and important ways to implement code to my project.

Ive tried using this method but it does not seem to be a valid thing. Its suggested by Open AI, and I can not find any documentation on it.

local function load_instructions()
    local path = vim.fn.expand("~/.config/nvim/avante_instructions.md")
    local file = io.open(path, "r")
    if file then
        local instructions = file:read("*a")
        file:close()
        vim.notify("Avante: Successfully loaded instructions from " .. path, vim.log.levels.INFO)
        return instructions
    else
        vim.notify("Avante: Could not load instructions from " .. path .. ". Using default instructions.", vim.log.levels.WARN)
        return "Default instructions if file is not found."
    end
end

return {
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false,
  opts = {
    anthropic_api_key = vim.fn.getenv("ANTHROPIC_API_KEY"),
    -- Load instructions from external file
    default_instructions = load_instructions(),
    max_tokens = 500,
    temperature = 0.3,
  },

Motivation

This feature would be a semi solution to code base functionality if the instructions file are populated with live data.

Other

No response

@tomerikpaulsen tomerikpaulsen added the enhancement New feature or request label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant