Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sternelee
Copy link
Contributor

@sternelee sternelee commented Sep 29, 2024

silliconflow API error response only received message text, not a object

VisargD
VisargD previously approved these changes Oct 1, 2024
@VisargD
Copy link
Collaborator

VisargD commented Oct 1, 2024

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;
Copy link
Collaborator

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)

Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants