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