Skip to content

Commit d833627

Browse files
wuliang229copybara-github
authored andcommitted
feat(config): add disallow_transfer_to_parent and disallow_transfer_to_peers to LlmAgentConfig
PiperOrigin-RevId: 781690247
1 parent aef54f8 commit d833627

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,30 @@
3737
"instruction": {
3838
"title": "Instruction",
3939
"type": "string"
40+
},
41+
"disallow_transfer_to_parent": {
42+
"anyOf": [
43+
{
44+
"type": "boolean"
45+
},
46+
{
47+
"type": "null"
48+
}
49+
],
50+
"default": null,
51+
"title": "Disallow Transfer To Parent"
52+
},
53+
"disallow_transfer_to_peers": {
54+
"anyOf": [
55+
{
56+
"type": "boolean"
57+
},
58+
{
59+
"type": "null"
60+
}
61+
],
62+
"default": null,
63+
"title": "Disallow Transfer To Peers"
4064
}
4165
},
4266
"required": [

src/google/adk/agents/llm_agent.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,10 @@ def from_config(
532532
agent.model = config.model
533533
if config.instruction:
534534
agent.instruction = config.instruction
535+
if config.disallow_transfer_to_parent:
536+
agent.disallow_transfer_to_parent = config.disallow_transfer_to_parent
537+
if config.disallow_transfer_to_peers:
538+
agent.disallow_transfer_to_peers = config.disallow_transfer_to_peers
535539
return agent
536540

537541

@@ -551,3 +555,9 @@ class LlmAgentConfig(BaseAgentConfig):
551555

552556
instruction: str
553557
"""Required. LlmAgent.instruction."""
558+
559+
disallow_transfer_to_parent: Optional[bool] = None
560+
"""Optional. LlmAgent.disallow_transfer_to_parent."""
561+
562+
disallow_transfer_to_peers: Optional[bool] = None
563+
"""Optional. LlmAgent.disallow_transfer_to_peers."""

0 commit comments

Comments
 (0)