Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
使用 PydanticAI 和 Phaseo 构建类型化的 Python 智能体。
OpenAIChatModel
OpenAIProvider
https://api.phaseo.app/v1
pip install "pydantic-ai-slim[openai]"
import os from pydantic_ai import Agent from pydantic_ai.models.openai import OpenAIChatModel from pydantic_ai.providers.openai import OpenAIProvider model = OpenAIChatModel( "openai/gpt-6-astra", provider=OpenAIProvider( api_key=os.environ["PHASEO_API_KEY"], base_url="https://api.phaseo.app/v1", ), ) agent = Agent(model, system_prompt="Answer concisely.") result = agent.run_sync("Reply with only: ok") print(result.output)
ok
phaseo:apply_patch
此页面对您有帮助吗?