mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
fix(anthropic): support anthropic-sdk-go v1.46.0
This commit is contained in:
@@ -219,7 +219,7 @@ func buildParams(
|
||||
apiModel := strings.ReplaceAll(model, ".", "-")
|
||||
|
||||
params := anthropic.MessageNewParams{
|
||||
Model: anthropic.Model(apiModel),
|
||||
Model: apiModel,
|
||||
Messages: anthropicMessages,
|
||||
MaxTokens: maxTokens,
|
||||
}
|
||||
@@ -262,7 +262,9 @@ func applyThinkingConfig(params *anthropic.MessageNewParams, level string) {
|
||||
params.Temperature = anthropic.MessageNewParams{}.Temperature
|
||||
|
||||
if level == "adaptive" {
|
||||
adaptive := anthropic.NewThinkingConfigAdaptiveParam()
|
||||
adaptive := anthropic.ThinkingConfigAdaptiveParam{
|
||||
Display: anthropic.ThinkingConfigAdaptiveDisplaySummarized,
|
||||
}
|
||||
params.Thinking = anthropic.ThinkingConfigParamUnion{OfAdaptive: &adaptive}
|
||||
params.OutputConfig = anthropic.OutputConfigParam{
|
||||
Effort: anthropic.OutputConfigEffortHigh,
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestBuildParams_BasicMessage(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("buildParams() error: %v", err)
|
||||
}
|
||||
if string(params.Model) != "claude-sonnet-4-6" {
|
||||
if params.Model != "claude-sonnet-4-6" {
|
||||
t.Errorf("Model = %q, want %q", params.Model, "claude-sonnet-4-6")
|
||||
}
|
||||
if params.MaxTokens != 1024 {
|
||||
|
||||
Reference in New Issue
Block a user