Skip to content

Conversation

LiteSun
Copy link
Member

@LiteSun LiteSun commented Mar 25, 2025

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

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Mar 25, 2025
model_options = conf.options
}

local res, err, httpc = ai_driver:request(conf, request_table, extra_opts)
Copy link
Member Author

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
image

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

@LiteSun LiteSun requested review from nic-6443 and Revolyssup March 27, 2025 00:58
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 27, 2025
@LiteSun LiteSun requested review from nic-6443 and AlinsRan March 27, 2025 09:34
@Baoyuantop Baoyuantop moved this to 👀 In review in ⚡️ Apache APISIX Roadmap Mar 28, 2025
@LiteSun LiteSun marked this pull request as draft March 31, 2025 01:59
@Baoyuantop Baoyuantop moved this from 👀 In review to 🏗 In progress in ⚡️ Apache APISIX Roadmap Apr 1, 2025
Copy link
Contributor

@Baoyuantop Baoyuantop left a 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

@LiteSun LiteSun changed the title fix: ai-request-rewrite test fix: ai-request-rewrite plugin wrong test Apr 3, 2025
@LiteSun LiteSun changed the title fix: ai-request-rewrite plugin wrong test fix: ai-request-rewrite plugin wrong test Apr 3, 2025
@Baoyuantop Baoyuantop moved this from 🏗 In progress to 📋 Backlog in ⚡️ Apache APISIX Roadmap May 16, 2025
Copy link

github-actions bot commented Jun 2, 2025

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jun 2, 2025
Copy link

github-actions bot commented Jul 1, 2025

This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Jul 1, 2025
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in ⚡️ Apache APISIX Roadmap Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files. stale
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants