nic-6443 opened a new pull request, #13406: URL: https://github.com/apache/apisix/pull/13406
This avoids re-encoding the ai-proxy request body when the outgoing body is unchanged. If protocol conversion, provider preparation, model options, request body overrides, or provider cleanup changes the body, the existing encoded table path is still used. It also covers ai-proxy-multi through the shared provider build path and keeps retry behavior from falling back to the original raw body after an earlier attempt has rewritten the parsed body. The raw body is read lazily in the unchanged-body branch and cached on the request context, so retries do not read it again. The sidecar LLM request path used by ai-request-rewrite is explicitly marked as generated, so it continues to send the JSON-encoded LLM request instead of reusing the original client body. Tests run: ``` luacheck apisix/plugins/ai-proxy/base.lua apisix/plugins/ai-providers/base.lua apisix/plugins/ai-protocols/openai-chat.lua apisix/plugins/ai-protocols/bedrock-converse.lua apisix/plugins/ai-protocols/passthrough.lua apisix/plugins/ai-request-rewrite.lua perl -I. -c t/plugin/ai-proxy-request-body-override.t git diff --check prove -I. t/plugin/ai-proxy-request-body-override.t ``` -- 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]
