-
Notifications
You must be signed in to change notification settings - Fork 486
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
fix: siliconflow error response #636
base: main
Are you sure you want to change the base?
Conversation
e9f9f2f
to
31a54be
Compare
Hey! Will it be possible to add the documentation link in the PR description to point out why this is required? It will make it easy to track things in future. Thanks! |
} | ||
|
||
return response; | ||
return response as ChatCompletionResponse; |
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.
would recommend changing the structure of this function to
if ('contents' in response) {
return response
}
if (responseStatus !== 200 && typeof response === 'string') {
return SiliconFlowErrorResponseTransform(
{ message: response, code: String(responseStatus) },
SILICONFLOW
);
}
else return generateInvalidProviderResponseError(response, SILICONFLOW)
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.
Same comment for other updated functions as well
silliconflow API error response only received message text, not a object