Skip to content

Conversation

@hustxiayang
Copy link
Contributor

@hustxiayang hustxiayang commented Dec 3, 2025

Description
This PR is to fix the following issues:
1 Add reasoning content in the request is also missing in the gcp anthropic
2 The reasoning output of gcp anthropic is not parsed out

In this way, reasoning claude models can have an unified interface.

Other issues:
1 The assistant message of gcp anthropic did not cover the case of array. Fixed.

Signed-off-by: yxia216 <[email protected]>
@hustxiayang hustxiayang requested a review from a team as a code owner December 3, 2025 06:41
@hustxiayang hustxiayang marked this pull request as draft December 3, 2025 06:41
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 3, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 87.38739% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.30%. Comparing base (a2ba2c9) to head (1cc37e1).

Files with missing lines Patch % Lines
internal/translator/openai_gcpanthropic.go 90.41% 4 Missing and 3 partials ⚠️
internal/translator/openai_awsbedrock.go 63.63% 4 Missing ⚠️
internal/apischema/openai/openai.go 82.35% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1607      +/-   ##
==========================================
+ Coverage   83.26%   83.30%   +0.04%     
==========================================
  Files         137      137              
  Lines       12059    12138      +79     
==========================================
+ Hits        10041    10112      +71     
- Misses       1411     1419       +8     
  Partials      607      607              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hustxiayang hustxiayang marked this pull request as ready for review December 4, 2025 18:52
@hustxiayang hustxiayang marked this pull request as draft December 4, 2025 18:52
@hustxiayang hustxiayang changed the title fix: gcp's reasnoning also needs a fix fix: add reasoning content in request and response for gcp anthropic Dec 4, 2025
@hustxiayang hustxiayang marked this pull request as ready for review December 4, 2025 18:55
Signed-off-by: yxia216 <[email protected]>
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 4, 2025
@hustxiayang
Copy link
Contributor Author

/retest

@hustxiayang
Copy link
Contributor Author

/retest

// The signature for a thinking block.
Signature *string `json:"signature,omitempty"`
RedactedContent []byte `json:"redactedContent,omitempty"`
Signature *string `json:"signature,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra spaces ?

var str string
if err := json.Unmarshal(data, &str); err == nil {
// Try to decode as base64 first (this would be []byte encoded as base64)
if decoded, err := base64.StdEncoding.DecodeString(str); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to decode in gateway ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants