nic-6443 commented on code in PR #13676:
URL: https://github.com/apache/apisix/pull/13676#discussion_r3585559125
##########
apisix/plugins/ai-proxy/schema.lua:
##########
@@ -303,7 +360,35 @@ _M.ai_proxy_multi_schema = {
properties = {
algorithm = {
type = "string",
- enum = { "chash", "roundrobin" },
+ enum = { "chash", "roundrobin", "semantic" },
+ description = "Load-balancing algorithm. Note: 'semantic' "
+ .. "picks an instance by prompt similarity and does
not "
+ .. "participate in health checks or fallback_strategy
/ "
+ .. "retry — an upstream failure on the chosen instance
is "
+ .. "returned to the client. It only falls back (to the
"
+ .. "catchall, else the first instance) when no
instance "
+ .. "clears its threshold or embedding fails.",
+ },
+ threshold = {
+ type = "number",
+ description = "Global minimum cosine similarity for the "
+ .. "semantic algorithm. When no instance clears its "
+ .. "threshold the request falls back to the catchall "
+ .. "instance, or the first instance if none is set.",
+ },
+ aggregation = {
+ type = "string",
+ enum = { "avg", "max", "min" },
Review Comment:
Confirmed against the pushed code — `semantic.max` is the only path now and
the schema knob is gone (docs too). The number table nails exactly why; this
matches what I'd expect. 👍
##########
apisix/plugins/ai-providers/azure-openai.lua:
##########
@@ -32,6 +32,7 @@ return require("apisix.plugins.ai-providers.base").new(
path = "/completions",
rewrite_request_body = rewrite_chat_request_body,
},
+ ["openai-embeddings"] = { path = "/embeddings" },
Review Comment:
Verified end-to-end: `embeddings_target_path` returning nil for the missing
capability lets the endpoint path through, `check_schema` rejects a path-less
azure endpoint, and TEST 17 asserts the request lands on the deployment path
*with* `api-version`. Solid fix, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]