3. Agent Skills & Agent Card
3. Agent Skills & Agent Card
A2A 에이전트가 무언가를 하기 전에, 무엇을 할 수 있는지(스킬)와 다른 에이전트나 클라이언트가 그 역량을 어떻게 알아낼 수 있는지(Agent Card)를 정의해야 해요. a2a-samples/samples/python/agents/helloworld/에 있는 helloworld 예제를 사용할게요.
출처: 문서
본문
Agent Skills
Agent Skill은 에이전트가 수행할 수 있는 특정 역량 또는 기능을 설명해요. 클라이언트에게 에이전트가 어떤 종류의 태스크에 적합한지 알려주는 구성 요소이죠.
AgentSkill(a2a.types에 정의됨)의 속성:
id: 스킬의 고유 식별자.name: 사람이 읽을 수 있는 이름.description: 스킬이 무엇을 하는지에 대한 더 상세한 설명.tags: 분류와 발견을 위한 키워드.examples: 샘플 프롬프트 또는 사용 사례.input_modes/output_modes: 입력·출력에서 지원하는 Media Types(예: "text/plain", "application/json").security_requirements: 이 스킬에 필요한 보안 스킴.
__main__.py에서 Helloworld 에이전트용 스킬이 어떻게 정의되는지 볼 수 있어요:
# Defines the abilities or functions that agent can perform.
skill = AgentSkill(
id='echo_bot',
name='Echo Bot',
description='An example agent that acknowledges client request and responds with a "Hello World" message.',
input_modes=['text/plain'],
output_modes=['text/plain'],
tags=['a2a', 'echo-example'],
examples=['hi', 'how are you'],
)
이 스킬은 매우 단순해요. "Returns hello world"라는 이름이고 주로 텍스트를 다룹니다.
Agent Card
Agent Card는 A2A 서버가 제공하는 JSON 문서로, 대개 .well-known/agent-card.json 엔드포인트에서 접근할 수 있어요. 에이전트의 디지털 명함 같은 역할이죠.
AgentCard(a2a.types에 정의됨)의 주요 속성:
name,description,version: 기본 정체성 정보.supported_interfaces: A2A 서비스에 도달할 수 있는 엔드포인트와 프로토콜의 순서가 있는 목록.capabilities:streaming이나extended_agent_card같은 지원되는 A2A 기능.default_input_modes/default_output_modes: 에이전트의 기본 Media Types.skills: 에이전트가 제공하는AgentSkill객체 목록.
helloworld 예제는 Agent Card를 이렇게 정의해요:
# Define a public-facing agent card that allows clients to discover your agent's capabilities.
public_agent_card = AgentCard(
# Basic identity information of A2A server
name='Hello World Agent', # Identity
description='Just a hello world agent',
version='0.0.1',
# Default Media Types for the agent's interactions
default_input_modes=['text/plain'], # Supported media types
default_output_modes=['text/plain'],
# Supported A2A features (like streaming or extended config)
capabilities=AgentCapabilities(streaming=True, extended_agent_card=True),
# Ordered list of endpoints and protocols where the service can be reached
supported_interfaces=[
AgentInterface(
protocol_binding='JSONRPC',
url='http://127.0.0.1:9999',
protocol_version='1.0',
)
],
# The list of AgentSkill objects that this agent offers
skills=[skill],
# Optional attributes (omitted here for simplicity):
# icon_url -> A URL to an icon representing the agent
)
이 카드는 에이전트 이름이 "Hello World Agent"이고, http://127.0.0.1:9999/에서 실행되며, 텍스트 상호작용을 지원하고, hello_world 스킬을 가진다는 걸 알려줘요.
더 알아보기 (Learn more)
- 에이전트 로직을 구현하는 다음 단계는 4. The Agent Executor를 참고하세요.
- Agent Card의 개념은 핵심 개념(Key Concepts)에서 확인하세요.