fix(openai): add support for Cloudflare's AI-Gateway (#192)

This commit is contained in:
Coffee 2024-08-25 00:32:16 +08:00 committed by GitHub
parent 9ac9f827ba
commit 1142c3c274
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ M.defaults = {
provider = "claude",
---@type AvanteSupportedProvider
openai = {
endpoint = "https://api.openai.com",
endpoint = "https://api.openai.com/v1",
model = "gpt-4o",
temperature = 0,
max_tokens = 4096,

View File

@ -95,7 +95,7 @@ M.parse_curl_args = function(provider, code_opts)
end
return {
url = Utils.trim(base.endpoint, { suffix = "/" }) .. "/v1/chat/completions",
url = Utils.trim(base.endpoint, { suffix = "/" }) .. "/chat/completions",
proxy = base.proxy,
insecure = base.allow_insecure,
headers = headers,