fix: improve third-party API compatibility#108
Open
litunan wants to merge 1 commit intoGCWing:mainfrom
Open
Conversation
- fix: don't send 'thinking' parameter when disabled to prevent 400 errors from APIs that don't recognize this field - fix: make tool_calls.index optional with serde(default) for APIs that omit this field in streaming responses - fix: add serde alias 'output_tokens' for completion_tokens and defaults for usage fields to support APIs using different field names Fixes GCWing#75 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e6f0f4e to
7a17025
Compare
Owner
|
@wsp1911 review |
Collaborator
|
有些API(如智谱GLM-5),默认(不传思考字段)启用思考,不显式设置thinking=disabled会导致无法关闭思考。建议查阅报错API文档了解如何控制思考设置,若无相关设置,可先根据url特判 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
Third-party APIs (non-OpenAI/Anthropic) may not recognize the "thinking" parameter and return 400 errors. This PR ensures compatibility with a wider range of AI providers.
Fixes #75