Skip to content

Commit 0210be4

Browse files
committed
address review: ipairs for protocol names, capture deep_merge return
1 parent dc524bd commit 0210be4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apisix/plugins/ai-providers/base.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function _M.build_request(self, ctx, conf, request_body, opts)
189189
if patch then
190190
core.log.info("applying request_body override for target protocol '",
191191
ctx.ai_target_protocol, "'")
192-
deep_merge(request_body, patch)
192+
request_body = deep_merge(request_body, patch)
193193
end
194194
end
195195
params.body = request_body

apisix/plugins/ai-proxy/schema.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
local schema_def = require("apisix.schema_def")
1818
local ai_providers_schema = require("apisix.plugins.ai-providers.schema")
1919
local protocols = require("apisix.plugins.ai-protocols")
20-
local pairs = pairs
20+
local ipairs = ipairs
2121

2222
local _M = {}
2323

@@ -78,7 +78,7 @@ local model_options_schema = {
7878
-- Each registered protocol gets an optional "any-shape object" entry.
7979
-- Values are applied via deep-merge after the model_options flat overwrite.
8080
local request_body_override_properties = {}
81-
for _, proto_name in pairs(protocols.names()) do
81+
for _, proto_name in ipairs(protocols.names()) do
8282
request_body_override_properties[proto_name] = {
8383
type = "object",
8484
description = "Deep-merged into the outgoing request body when the "

0 commit comments

Comments
 (0)