安装
配置适配器
说明
- 在
models数组中声明计划使用的 Phaseo 模型 ID。 - OpenAI 兼容适配器默认使用 Chat Completions。Responses 专属功能请直接调用 API。
- 如果模型在工作流中不支持工具或图像,请在 TanStack AI 中声明更窄的能力,以便 TypeScript 更早发现不支持的调用。
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
将 Phaseo 与 TanStack AI 的 OpenAI 兼容适配器配合使用。
npm install @tanstack/ai @tanstack/ai-openai
import { chat } from "@tanstack/ai";
import { openaiCompatible } from "@tanstack/ai-openai/compatible";
const phaseo = openaiCompatible({
name: "phaseo",
baseURL: "https://api.phaseo.app/v1",
apiKey: process.env.PHASEO_API_KEY!,
models: ["openai/gpt-5-nano", "anthropic/claude-sonnet-4.5"],
});
const stream = chat({
adapter: phaseo("openai/gpt-5-nano"),
messages: [{ role: "user", content: "Reply with only: ok" }],
});
models 数组中声明计划使用的 Phaseo 模型 ID。