Skip to content

Commit 921aba9

Browse files
authored
Merge branch 'main' into e2e-workflow-debugability
2 parents fcec9a8 + b7c338e commit 921aba9

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

go/core/internal/controller/translator/agent/adk_api_translator.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,16 @@ func (a *adkApiTranslator) translateModel(ctx context.Context, namespace, modelC
508508
anthropic.APIKeyPassthrough = model.Spec.APIKeyPassthrough
509509

510510
if model.Spec.Anthropic != nil {
511-
anthropic.BaseUrl = model.Spec.Anthropic.BaseURL
511+
spec := model.Spec.Anthropic
512+
anthropic.BaseUrl = spec.BaseURL
513+
anthropic.Temperature = utils.ParseStringToFloat64(spec.Temperature)
514+
anthropic.TopP = utils.ParseStringToFloat64(spec.TopP)
515+
if spec.MaxTokens > 0 {
516+
anthropic.MaxTokens = &spec.MaxTokens
517+
}
518+
if spec.TopK > 0 {
519+
anthropic.TopK = &spec.TopK
520+
}
512521
}
513522
return anthropic, modelDeploymentData, secretHashBytes, nil
514523
case v1alpha2.ModelProviderAzureOpenAI:

go/core/internal/controller/translator/agent/testdata/outputs/anthropic_agent.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
"description": "",
2323
"instruction": "You are Claude, an AI assistant created by Anthropic.",
2424
"model": {
25+
"max_tokens": 4096,
2526
"model": "claude-3-sonnet-20240229",
27+
"temperature": 0.3,
28+
"top_k": 40,
29+
"top_p": 0.9,
2630
"type": "anthropic"
2731
},
2832
"stream": false
@@ -54,7 +58,7 @@
5458
},
5559
"stringData": {
5660
"agent-card.json": "{\"name\":\"anthropic_agent\",\"description\":\"\",\"url\":\"http://anthropic-agent.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[],\"preferredTransport\":\"JSONRPC\"}",
57-
"config.json": "{\"model\":{\"type\":\"anthropic\",\"model\":\"claude-3-sonnet-20240229\"},\"description\":\"\",\"instruction\":\"You are Claude, an AI assistant created by Anthropic.\",\"stream\":false}"
61+
"config.json": "{\"model\":{\"type\":\"anthropic\",\"model\":\"claude-3-sonnet-20240229\",\"max_tokens\":4096,\"temperature\":0.3,\"top_p\":0.9,\"top_k\":40},\"description\":\"\",\"instruction\":\"You are Claude, an AI assistant created by Anthropic.\",\"stream\":false}"
5862
}
5963
},
6064
{
@@ -123,7 +127,7 @@
123127
"template": {
124128
"metadata": {
125129
"annotations": {
126-
"kagent.dev/config-hash": "12361184581110359614"
130+
"kagent.dev/config-hash": "11498376381486429584"
127131
},
128132
"labels": {
129133
"app": "kagent",

0 commit comments

Comments
 (0)