Skip to content

Commit 48971d4

Browse files
wuliang229copybara-github
authored andcommitted
feat(config): support output_key and include_contents in LlmAgentConfig
PiperOrigin-RevId: 782170665
1 parent b2ef9a0 commit 48971d4

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/google/adk/agents/config_schemas/AgentConfig.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@
7676
],
7777
"default": null,
7878
"title": "Disallow Transfer To Peers"
79+
},
80+
"output_key": {
81+
"anyOf": [
82+
{
83+
"type": "string"
84+
},
85+
{
86+
"type": "null"
87+
}
88+
],
89+
"default": null,
90+
"title": "Output Key"
91+
},
92+
"include_contents": {
93+
"default": "default",
94+
"enum": [
95+
"default",
96+
"none"
97+
],
98+
"title": "Include Contents",
99+
"type": "string"
79100
}
80101
},
81102
"required": [

src/google/adk/agents/llm_agent.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,10 @@ def from_config(
537537
agent.disallow_transfer_to_parent = config.disallow_transfer_to_parent
538538
if config.disallow_transfer_to_peers:
539539
agent.disallow_transfer_to_peers = config.disallow_transfer_to_peers
540+
if config.include_contents != 'default':
541+
agent.include_contents = config.include_contents
542+
if config.output_key:
543+
agent.output_key = config.output_key
540544
return agent
541545

542546

@@ -562,3 +566,9 @@ class LlmAgentConfig(BaseAgentConfig):
562566

563567
disallow_transfer_to_peers: Optional[bool] = None
564568
"""Optional. LlmAgent.disallow_transfer_to_peers."""
569+
570+
output_key: Optional[str] = None
571+
"""Optional. LlmAgent.output_key."""
572+
573+
include_contents: Literal['default', 'none'] = 'default'
574+
"""Optional. LlmAgent.include_contents."""

0 commit comments

Comments
 (0)