-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: ai-request-rewrite
plugin wrong test
#12083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -124,13 +124,12 @@ local function request_to_llm(conf, request_table, ctx) | |||
model_options = conf.options | |||
} | |||
|
|||
local res, err, httpc = ai_driver:request(conf, request_table, extra_opts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to manully close according to the docs
https://github.com/openresty/lua-nginx-module#tcpsockclose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/apache/apisix/blob/master/apisix/plugins/ai-drivers/openai-base.lua#L131
It seems that only two parameters were returned, why didn't painc occur before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at least one pass case is needed, and there should be no error level logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/apache/apisix/blob/master/apisix/plugins/ai-drivers/openai-base.lua#L131
It seems that only two parameters were returned, why didn't painc occur before?
This issue occurred because when I started development and created my branch, the function was returning three parameters. After this PR was merged: https://github.com/apache/apisix/pull/12030/files#diff-b9bb0990d3ea842c42b094837737acfb597e2c8bf3a976dda8be56c84ef5b3c0L109, the returned parameters were adjusted. The code in my branch hasn't been synchronized with upstream, which caused this inconsistency.
I think at least one pass case is needed, and there should be no error level logs.
The test cases are already covered, and the tests cannot pass without making this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revise to a meaningful PR title
ai-request-rewrite
plugin wrong test
Description
In the ai-request-rewrite2.ts file, the TEST 3 case was incorrectly configured with the wrong plugin. It has now been corrected.
deepend on #12101
Fixes # (issue)
Checklist