Pydantic AI
Pydantic AI: API 키를 auth로 지정한 MCPToolset을 에이전트 toolsets에 추가합니다.
- API 키(Bearer)
- OAuth 로그인
에이전트 코드
추천import asyncio, os
from pydantic_ai import Agent
from pydantic_ai.mcp import MCPToolset
toolset = MCPToolset("https://aicharged.io/api/v1/mcp", auth=os.environ["AICHARGED_API_KEY"])
agent = Agent("openai:gpt-6.1-sol", toolsets=[toolset])
async def main():
result = await agent.run("List my recent aicharged.io runs")
print(result.output)
asyncio.run(main())
패키지 설치
pip install pydantic-ai