Skip to content
Merged
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
4 changes: 2 additions & 2 deletions go/api/v1alpha2/agent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ type DeclarativeAgentSpec struct {
// +optional
ModelConfig string `json:"modelConfig,omitempty"`
// Whether to stream the response from the model.
// If not specified, the default value is true.
// If not specified, the default value is false.
// +optional
Stream *bool `json:"stream,omitempty"`
Stream bool `json:"stream,omitempty"`
// +kubebuilder:validation:MaxItems=20
Tools []*Tool `json:"tools,omitempty"`
// A2AConfig instantiates an A2A server for this agent,
Expand Down
5 changes: 0 additions & 5 deletions go/api/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go/config/crd/bases/kagent.dev_agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9691,7 +9691,7 @@ spec:
stream:
description: |-
Whether to stream the response from the model.
If not specified, the default value is true.
If not specified, the default value is false.
type: boolean
systemMessage:
description: SystemMessage is a string specifying the system message
Expand Down
1 change: 1 addition & 0 deletions go/internal/adk/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ type AgentConfig struct {
SseTools []SseMcpServerConfig `json:"sse_tools"`
RemoteAgents []RemoteAgentConfig `json:"remote_agents"`
ExecuteCode bool `json:"execute_code,omitempty"`
Stream bool `json:"stream"`
}

func (a *AgentConfig) UnmarshalJSON(data []byte) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ func (a *adkApiTranslator) translateInlineAgent(ctx context.Context, agent *v1al
Instruction: systemMessage,
Model: model,
ExecuteCode: false && ptr.Deref(agent.Spec.Declarative.ExecuteCodeBlocks, false), //ignored due to this issue https://github.com/google/adk-python/issues/3921.
Stream: agent.Spec.Declarative.Stream,
}

for _, tool := range agent.Spec.Declarative.Tools {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
operation: translateAgent
targetObject: basic-agent
namespace: test
objects:
- apiVersion: v1
kind: Secret
metadata:
name: openai-secret
namespace: test
data:
api-key: c2stdGVzdC1hcGkta2V5 # base64 encoded "sk-test-api-key"
- apiVersion: kagent.dev/v1alpha2
kind: ModelConfig
metadata:
name: basic-model
namespace: test
spec:
provider: OpenAI
model: gpt-4o
apiKeySecret: openai-secret
apiKeySecretKey: api-key
openAI:
temperature: "0.7"
maxTokens: 1024
topP: "0.95"
reasoningEffort: "low"
defaultHeaders:
User-Agent: "kagent/1.0"
- apiVersion: kagent.dev/v1alpha2
kind: Agent
metadata:
name: basic-agent
namespace: test
spec:
type: Declarative
declarative:
description: A basic test agent
systemMessage: You are a helpful assistant.
modelConfig: basic-model
stream: true
deployment:
resources:
requests:
cpu: 200m
memory: 684Mi
limits:
cpu: 3000m
memory: 2Gi
tools: []
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -63,7 +64,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent_with_code\",\"description\":\"\",\"url\":\"http://agent-with-code.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"headers\":{\"User-Agent\":\"kagent/1.0\"},\"base_url\":\"\",\"max_tokens\":1024,\"reasoning_effort\":\"low\",\"temperature\":0.7,\"top_p\":0.95},\"description\":\"\",\"instruction\":\"You are a helpful assistant.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"headers\":{\"User-Agent\":\"kagent/1.0\"},\"base_url\":\"\",\"max_tokens\":1024,\"reasoning_effort\":\"low\",\"temperature\":0.7,\"top_p\":0.95},\"description\":\"\",\"instruction\":\"You are a helpful assistant.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -132,7 +133,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "15800629975074137223"
"kagent.dev/config-hash": "10194218485187346598"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -70,7 +71,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent\",\"description\":\"\",\"url\":\"http://agent.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are a math toolserver. Focus on solving mathematical problems step by step.\",\"http_tools\":[{\"params\":{\"url\":\"http://localhost:8084/mcp\",\"headers\":{\"MATH\":\"sk-test-api-key\"},\"timeout\":30,\"sse_read_timeout\":300},\"tools\":[\"k8s_get_resources\"]}],\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are a math toolserver. Focus on solving mathematical problems step by step.\",\"http_tools\":[{\"params\":{\"url\":\"http://localhost:8084/mcp\",\"headers\":{\"MATH\":\"sk-test-api-key\"},\"timeout\":30,\"sse_read_timeout\":300},\"tools\":[\"k8s_get_resources\"]}],\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -139,7 +140,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "8768892159480624774"
"kagent.dev/config-hash": "11246224890029939632"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -66,7 +67,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent\",\"description\":\"\",\"url\":\"http://agent.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are a math toolserver. Focus on solving mathematical problems step by step.\",\"http_tools\":[{\"params\":{\"url\":\"http://toolserver.test:8084/mcp\",\"headers\":{}},\"tools\":[\"k8s_get_resources\"]}],\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are a math toolserver. Focus on solving mathematical problems step by step.\",\"http_tools\":[{\"params\":{\"url\":\"http://toolserver.test:8084/mcp\",\"headers\":{}},\"tools\":[\"k8s_get_resources\"]}],\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -135,7 +136,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "12589128794779205881"
"kagent.dev/config-hash": "3664580906535457241"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"url": "http://specialist-agent.test:8080"
}
],
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -64,7 +65,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"parent_agent\",\"description\":\"\",\"url\":\"http://parent-agent.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are a coordinating agent that can delegate tasks to specialists.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":[{\"name\":\"test__NS__specialist_agent\",\"url\":\"http://specialist-agent.test:8080\",\"headers\":{\"FOO\":\"sup3rs3cr3t\"}}]}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are a coordinating agent that can delegate tasks to specialists.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":[{\"name\":\"test__NS__specialist_agent\",\"url\":\"http://specialist-agent.test:8080\",\"headers\":{\"FOO\":\"sup3rs3cr3t\"}}],\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -133,7 +134,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "5107186355478406073"
"kagent.dev/config-hash": "10891468836850404374"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"url": "http://proxy.kagent.svc.cluster.local:8080"
}
],
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -76,7 +77,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent_with_proxy\",\"description\":\"\",\"url\":\"http://agent-with-proxy.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"http://proxy.kagent.svc.cluster.local:8080/mcp\",\"headers\":{\"x-kagent-host\":\"test-mcp-server.kagent\"}},\"tools\":[\"test-tool\"]}],\"sse_tools\":null,\"remote_agents\":[{\"name\":\"test__NS__nested_agent\",\"url\":\"http://proxy.kagent.svc.cluster.local:8080\",\"headers\":{\"x-kagent-host\":\"nested-agent.test\"}}]}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"http://proxy.kagent.svc.cluster.local:8080/mcp\",\"headers\":{\"x-kagent-host\":\"test-mcp-server.kagent\"}},\"tools\":[\"test-tool\"]}],\"sse_tools\":null,\"remote_agents\":[{\"name\":\"test__NS__nested_agent\",\"url\":\"http://proxy.kagent.svc.cluster.local:8080\",\"headers\":{\"x-kagent-host\":\"nested-agent.test\"}}],\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -145,7 +146,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "2171631320400289677"
"kagent.dev/config-hash": "17257565806405363696"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -66,7 +67,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent_with_proxy_external\",\"description\":\"\",\"url\":\"http://agent-with-proxy-external.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"https://external-mcp.example.com/mcp\",\"headers\":{}},\"tools\":[\"test-tool\"]}],\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"https://external-mcp.example.com/mcp\",\"headers\":{}},\"tools\":[\"test-tool\"]}],\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -135,7 +136,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "12862703226447143214"
"kagent.dev/config-hash": "8178097805977326496"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -68,7 +69,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent_with_proxy_mcpserver\",\"description\":\"\",\"url\":\"http://agent-with-proxy-mcpserver.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"http://proxy.kagent.svc.cluster.local:8080/mcp\",\"headers\":{\"x-kagent-host\":\"test-mcp-server.test\"}},\"tools\":[\"test-tool\"]}],\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"http://proxy.kagent.svc.cluster.local:8080/mcp\",\"headers\":{\"x-kagent-host\":\"test-mcp-server.test\"}},\"tools\":[\"test-tool\"]}],\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -137,7 +138,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "11864275370140522422"
"kagent.dev/config-hash": "4693175952507523169"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -68,7 +69,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent_with_proxy_service\",\"description\":\"\",\"url\":\"http://agent-with-proxy-service.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"http://proxy.kagent.svc.cluster.local:8080/mcp\",\"headers\":{\"x-kagent-host\":\"toolserver.test\"}},\"tools\":[\"k8s_get_resources\"]}],\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"base_url\":\"\"},\"description\":\"\",\"instruction\":\"You are an agent that uses proxies.\",\"http_tools\":[{\"params\":{\"url\":\"http://proxy.kagent.svc.cluster.local:8080/mcp\",\"headers\":{\"x-kagent-host\":\"toolserver.test\"}},\"tools\":[\"k8s_get_resources\"]}],\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -137,7 +138,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "16730647920037520731"
"kagent.dev/config-hash": "7719728343587482633"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -63,7 +64,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent_with_scheduling_attributes\",\"description\":\"\",\"url\":\"http://agent-with-scheduling-attributes.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"headers\":{\"User-Agent\":\"kagent/1.0\"},\"base_url\":\"\",\"max_tokens\":1024,\"reasoning_effort\":\"low\",\"temperature\":0.7,\"top_p\":0.95},\"description\":\"\",\"instruction\":\"You are a helpful assistant.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"headers\":{\"User-Agent\":\"kagent/1.0\"},\"base_url\":\"\",\"max_tokens\":1024,\"reasoning_effort\":\"low\",\"temperature\":0.7,\"top_p\":0.95},\"description\":\"\",\"instruction\":\"You are a helpful assistant.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -132,7 +133,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "13768537007944496650"
"kagent.dev/config-hash": "15437755402660806386"
},
"labels": {
"app": "kagent",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"type": "openai"
},
"remote_agents": null,
"sse_tools": null
"sse_tools": null,
"stream": false
},
"manifest": [
{
Expand Down Expand Up @@ -63,7 +64,7 @@
},
"stringData": {
"agent-card.json": "{\"name\":\"agent_with_security_context\",\"description\":\"\",\"url\":\"http://agent-with-security-context.test:8080\",\"version\":\"\",\"capabilities\":{\"streaming\":true,\"pushNotifications\":false,\"stateTransitionHistory\":true},\"defaultInputModes\":[\"text\"],\"defaultOutputModes\":[\"text\"],\"skills\":[]}",
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"headers\":{\"User-Agent\":\"kagent/1.0\"},\"base_url\":\"\",\"max_tokens\":1024,\"reasoning_effort\":\"low\",\"temperature\":0.7,\"top_p\":0.95},\"description\":\"\",\"instruction\":\"You are a helpful assistant.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":null}"
"config.json": "{\"model\":{\"type\":\"openai\",\"model\":\"gpt-4o\",\"headers\":{\"User-Agent\":\"kagent/1.0\"},\"base_url\":\"\",\"max_tokens\":1024,\"reasoning_effort\":\"low\",\"temperature\":0.7,\"top_p\":0.95},\"description\":\"\",\"instruction\":\"You are a helpful assistant.\",\"http_tools\":null,\"sse_tools\":null,\"remote_agents\":null,\"stream\":false}"
}
},
{
Expand Down Expand Up @@ -132,7 +133,7 @@
"template": {
"metadata": {
"annotations": {
"kagent.dev/config-hash": "2770494845494297236"
"kagent.dev/config-hash": "3469672779965722811"
},
"labels": {
"app": "kagent",
Expand Down
Loading