Skip to content

Commit 449859f

Browse files
authored
fix: anthropic streaming content_block_start struct bug (#604)
opencode Error message: [ { "expected": "string", "code": "invalid_type", "path": [ "content_block", "text" ], "message": "Invalid input: expected string, received undefined" } ] ----- -- it is claude exmple ----- event: content_block_start data: {"type": "content_block_start", "index": 0, "content_block": {"type": "text", "text": ""}}
1 parent 3092a51 commit 449859f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core/relay/model/claude.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ type ClaudeImageSource struct {
5454

5555
type ClaudeContent struct {
5656
Type string `json:"type"`
57-
Text string `json:"text,omitempty"`
58-
Thinking string `json:"thinking,omitempty"`
57+
Text string `json:"text"`
58+
Thinking string `json:"thinking"`
5959
Source *ClaudeImageSource `json:"source,omitempty"`
6060
ID string `json:"id,omitempty"`
6161
Name string `json:"name,omitempty"`

0 commit comments

Comments
 (0)