통합
AutoGen
Microsoft AutoGen 에이전트에 Thunderbit 기반 웹 Reader 장착
AutoGen 에이전트는 Python 함수를 Tool 로 받습니다. /distill 을 감싸면 어떤 AssistantAgent(또는 GroupChat 멤버) 든 실시간 웹 콘텐츠를 가져올 수 있습니다.
설치
pip install pyautogen httpx함수 Tool
import httpx
API = "https://openapi.thunderbit.com/openapi/v1"
H = {"Authorization": "Bearer YOUR_API_KEY"}
def read_url(url: str) -> str:
"""Fetch a URL and return clean Markdown.
Use for any web research task: docs, articles, search results, product pages.
"""
resp = httpx.post(f"{API}/distill",
headers=H,
json={"url": url, "renderMode": "basic"},
timeout=60.0)
resp.raise_for_status()
return resp.json()["data"]["markdown"]Agent 에 등록
from autogen import AssistantAgent, UserProxyAgent
llm_config = {"model": "gpt-4o", "api_key": "YOUR_OPENAI_KEY"}
researcher = AssistantAgent(name="researcher", llm_config=llm_config)
proxy = UserProxyAgent(name="proxy", code_execution_config=False)
researcher.register_for_llm(name="read_url", description="Fetch URL as Markdown")(read_url)
proxy.register_for_execution(name="read_url")(read_url)
proxy.initiate_chat(researcher, message="Summarize https://arxiv.org/abs/2501.00001")GroupChat
여러 Agent 가 협업하는 crew(researcher + writer + critic)라면 read_url 을 researcher 의 register_for_llm 에만 등록하세요 —— 다른 Agent 가 트리거할 수 없게 됩니다. 실행은 여전히 공용 UserProxyAgent 를 거칩니다.
관련 문서
- CrewAI —— 비슷한 멀티 에이전트 패턴
- Agent Read-URL Tool