Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3359,7 +3359,7 @@ func (r *InputJSONDelta) UnmarshalJSON(data []byte) error {
// The properties Schema, Type are required.
type JSONOutputFormatParam struct {
// The JSON schema of the format
Schema map[string]any `json:"schema,omitzero,required"`
Schema json.RawMessage `json:"schema,omitzero,required"`
// This field can be elided, and will marshal its zero value as "json_schema".
Type constant.JSONSchema `json:"type,required"`
paramObj
Expand Down Expand Up @@ -6367,7 +6367,6 @@ func (u ThinkingConfigParamUnion) GetType() *string {
return nil
}


type ThinkingDelta struct {
Thinking string `json:"thinking,required"`
Type constant.ThinkingDelta `json:"type,required"`
Expand Down
8 changes: 2 additions & 6 deletions message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@
OutputConfig: anthropic.OutputConfigParam{
Effort: anthropic.OutputConfigEffortLow,
Format: anthropic.JSONOutputFormatParam{
Schema: map[string]any{
"foo": "bar",
},
Schema: json.RawMessage(`{"foo": "bar"}`),

Check failure on line 65 in message_test.go

View workflow job for this annotation

GitHub Actions / detect-breaking-changes

cannot use map[string]any{…} (value of type map[string]any) as "encoding/json".RawMessage value in struct literal
},
},
ServiceTier: anthropic.MessageNewParamsServiceTierAuto,
Expand Down Expand Up @@ -171,11 +169,9 @@
OutputConfig: anthropic.OutputConfigParam{
Effort: anthropic.OutputConfigEffortLow,
Format: anthropic.JSONOutputFormatParam{
Schema: map[string]any{
"foo": "bar",
},
Schema: json.RawMessage(`{"foo": "bar"}`),
},
},

Check failure on line 174 in message_test.go

View workflow job for this annotation

GitHub Actions / detect-breaking-changes

cannot use map[string]any{…} (value of type map[string]any) as "encoding/json".RawMessage value in struct literal
System: anthropic.MessageCountTokensParamsSystemUnion{
OfTextBlockArray: []anthropic.TextBlockParam{{
Text: "Today's date is 2024-06-01.",
Expand Down
5 changes: 2 additions & 3 deletions messagebatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import (
"context"
"encoding/json"
"errors"
"os"
"testing"
Expand Down Expand Up @@ -61,10 +62,8 @@
},
OutputConfig: anthropic.OutputConfigParam{
Effort: anthropic.OutputConfigEffortLow,
Format: anthropic.JSONOutputFormatParam{

Check failure on line 65 in messagebatch_test.go

View workflow job for this annotation

GitHub Actions / detect-breaking-changes

cannot use map[string]any{…} (value of type map[string]any) as "encoding/json".RawMessage value in struct literal
Schema: map[string]any{
"foo": "bar",
},
Schema: json.RawMessage(`{"foo": "bar"}`),
},
},
ServiceTier: "auto",
Expand Down
Loading