安装
配置 Agent
说明
- 只使用 Base URL,不要添加
/chat/completions或/responses。 - Mastra Agent 的行为取决于 AI SDK 供应商路径。上线前请测试工具和流式传输。
- 需要设置供应商偏好时,可按请求使用 Phaseo 路由控制,也可通过 presets 设置。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
在 Mastra Agent 和工作流中使用 Phaseo 模型。
npm install @mastra/core @ai-sdk/openai ai
import { Agent } from "@mastra/core/agent";
import { createOpenAI } from "@ai-sdk/openai";
const phaseo = createOpenAI({
apiKey: process.env.PHASEO_API_KEY,
baseURL: "https://api.phaseo.app/v1",
compatibility: "compatible",
});
export const agent = new Agent({
name: "support-agent",
instructions: "Answer in two short paragraphs.",
model: phaseo("openai/gpt-5-nano"),
});
/chat/completions 或 /responses。