-
Notifications
You must be signed in to change notification settings - Fork 60.4k
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
change build messages for qwen in client #4971
Conversation
@lloydzhou is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe recent changes focus on refactoring the handling of request bodies and headers in Alibaba-related API and client code. The updates streamline the code by directly utilizing the request body and headers, introducing new interfaces for request inputs and parameters, and refining the model validation process for better alignment with server configurations. Changes
Poem
Tip You can get early access to new featuresEnable the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- app/api/alibaba/[...path]/route.ts (2 hunks)
- app/client/platforms/alibaba.ts (3 hunks)
Additional comments not posted (6)
app/api/alibaba/[...path]/route.ts (3)
98-98
: LGTM! Verify the default value forX-DashScope-SSE
.The simplification of the header handling is good. Please ensure that the default value "disable" is appropriate for the application context.
101-101
: LGTM! Verify the format ofreq.body
.Accessing the request body directly simplifies the code. Please ensure that
req.body
is always in the expected format.
111-121
: LGTM! Verify the service provider comparison logic.The refactoring improves readability and maintainability. Please ensure that the service provider comparison logic is correct.
app/client/platforms/alibaba.ts (3)
35-40
: LGTM! Verify the correct usage ofmessages
.The introduction of the
RequestInput
interface improves the structure and clarity of the request payload. Please ensure that themessages
property is used correctly in the codebase.
41-49
: LGTM! Verify the correct usage ofRequestParam
properties.The introduction of the
RequestParam
interface improves the structure and clarity of the request parameters. Please ensure that the properties are used correctly in the codebase.
100-112
: LGTM! Verify the correct usage of the newRequestPayload
structure.The restructuring of the
RequestPayload
interface aligns the request payload with the new requirements. Please ensure that the new structure is used correctly in the codebase.
app/api/alibaba/[...path]/route.ts
Outdated
model as string, | ||
ServiceProvider.Alibaba as string, | ||
jsonBody?.model as string, | ||
ServiceProvider.ByteDance as string, |
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.
alibaba
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- app/api/alibaba/[...path]/route.ts (2 hunks)
Additional comments not posted (3)
app/api/alibaba/[...path]/route.ts (3)
98-98
: LGTM! Simplified header handling.The use of
req.headers.get("X-DashScope-SSE") ?? "disable"
is a clean and efficient way to handle the header.
101-101
: LGTM! Simplified request body handling.Directly using
req.body
simplifies the code but ensure that the body is correctly structured and parsed.
111-120
: LGTM! Refactored model validation process.Cloning and parsing the request body to extract model information for validation is a good approach to ensure the original request body remains unchanged.
Summary by CodeRabbit
New Features
Refactor
req.body
) and headers in API requests.