Open t18n opened 6 months ago
I am working on something adjacent. I would like to load my own custom actions using read_actions_from_file
but couldn't figure it out.
Heads up that I figured out how to get custom actions by setting the config actions_path
to my own customactions.json
:
-- ChatGPT plugins
{
"jackMort/ChatGPT.nvim",
event = "VeryLazy",
config = function()
local chatgpt = require("chatgpt")
chatgpt.setup({
-- https://github.com/jackMort/ChatGPT.nvim/blob/df53728e05129278d6ea26271ec086aa013bed90/lua/chatgpt/config.lua#L177C5-L177C18
actions_paths = { "~/.config/nvim/lua/config/chatgpt.customactions.json" }, -- <-- Added line
openai_params = {
model = "gpt-4o",
},
openai_edit_params = {
model = "gpt-4o",
},
})
local wk = require("which-key")
wk.register({
p = {
name = "ChatGPT",
-- all the other run commands can go here:
a = { "<cmd>ChatGPTRun add_tests<CR>", "Add Tests", mode = { "n", "v" } },
y = { "<cmd>ChatGPTRun fix_typos<CR>", "Fix Typos", mode = { "n", "v" } },
},
}, {
prefix = "<leader>",
mode = "v",
})
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
},
}
Example customactions.json: https://github.com/jackMort/ChatGPT.nvim/blob/df53728e05129278d6ea26271ec086aa013bed90/lua/chatgpt/flows/actions/actions.json
{
"fix_typos": {
"type": "chat",
"opts": {
"template": "Fix typos and only output the correct spelling in {{lang}}:\n\n{{input}}",
"strategy": "replace",
"params": {
"model": "gpt-4o"
}
},
"args": {
"lang": {
"type": "string",
"optional": "true",
"default": "english"
}
}
}
}
I am trying to setup the local prompts as I would like to add some personal information. However, this setting doesn't work:
Is there a way do do that?