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

Add compatibility for aliyun LLM APIs #530

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ThorbJ
Copy link

@ThorbJ ThorbJ commented Mar 5, 2025

Summary

Some Aliyun API responses do not include the status_details field, which causes an error when trying to access it. This PR ensures compatibility by setting status_details to null when it is missing.

Changes

  • Checks if status_details exists in the response before accessing it.
  • Defaults status_details to null if it is not present.
  • Ensures compatibility with both OpenAI and Aliyun APIs.

Why this is needed

Without this fix, Aliyun API responses that lack status_details will cause runtime errors, breaking the client integration.

Testing

  • Tested with OpenAI API (unchanged behavior).
  • Tested with Aliyun API (no more errors when status_details is missing).

Backward Compatibility

✅ Fully backward compatible. If status_details is present, the behavior remains unchanged.

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.

1 participant