diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2025-02-14 15:40:49 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2025-02-14 15:40:49 -0300 |
| commit | 15d2ab7726354e0bb1bd54620d05090941b66db2 (patch) | |
| tree | 93f55da9ef1bcd21d0f4b16689779f3378f6bd1f /lua/plugins | |
| parent | dce0214799174adcaa33c2b34b2f7f8062c6663d (diff) | |
| download | nvim-conf-15d2ab7726354e0bb1bd54620d05090941b66db2.tar.gz nvim-conf-15d2ab7726354e0bb1bd54620d05090941b66db2.zip | |
refactor(deepseek): migrar a adaptador openai_compatible con endpoint de Azure
- Agregar configuración de nivel de log TRACE para depuración
- Corregir error de sintaxis de coma final en esquema de modelo de copilot
- Actualizar estrategia de chat para usar adaptador deepseek por defecto
- Comentar configuración antigua del adaptador deepseek
Diffstat (limited to 'lua/plugins')
| -rw-r--r-- | lua/plugins/codecompanion.lua | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index 2302b98..95edce8 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -10,6 +10,7 @@ return { "jellydn/spinner.nvim", -- Show loading spinner when request is started }, opts = { + log_level = "TRACE", -- or "DEBUG" adapters = { ollama = function() return require("codecompanion.adapters").extend("ollama", { @@ -48,7 +49,7 @@ return { return require("codecompanion.adapters").extend("copilot", { schema = { model = { - default = "o3-mini", + default = "o3-mini" }, }, }) @@ -103,24 +104,37 @@ return { }) end, deepseek = function() - return require("codecompanion.adapters").extend("deepseek", { + return require("codecompanion.adapters").extend("openai_compatible", { env = { - api_key = "cmd:echo $OPENAI_API_KEY", - chat_url = "/v1/chat/completions", - url = "http://127.0.0.1:8000", - }, - headers = { - ["Content-Type"] = "application/json", + api_key = "cmd:echo $AZ_DS_API_KEY", + url = "https://DeepSeek-R1-ajfsk.eastus2.models.ai.azure.com", }, schema = { model = { - default = function() - return "davinci" - end, - }, - }, + default = "deepseek-chat" + } + } }) end, + -- deepseek = function() + -- return require("codecompanion.adapters").extend("deepseek", { + -- env = { + -- api_key = "cmd:echo $OPENAI_API_KEY", + -- chat_url = "/v1/chat/completions", + -- url = "http://127.0.0.1:8012", + -- }, + -- headers = { + -- ["Content-Type"] = "application/json", + -- }, + -- schema = { + -- model = { + -- default = function() + -- return "davinci" + -- end, + -- }, + -- }, + -- }) + -- end, azure_openai = function() return require("codecompanion.adapters").extend("azure_openai", { env = { @@ -138,7 +152,7 @@ return { strategies = { chat = { - adapter = "copilot", + adapter = "deepseek", -- roles = { llm = " Copilot Chat", user = "IT Man" }, }, inline = { adapter = "copilot" }, |