Skip to main content

agent-construction

Build and troubleshoot ADK Python Agent/LlmAgent definitions, model settings, modes, callbacks, schemas, and multi-agent delegation.

설치로 이동

소스 정보

저장소
VectorSpaceLab/AREX-Skill
최근 소스 활동
2026년 8월 26일 16:31
감지된 SKILL.md 언어
영어
스타
12
포크
2

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
5 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
agent-construction
description
Build and troubleshoot ADK Python Agent/LlmAgent definitions, model settings, modes, callbacks, schemas, and multi-agent delegation.
disable-model-invocation
true
metadata
{"disco-role":"operating"}
license
Apache 2.0
# ADK Python Agent Construction Use this sub-skill when a user asks to define, revise, or debug Python ADK agents built with `google.adk.Agent` or `google.adk.agents.LlmAgent`. ## Route Here - Create a minimal `root_agent`, add `model`, `instruction`, `description`, tools, callbacks, or schemas. - Choose between `mode="chat"`, `mode="task"`, and `mode="single_turn"` for LLM agents and sub-agents. - Build hierarchical multi-agent systems with `sub_agents`, delegation descriptions, `task` agents, or `single_turn` helper agents. - Add structured input/output with Pydantic schemas, `output_schema`, `input_schema`, and `output_key`. - Diagnose constructor validation errors, missing model credentials, callback ordering, schema/tool interactions, and sub-agent context isolation. ## Route Elsewhere - Workflow graph nodes, `Workflow`, `BaseNode`, graph edges, dynamic nodes, joins, and workflow HITL: use `workflow-orchestration`. - ADK CLI commands, YAML app loading, `adk run`, `adk web`, deployment, and config schema generation: use `cli-configuration-deployment`. - Tool internals, toolsets, MCP/OpenAPI/Google API tools, auth flows, and optional integration extras: use `tools-and-integrations`. - Runner services, sessions, memory, artifacts, plugins, telemetry, and code executors: use `runtime-services`. - Modifying the ADK source repository itself, style, focused tests, docs, or samples: use `repo-development`. ## Quick Start 1. Import from the public package: `from google.adk import Agent` or `from google.adk.agents import LlmAgent, RunConfig`. 2. Name agents with valid Python identifiers; never use `user` as an agent name. 3. Put model behavior in `instruction`, static generation options in `generate_content_config`, tools in `tools`, and final response schemas in `output_schema`. 4. Expose a Python app by defining `root_agent = Agent(...)` in an importable module. 5. Use a `Runner` only after selecting runtime services and creating or auto-creating sessions; this sub-skill focuses on the agent definitions. ```python from google.adk import Agent def get_weather(city: str) -> str: """Return a simple weather summary.""" return f"Weather for {city}: sunny." root_agent = Agent( name="weather_agent", model="gemini-3.5-flash", instruction="Answer weather questions and call tools when needed.", tools=[get_weather], ) ``` ## References - [API reference](references/api-reference.md) — constructor fields, imports, validation rules, callbacks, schemas, `RunConfig`, and `Runner.run` invocation shape. - [Workflows](references/workflows.md) — recipes for minimal agents, sample app layout, callbacks, structured output, `task` and `single_turn` sub-agents, and multi-agent delegation. - [Troubleshooting](references/troubleshooting.md) — fixes for generation config errors, schema/tool behavior, model credentials, branch isolation, callback order, and tool error callbacks. - [Inspection script](scripts/inspect_agent_api.py) — safe local diagnostic that prints installed ADK signatures and constructs a no-network minimal agent. ## Agent-Construction Checklist - Agent tree has unique, identifier-safe names and clear one-line `description` strings for delegatable sub-agents. - Root `LlmAgent` runs in chat mode; `task` and `single_turn` are usually child agents exposed to the parent as tools. - `output_schema` is used for final structured responses; `generate_content_config.response_schema` is not used on `LlmAgent`. - Tool callables have docstrings and typed parameters; deeper toolset/auth issues route to `tools-and-integrations`. - Callback functions return `None` to continue, or the documented override shape to short-circuit or replace model/tool behavior. - Model/provider credentials and optional extras are treated as deployment assumptions, not as requirements for constructing an in-memory agent object.
GitHub에서 보기