Team A: Host Agent 구현
분석 대상
HostAgent 클래스 구조
class HostAgent:
def __init__(self, bearer_token, memory_hook=None,
bedrock_model_id="global.anthropic.claude-sonnet-4-20250514-v1:0"):
# Rate Limiting
self._bedrock_semaphore = Semaphore(2) # 동시 2개 API 호출
self._last_api_call_time = 0
self._min_delay_between_calls = 1.0 # 최소 1초 간격
# 원격 에이전트 관리
self.remote_agent_connections = {} # name → RemoteAgentConnections
self.cards = {} # name → AgentCard
self.completed_requests = set() # 중복 방지
# 도구: current_time + send_message_tool
@tool
async def send_message_tool(agent_name: str, task: str) -> str:
return await self._send_message_impl(agent_name, task)
self.tools = [current_time, send_message_tool]_async_init_components: 원격 에이전트 검색
Semaphore 기반 Rate Limiting
Rate Limiting 메커니즘 비교
메커니즘
구현
위치
BedrockAgentCoreApp 엔트리포인트
토론 질문
마지막 업데이트