chore(provider): use latest cohere models (#400)

Update prompts to correct grammar
concat with table.concat to avoid overhead

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham
2024-08-30 13:39:36 -04:00
committed by GitHub
parent 61acd714ba
commit b196627e86
4 changed files with 9 additions and 15 deletions

View File

@@ -31,10 +31,7 @@ local M = {}
M.api_key_name = "CO_API_KEY"
M.parse_message = function(opts)
local user_prompt = ""
for _, user_prompt_ in ipairs(opts.user_prompts) do
user_prompt = user_prompt .. "\n\n" .. user_prompt_
end
local user_prompt = table.concat(opts.user_prompts, "\n\n")
return {
preamble = opts.system_prompt,
@@ -75,7 +72,7 @@ M.parse_curl_args = function(provider, code_opts)
.. "."
.. vim.version().patch,
}
if not P.env.is_local("openai") then
if not P.env.is_local("cohere") then
headers["Authorization"] = "Bearer " .. provider.parse_api_key()
end