Pydantic AI
Pydantic AI: auth म्हणून API कीसह 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