-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ai proxy): 3.7 regression fixes rollup (#12974)
* fix(ai-proxy): remove unsupported top_k parameter from openai format(s) * fix(ai-proxy): broken ollama-type streaming events * fix(ai-proxy): streaming setting moved ai-proxy only * fix(ai-proxy): anthropic token counts * fix(ai-proxy): wrong analytics format; missing azure extra analytics * fix(ai-proxy): correct plugin name in log serializer * fix(ai-proxy): store body string in case of regression * fix(ai-proxy): fix tests (cherry picked from commit 8470056)
- Loading branch information
1 parent
30c0c82
commit ec9b356
Showing
12 changed files
with
92 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
local typedefs = require("kong.db.schema.typedefs") | ||
local llm = require("kong.llm") | ||
local deep_copy = require("kong.tools.utils").deep_copy | ||
|
||
local this_schema = deep_copy(llm.config_schema) | ||
|
||
local ai_proxy_only_config = { | ||
{ | ||
response_streaming = { | ||
type = "string", | ||
description = "Whether to 'optionally allow', 'deny', or 'always' (force) the streaming of answers via server sent events.", | ||
required = false, | ||
default = "allow", | ||
one_of = { "allow", "deny", "always" }}, | ||
}, | ||
} | ||
|
||
for i, v in pairs(ai_proxy_only_config) do | ||
this_schema.fields[#this_schema.fields+1] = v | ||
end | ||
|
||
return { | ||
name = "ai-proxy", | ||
fields = { | ||
{ protocols = typedefs.protocols_http }, | ||
{ consumer = typedefs.no_consumer }, | ||
{ service = typedefs.no_service }, | ||
{ config = llm.config_schema }, | ||
{ config = this_schema }, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters