mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
docs(config): add examples for config agents
PiperOrigin-RevId: 793871778
This commit is contained in:
committed by
Copybara-Service
parent
88114d7c73
commit
d87feb8ddb
@@ -0,0 +1,10 @@
|
||||
from google.adk.agents import LlmAgent
|
||||
|
||||
agent = LlmAgent(
|
||||
name="life_agent",
|
||||
description="Life agent",
|
||||
instruction=(
|
||||
"You are a life agent. You are responsible for answering"
|
||||
" questions about life."
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/google/adk-python/refs/heads/main/src/google/adk/agents/config_schemas/AgentConfig.json
|
||||
name: root_agent
|
||||
model: gemini-2.0-flash
|
||||
description: Root agent
|
||||
instruction: |
|
||||
If the user query is about life, you should route it to the life sub-agent.
|
||||
If the user query is about work, you should route it to the work sub-agent.
|
||||
If the user query is about anything else, you should answer it yourself.
|
||||
sub_agents:
|
||||
- config_path: ./work_agent.yaml
|
||||
- code: sub_agents.life_agent.agent
|
||||
@@ -0,0 +1,5 @@
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/google/adk-python/refs/heads/main/src/google/adk/agents/config_schemas/AgentConfig.json
|
||||
name: work_agent
|
||||
description: Work agent
|
||||
instruction: |
|
||||
You are a work agent. You are responsible for answering questions about work.
|
||||
Reference in New Issue
Block a user