mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
docs: update Anthropic model references to Opus 4.8
This commit is contained in:
@@ -110,7 +110,7 @@ new BuiltInAgent({
|
||||
type: "aisdk",
|
||||
factory: ({ input, abortSignal }) =>
|
||||
streamText({
|
||||
model: anthropic("claude-sonnet-4"),
|
||||
model: anthropic("claude-sonnet-4-6"),
|
||||
messages: convertMessagesToVercelAISDKMessages(input.messages),
|
||||
providerOptions: {
|
||||
anthropic: { thinking: { type: "enabled", budgetTokens: 10000 } },
|
||||
|
||||
@@ -7,7 +7,7 @@ BuiltInAgent model identifiers — the full set of `"provider/model"` strings th
|
||||
|
||||
```typescript
|
||||
new BuiltInAgent({ model: "openai/gpt-4o" });
|
||||
new BuiltInAgent({ model: "anthropic:claude-sonnet-4.5" });
|
||||
new BuiltInAgent({ model: "anthropic:claude-sonnet-4-6" });
|
||||
```
|
||||
|
||||
## Supported providers
|
||||
@@ -31,9 +31,8 @@ openai/gpt-4.1 openai/gpt-4.1-mini openai/gpt-4.1-nano
|
||||
openai/gpt-4o openai/gpt-4o-mini
|
||||
openai/o3 openai/o3-mini openai/o4-mini
|
||||
|
||||
anthropic/claude-sonnet-4.5 anthropic/claude-sonnet-4
|
||||
anthropic/claude-3.7-sonnet anthropic/claude-opus-4.1
|
||||
anthropic/claude-opus-4 anthropic/claude-3.5-haiku
|
||||
anthropic/claude-sonnet-4-6 anthropic/claude-sonnet-4-5
|
||||
anthropic/claude-opus-4-8 anthropic/claude-haiku-4-5
|
||||
|
||||
google/gemini-2.5-pro google/gemini-2.5-flash google/gemini-2.5-flash-lite
|
||||
```
|
||||
|
||||
@@ -17,16 +17,16 @@ import {
|
||||
describe("stripProviderPrefix", () => {
|
||||
it("strips known provider prefixes", () => {
|
||||
expect(stripProviderPrefix("openai/gpt-5.4")).toBe("gpt-5.4");
|
||||
expect(stripProviderPrefix("anthropic/claude-sonnet-4")).toBe(
|
||||
"claude-sonnet-4",
|
||||
expect(stripProviderPrefix("anthropic/claude-sonnet-4-6")).toBe(
|
||||
"claude-sonnet-4-6",
|
||||
);
|
||||
expect(stripProviderPrefix("google/gemini-2.5-pro")).toBe("gemini-2.5-pro");
|
||||
expect(stripProviderPrefix("cohere/command-r-plus")).toBe("command-r-plus");
|
||||
expect(stripProviderPrefix("meta/llama-4-scout")).toBe("llama-4-scout");
|
||||
expect(stripProviderPrefix("mistral/mistral-large")).toBe("mistral-large");
|
||||
expect(stripProviderPrefix("azure/gpt-4o")).toBe("gpt-4o");
|
||||
expect(stripProviderPrefix("bedrock/claude-sonnet-4")).toBe(
|
||||
"claude-sonnet-4",
|
||||
expect(stripProviderPrefix("bedrock/claude-sonnet-4-6")).toBe(
|
||||
"claude-sonnet-4-6",
|
||||
);
|
||||
expect(stripProviderPrefix("vertex/gemini-2.5-flash")).toBe(
|
||||
"gemini-2.5-flash",
|
||||
@@ -35,7 +35,7 @@ describe("stripProviderPrefix", () => {
|
||||
|
||||
it("returns the name unchanged when no prefix matches", () => {
|
||||
expect(stripProviderPrefix("gpt-5.4")).toBe("gpt-5.4");
|
||||
expect(stripProviderPrefix("claude-sonnet-4")).toBe("claude-sonnet-4");
|
||||
expect(stripProviderPrefix("claude-sonnet-4-6")).toBe("claude-sonnet-4-6");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -46,7 +46,7 @@ describe("stripProviderPrefix", () => {
|
||||
describe("looksLikeModelName", () => {
|
||||
it("recognizes known model prefixes", () => {
|
||||
expect(looksLikeModelName("gpt-5.4")).toBe(true);
|
||||
expect(looksLikeModelName("claude-sonnet-4")).toBe(true);
|
||||
expect(looksLikeModelName("claude-sonnet-4-6")).toBe(true);
|
||||
expect(looksLikeModelName("gemini-2.5-pro")).toBe(true);
|
||||
expect(looksLikeModelName("o1")).toBe(true);
|
||||
expect(looksLikeModelName("o1-mini")).toBe(true);
|
||||
@@ -86,12 +86,12 @@ describe("extractModelNames", () => {
|
||||
it('extracts model from model: "..." pattern', () => {
|
||||
const content = [
|
||||
"```tsx",
|
||||
'const config = { model: "claude-sonnet-4" };',
|
||||
'const config = { model: "claude-sonnet-4-6" };',
|
||||
"```",
|
||||
].join("\n");
|
||||
|
||||
const results = extractModelNames(content);
|
||||
expect(results).toEqual([{ model: "claude-sonnet-4", line: 2 }]);
|
||||
expect(results).toEqual([{ model: "claude-sonnet-4-6", line: 2 }]);
|
||||
});
|
||||
|
||||
it('extracts model from "model": "..." JSON pattern', () => {
|
||||
@@ -139,14 +139,14 @@ describe("extractModelNames", () => {
|
||||
const content = [
|
||||
"```python",
|
||||
'a = ChatOpenAI(model="gpt-5.4")',
|
||||
'b = ChatAnthropic(model="claude-sonnet-4")',
|
||||
'b = ChatAnthropic(model="claude-sonnet-4-6")',
|
||||
"```",
|
||||
].join("\n");
|
||||
|
||||
const results = extractModelNames(content);
|
||||
expect(results).toHaveLength(2);
|
||||
expect(results[0].model).toBe("gpt-5.4");
|
||||
expect(results[1].model).toBe("claude-sonnet-4");
|
||||
expect(results[1].model).toBe("claude-sonnet-4-6");
|
||||
});
|
||||
|
||||
it("ignores text outside code blocks", () => {
|
||||
@@ -194,7 +194,7 @@ describe("loadAllowlist", () => {
|
||||
const allowed = loadAllowlist(allowlistPath);
|
||||
|
||||
expect(allowed.has("gpt-5.4")).toBe(true);
|
||||
expect(allowed.has("claude-sonnet-4")).toBe(true);
|
||||
expect(allowed.has("claude-sonnet-4-6")).toBe(true);
|
||||
expect(allowed.has("gemini-2.5-pro")).toBe(true);
|
||||
expect(allowed.has("command-r-plus")).toBe(true);
|
||||
expect(allowed.has("llama-4-scout")).toBe(true);
|
||||
@@ -231,7 +231,10 @@ describe("validateFiles", () => {
|
||||
|
||||
fs.writeFileSync(
|
||||
allowlist,
|
||||
JSON.stringify({ openai: ["gpt-5.4"], anthropic: ["claude-sonnet-4"] }),
|
||||
JSON.stringify({
|
||||
openai: ["gpt-5.4"],
|
||||
anthropic: ["claude-sonnet-4-6"],
|
||||
}),
|
||||
);
|
||||
fs.writeFileSync(
|
||||
path.join(dir, "test.mdx"),
|
||||
|
||||
@@ -151,7 +151,7 @@ function extractCodeRegions(
|
||||
* model="gpt-5.4-mini"
|
||||
* model: "gpt-5.4"
|
||||
* model='gemini-2.5-flash'
|
||||
* "model": "claude-sonnet-4"
|
||||
* "model": "claude-sonnet-4-6"
|
||||
* ChatOpenAI(model="gpt-5.4")
|
||||
* openai/gpt-5.4-mini (bare provider-prefixed)
|
||||
*/
|
||||
|
||||
@@ -556,7 +556,7 @@ async function checkTypeScriptQuickstart() {
|
||||
ANTHROPIC_API_KEY: LIVE_ANTHROPIC
|
||||
? process.env.ANTHROPIC_API_KEY
|
||||
: "test-key",
|
||||
CLAUDE_MODEL: process.env.CLAUDE_MODEL ?? "claude-sonnet-4-6",
|
||||
CLAUDE_MODEL: process.env.CLAUDE_MODEL ?? "claude-opus-4-8",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -679,7 +679,7 @@ async function checkPythonVersion(version: string) {
|
||||
ANTHROPIC_API_KEY: LIVE_ANTHROPIC
|
||||
? process.env.ANTHROPIC_API_KEY
|
||||
: "test-key",
|
||||
ANTHROPIC_MODEL: process.env.ANTHROPIC_MODEL ?? "claude-sonnet-4-6",
|
||||
ANTHROPIC_MODEL: process.env.ANTHROPIC_MODEL ?? "claude-opus-4-8",
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -269,7 +269,7 @@ describe("checkClaudeQuickstarts", () => {
|
||||
- \`src/agents/claude_agent_sdk_adapter.py\` - adapter
|
||||
- \`src/app/api/copilotkit/route.ts\` - runtime
|
||||
ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||
ANTHROPIC_MODEL=claude-sonnet-4-6
|
||||
ANTHROPIC_MODEL=claude-opus-4-8
|
||||
AGENT_URL=http://localhost:8000
|
||||
</TailoredContentOption>
|
||||
<TailoredContentOption id="bring-your-own" title="Use an existing agent" description="byoa">
|
||||
@@ -291,7 +291,7 @@ describe("checkClaudeQuickstarts", () => {
|
||||
return {"status": "ok"}
|
||||
@app.post("/")
|
||||
async def run_agent(input_data: RunAgentInput):
|
||||
adapter = ClaudeAgentAdapter(model=os.getenv("ANTHROPIC_MODEL", "claude-sonnet-4-6"))
|
||||
adapter = ClaudeAgentAdapter(model=os.getenv("ANTHROPIC_MODEL", "claude-opus-4-8"))
|
||||
async def event_stream():
|
||||
try:
|
||||
async for event in adapter.run(input_data):
|
||||
@@ -336,7 +336,7 @@ describe("checkClaudeQuickstarts", () => {
|
||||
- \`src/app/api/copilotkit/route.ts\` - runtime
|
||||
- \`src/app/page.tsx\` - frontend
|
||||
ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||
CLAUDE_MODEL=claude-sonnet-4-6
|
||||
CLAUDE_MODEL=claude-opus-4-8
|
||||
AGENT_URL=http://localhost:8000
|
||||
</TailoredContentOption>
|
||||
<TailoredContentOption id="bring-your-own" title="Use an existing agent" description="byoa">
|
||||
|
||||
@@ -532,7 +532,7 @@ const CLAUDE_QUICKSTARTS = [
|
||||
slug: "claude-sdk-python",
|
||||
path: "integrations/claude-sdk-python/quickstart.mdx",
|
||||
title: "Python",
|
||||
modelEnvLine: "ANTHROPIC_MODEL=claude-sonnet-4-6",
|
||||
modelEnvLine: "ANTHROPIC_MODEL=claude-opus-4-8",
|
||||
requiredStarterFiles: [
|
||||
"src/agent_server.py",
|
||||
"src/agents/claude_agent_sdk_adapter.py",
|
||||
@@ -543,7 +543,7 @@ const CLAUDE_QUICKSTARTS = [
|
||||
slug: "claude-sdk-typescript",
|
||||
path: "integrations/claude-sdk-typescript/quickstart.mdx",
|
||||
title: "TypeScript",
|
||||
modelEnvLine: "CLAUDE_MODEL=claude-sonnet-4-6",
|
||||
modelEnvLine: "CLAUDE_MODEL=claude-opus-4-8",
|
||||
requiredStarterFiles: [
|
||||
"src/agent_server.ts",
|
||||
"src/app/api/copilotkit/route.ts",
|
||||
|
||||
@@ -25,19 +25,12 @@
|
||||
],
|
||||
"anthropic": [
|
||||
"claude-fable-5",
|
||||
"claude-opus-4-8",
|
||||
"claude-opus-4-6",
|
||||
"claude-sonnet-4-6",
|
||||
"claude-haiku-4-5",
|
||||
"claude-opus-4-5",
|
||||
"claude-sonnet-4-5",
|
||||
"claude-opus-4-1",
|
||||
"claude-opus-4",
|
||||
"claude-sonnet-4",
|
||||
"claude-sonnet-4-0",
|
||||
"claude-opus-4-0",
|
||||
"claude-3-7-sonnet",
|
||||
"claude-3-5-haiku",
|
||||
"claude-3-5-sonnet",
|
||||
"claude-code"
|
||||
],
|
||||
"google": [
|
||||
|
||||
@@ -313,7 +313,7 @@ const agent = new BuiltInAgent({
|
||||
type: "aisdk",
|
||||
factory: ({ input, abortSignal }) =>
|
||||
streamText({
|
||||
model: anthropic("claude-sonnet-4", {
|
||||
model: anthropic("claude-sonnet-4-6", {
|
||||
thinking: { type: "enabled", budgetTokens: 10000 },
|
||||
}),
|
||||
messages: convertMessagesToVercelAISDKMessages(input.messages),
|
||||
@@ -339,7 +339,7 @@ const agent = new BuiltInAgent({
|
||||
factory: ({ input, abortController }) => {
|
||||
const { messages, systemPrompts } = convertInputToTanStackAI(input);
|
||||
return chat({
|
||||
adapter: anthropicText("claude-sonnet-4"),
|
||||
adapter: anthropicText("claude-sonnet-4-6"),
|
||||
messages,
|
||||
systemPrompts,
|
||||
modelOptions: { thinking: { type: "enabled", budgetTokens: 10000 } },
|
||||
@@ -476,8 +476,8 @@ const agent = new BuiltInAgent({
|
||||
const { messages, systemPrompts } = convertInputToTanStackAI(input);
|
||||
|
||||
const adapter =
|
||||
props.model === "anthropic/claude-sonnet-4"
|
||||
? anthropicText("claude-sonnet-4")
|
||||
props.model === "anthropic/claude-sonnet-4-6"
|
||||
? anthropicText("claude-sonnet-4-6")
|
||||
: openaiText((props.model as string) ?? "gpt-4o");
|
||||
|
||||
const modelOptions: Record<string, unknown> = {};
|
||||
@@ -502,7 +502,7 @@ Forward properties from the frontend provider:
|
||||
<FrontendOnly frontend="react">
|
||||
```tsx title="app/page.tsx"
|
||||
<CopilotKit
|
||||
properties={{ model: "anthropic/claude-sonnet-4", temperature: 0.3 }}
|
||||
properties={{ model: "anthropic/claude-sonnet-4-6", temperature: 0.3 }}
|
||||
useSingleEndpoint={false}
|
||||
>
|
||||
<CopilotChat />
|
||||
@@ -522,7 +522,7 @@ Forward properties from the frontend provider:
|
||||
provideCopilotKit({
|
||||
runtimeUrl: "/api/copilotkit",
|
||||
properties: {
|
||||
model: "anthropic/claude-sonnet-4",
|
||||
model: "anthropic/claude-sonnet-4-6",
|
||||
temperature: 0.3,
|
||||
},
|
||||
})
|
||||
|
||||
+38
-37
@@ -13,18 +13,18 @@ Specify a model using the `"provider:model"` format. `"provider/model"` also wor
|
||||
|
||||
### OpenAI
|
||||
|
||||
| Model | Specifier |
|
||||
|-------|-----------|
|
||||
| GPT-5 | `openai:gpt-5` |
|
||||
| GPT-5 Mini | `openai:gpt-5-mini` |
|
||||
| GPT-4.1 | `openai:gpt-4.1` |
|
||||
| Model | Specifier |
|
||||
| ------------ | --------------------- |
|
||||
| GPT-5 | `openai:gpt-5` |
|
||||
| GPT-5 Mini | `openai:gpt-5-mini` |
|
||||
| GPT-4.1 | `openai:gpt-4.1` |
|
||||
| GPT-4.1 Mini | `openai:gpt-4.1-mini` |
|
||||
| GPT-4.1 Nano | `openai:gpt-4.1-nano` |
|
||||
| GPT-4o | `openai:gpt-4o` |
|
||||
| GPT-4o Mini | `openai:gpt-4o-mini` |
|
||||
| o3 | `openai:o3` |
|
||||
| o3-mini | `openai:o3-mini` |
|
||||
| o4-mini | `openai:o4-mini` |
|
||||
| GPT-4o | `openai:gpt-4o` |
|
||||
| GPT-4o Mini | `openai:gpt-4o-mini` |
|
||||
| o3 | `openai:o3` |
|
||||
| o3-mini | `openai:o3-mini` |
|
||||
| o4-mini | `openai:o4-mini` |
|
||||
|
||||
```typescript
|
||||
const agent = new BuiltInAgent({
|
||||
@@ -34,27 +34,25 @@ const agent = new BuiltInAgent({
|
||||
|
||||
### Anthropic
|
||||
|
||||
| Model | Specifier |
|
||||
|-------|-----------|
|
||||
| Model | Specifier |
|
||||
| ----------------- | ----------------------------- |
|
||||
| Claude Opus 4.8 | `anthropic:claude-opus-4-8` |
|
||||
| Claude Sonnet 4.6 | `anthropic:claude-sonnet-4-6` |
|
||||
| Claude Haiku 4.5 | `anthropic:claude-haiku-4-5` |
|
||||
| Claude Sonnet 4.5 | `anthropic:claude-sonnet-4-5` |
|
||||
| Claude Sonnet 4 | `anthropic:claude-sonnet-4` |
|
||||
| Claude 3.7 Sonnet | `anthropic:claude-3-7-sonnet` |
|
||||
| Claude Opus 4.1 | `anthropic:claude-opus-4-1` |
|
||||
| Claude Opus 4 | `anthropic:claude-opus-4` |
|
||||
| Claude 3.5 Haiku | `anthropic:claude-3-5-haiku` |
|
||||
|
||||
```typescript
|
||||
const agent = new BuiltInAgent({
|
||||
model: "anthropic:claude-sonnet-4-5",
|
||||
model: "anthropic:claude-sonnet-4-6",
|
||||
});
|
||||
```
|
||||
|
||||
### Google
|
||||
|
||||
| Model | Specifier |
|
||||
|-------|-----------|
|
||||
| Gemini 2.5 Pro | `google:gemini-2.5-pro` |
|
||||
| Gemini 2.5 Flash | `google:gemini-2.5-flash` |
|
||||
| Model | Specifier |
|
||||
| --------------------- | ------------------------------ |
|
||||
| Gemini 2.5 Pro | `google:gemini-2.5-pro` |
|
||||
| Gemini 2.5 Flash | `google:gemini-2.5-flash` |
|
||||
| Gemini 2.5 Flash Lite | `google:gemini-2.5-flash-lite` |
|
||||
|
||||
```typescript
|
||||
@@ -114,7 +112,8 @@ For models not in the built-in list, you can pass any Vercel AI SDK `LanguageMod
|
||||
import { BuiltInAgent } from "@copilotkit/runtime/v2";
|
||||
import { createOpenAI } from "@ai-sdk/openai"; // [!code highlight]
|
||||
|
||||
const customProvider = createOpenAI({ // [!code highlight]
|
||||
const customProvider = createOpenAI({
|
||||
// [!code highlight]
|
||||
apiKey: process.env.MY_API_KEY, // [!code highlight]
|
||||
baseURL: "https://my-proxy.example.com/v1", // [!code highlight]
|
||||
}); // [!code highlight]
|
||||
@@ -153,13 +152,14 @@ import { BuiltInAgent } from "@copilotkit/runtime/v2";
|
||||
import { createOpenAI } from "@ai-sdk/openai"; // [!code highlight]
|
||||
|
||||
// OpenRouter: one key, hundreds of models behind an OpenAI-compatible API
|
||||
const openrouter = createOpenAI({ // [!code highlight]
|
||||
const openrouter = createOpenAI({
|
||||
// [!code highlight]
|
||||
apiKey: process.env.OPENROUTER_API_KEY, // [!code highlight]
|
||||
baseURL: "https://openrouter.ai/api/v1", // [!code highlight]
|
||||
}); // [!code highlight]
|
||||
|
||||
const agent = new BuiltInAgent({
|
||||
model: openrouter("anthropic/claude-sonnet-4-5"), // [!code highlight]
|
||||
model: openrouter("anthropic/claude-sonnet-4-6"), // [!code highlight]
|
||||
});
|
||||
```
|
||||
|
||||
@@ -172,25 +172,26 @@ AI SDK can talk to it, the Built-in Agent can use it.
|
||||
switching the model at request time. The model is configured **on the agent**,
|
||||
either as a `"provider:model"` string or an AI SDK `LanguageModel` instance:
|
||||
|
||||
```typescript
|
||||
new BuiltInAgent({ model: "openai:gpt-4.1" }); // built-in string
|
||||
new BuiltInAgent({ model: openrouter("...") }); // any LanguageModel
|
||||
```
|
||||
```typescript
|
||||
new BuiltInAgent({ model: "openai:gpt-4.1" }); // built-in string
|
||||
new BuiltInAgent({ model: openrouter("...") }); // any LanguageModel
|
||||
```
|
||||
|
||||
To switch models per user, request, or feature flag, construct the agent with
|
||||
the desired `model` on your own backend. For full control over the runtime you
|
||||
can also use a [Custom Agent](/backend/custom-agent).
|
||||
|
||||
To switch models per user, request, or feature flag, construct the agent with
|
||||
the desired `model` on your own backend. For full control over the runtime you
|
||||
can also use a [Custom Agent](/backend/custom-agent).
|
||||
</Callout>
|
||||
|
||||
## How it works
|
||||
|
||||
The Built-in Agent resolves model strings to AI SDK provider instances:
|
||||
|
||||
| Model string | AI SDK provider | Resolved call |
|
||||
|---|---|---|
|
||||
| `"openai:gpt-4.1"` | `@ai-sdk/openai` | `openai("gpt-4.1")` |
|
||||
| `"anthropic:claude-sonnet-4-5"` | `@ai-sdk/anthropic` | `anthropic("claude-sonnet-4-5")` |
|
||||
| `"google:gemini-2.5-pro"` | `@ai-sdk/google` | `google("gemini-2.5-pro")` |
|
||||
| Model string | AI SDK provider | Resolved call |
|
||||
| ------------------------------- | ------------------- | -------------------------------- |
|
||||
| `"openai:gpt-4.1"` | `@ai-sdk/openai` | `openai("gpt-4.1")` |
|
||||
| `"anthropic:claude-sonnet-4-6"` | `@ai-sdk/anthropic` | `anthropic("claude-sonnet-4-6")` |
|
||||
| `"google:gemini-2.5-pro"` | `@ai-sdk/google` | `google("gemini-2.5-pro")` |
|
||||
|
||||
Both `"provider:model"` and `"provider/model"` separators are supported and work identically.
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ Before you begin, you'll need the following:
|
||||
|
||||
```plaintext title=".env"
|
||||
ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||
ANTHROPIC_MODEL=claude-sonnet-4-6
|
||||
ANTHROPIC_MODEL=claude-opus-4-8
|
||||
```
|
||||
|
||||
The runtime route defaults to `AGENT_URL=http://localhost:8000`, which is where the starter's FastAPI agent server listens.
|
||||
@@ -138,7 +138,7 @@ Before you begin, you'll need the following:
|
||||
|
||||
```plaintext title=".env"
|
||||
ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||
ANTHROPIC_MODEL=claude-sonnet-4-6
|
||||
ANTHROPIC_MODEL=claude-opus-4-8
|
||||
```
|
||||
</Step>
|
||||
|
||||
@@ -171,7 +171,7 @@ Before you begin, you'll need the following:
|
||||
adapter = ClaudeAgentAdapter(
|
||||
name="claude_agent",
|
||||
options={
|
||||
"model": os.getenv("ANTHROPIC_MODEL", "claude-sonnet-4-6"),
|
||||
"model": os.getenv("ANTHROPIC_MODEL", "claude-opus-4-8"),
|
||||
"system_prompt": "You are a helpful assistant embedded in a CopilotKit app.",
|
||||
"tools": [],
|
||||
"permission_mode": "dontAsk",
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ Before you begin, you'll need the following:
|
||||
|
||||
```plaintext title=".env"
|
||||
ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||
CLAUDE_MODEL=claude-sonnet-4-6
|
||||
CLAUDE_MODEL=claude-opus-4-8
|
||||
```
|
||||
|
||||
The runtime route defaults to `AGENT_URL=http://localhost:8000`, which is where the starter's agent server listens.
|
||||
@@ -137,7 +137,7 @@ Before you begin, you'll need the following:
|
||||
|
||||
```plaintext title=".env"
|
||||
ANTHROPIC_API_KEY=your_anthropic_api_key
|
||||
CLAUDE_MODEL=claude-sonnet-4-6
|
||||
CLAUDE_MODEL=claude-opus-4-8
|
||||
AGENT_PORT=8000
|
||||
```
|
||||
</Step>
|
||||
@@ -162,7 +162,7 @@ Before you begin, you'll need the following:
|
||||
|
||||
const agent = new ClaudeAgentAdapter({
|
||||
agentId: "claude_agent",
|
||||
model: process.env.CLAUDE_MODEL ?? "claude-sonnet-4-6",
|
||||
model: process.env.CLAUDE_MODEL ?? "claude-opus-4-8",
|
||||
systemPrompt: "You are a helpful assistant embedded in a CopilotKit app.",
|
||||
tools: [],
|
||||
permissionMode: "dontAsk",
|
||||
|
||||
@@ -300,7 +300,7 @@ const agent = new BuiltInAgent({
|
||||
type: "aisdk",
|
||||
factory: ({ input, abortSignal }) =>
|
||||
streamText({
|
||||
model: anthropic("claude-sonnet-4", {
|
||||
model: anthropic("claude-sonnet-4-6", {
|
||||
thinking: { type: "enabled", budgetTokens: 10000 },
|
||||
}),
|
||||
messages: convertMessagesToVercelAISDKMessages(input.messages),
|
||||
@@ -326,7 +326,7 @@ const agent = new BuiltInAgent({
|
||||
factory: ({ input, abortController }) => {
|
||||
const { messages, systemPrompts } = convertInputToTanStackAI(input);
|
||||
return chat({
|
||||
adapter: anthropicText("claude-sonnet-4"),
|
||||
adapter: anthropicText("claude-sonnet-4-6"),
|
||||
messages,
|
||||
systemPrompts,
|
||||
modelOptions: { thinking: { type: "enabled", budgetTokens: 10000 } },
|
||||
@@ -463,8 +463,8 @@ const agent = new BuiltInAgent({
|
||||
const { messages, systemPrompts } = convertInputToTanStackAI(input);
|
||||
|
||||
const adapter =
|
||||
props.model === "anthropic/claude-sonnet-4"
|
||||
? anthropicText("claude-sonnet-4")
|
||||
props.model === "anthropic/claude-sonnet-4-6"
|
||||
? anthropicText("claude-sonnet-4-6")
|
||||
: openaiText((props.model as string) ?? "gpt-4o");
|
||||
|
||||
const modelOptions: Record<string, unknown> = {};
|
||||
@@ -487,7 +487,7 @@ const agent = new BuiltInAgent({
|
||||
Forward props from the frontend using the `CopilotKit` provider's `properties` prop:
|
||||
|
||||
```tsx title="app/page.tsx"
|
||||
<CopilotKit properties={{ model: "anthropic/claude-sonnet-4", temperature: 0.3 }}>
|
||||
<CopilotKit properties={{ model: "anthropic/claude-sonnet-4-6", temperature: 0.3 }}>
|
||||
<CopilotChat />
|
||||
</CopilotKit>
|
||||
```
|
||||
|
||||
@@ -209,7 +209,7 @@ The tool's `execute` function threw an exception.
|
||||
Supported formats:
|
||||
|
||||
- `"openai/gpt-5"`, `"openai/gpt-4o"`, `"openai/o3-mini"`
|
||||
- `"anthropic/claude-sonnet-4.5"`, `"anthropic/claude-opus-4"`
|
||||
- `"anthropic/claude-sonnet-4-6"`, `"anthropic/claude-opus-4-8"`
|
||||
- `"google/gemini-2.5-pro"`, `"google/gemini-2.5-flash"`
|
||||
- `"vertex/gemini-2.5-pro"` (uses Google Vertex AI)
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ Format: `"provider/model-name"` string or a Vercel AI SDK `LanguageModel` instan
|
||||
|
||||
**OpenAI:** `openai/gpt-5`, `openai/gpt-5-mini`, `openai/gpt-4.1`, `openai/gpt-4.1-mini`, `openai/gpt-4.1-nano`, `openai/gpt-4o`, `openai/gpt-4o-mini`, `openai/o3`, `openai/o3-mini`, `openai/o4-mini`
|
||||
|
||||
**Anthropic:** `anthropic/claude-sonnet-4.5`, `anthropic/claude-sonnet-4`, `anthropic/claude-3.7-sonnet`, `anthropic/claude-opus-4.1`, `anthropic/claude-opus-4`, `anthropic/claude-3.5-haiku`
|
||||
**Anthropic:** `anthropic/claude-sonnet-4-6`, `anthropic/claude-sonnet-4-5`, `anthropic/claude-opus-4-8`, `anthropic/claude-haiku-4-5`
|
||||
|
||||
**Google:** `google/gemini-2.5-pro`, `google/gemini-2.5-flash`, `google/gemini-2.5-flash-lite`
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ new BuiltInAgent({
|
||||
type: "aisdk",
|
||||
factory: ({ input, abortSignal }) =>
|
||||
streamText({
|
||||
model: anthropic("claude-sonnet-4"),
|
||||
model: anthropic("claude-sonnet-4-6"),
|
||||
messages: convertMessagesToVercelAISDKMessages(input.messages),
|
||||
providerOptions: {
|
||||
anthropic: { thinking: { type: "enabled", budgetTokens: 10000 } },
|
||||
|
||||
@@ -7,7 +7,7 @@ BuiltInAgent model identifiers — the full set of `"provider/model"` strings th
|
||||
|
||||
```typescript
|
||||
new BuiltInAgent({ model: "openai/gpt-4o" });
|
||||
new BuiltInAgent({ model: "anthropic:claude-sonnet-4.5" });
|
||||
new BuiltInAgent({ model: "anthropic:claude-sonnet-4-6" });
|
||||
```
|
||||
|
||||
## Supported providers
|
||||
@@ -31,9 +31,8 @@ openai/gpt-4.1 openai/gpt-4.1-mini openai/gpt-4.1-nano
|
||||
openai/gpt-4o openai/gpt-4o-mini
|
||||
openai/o3 openai/o3-mini openai/o4-mini
|
||||
|
||||
anthropic/claude-sonnet-4.5 anthropic/claude-sonnet-4
|
||||
anthropic/claude-3.7-sonnet anthropic/claude-opus-4.1
|
||||
anthropic/claude-opus-4 anthropic/claude-3.5-haiku
|
||||
anthropic/claude-sonnet-4-6 anthropic/claude-sonnet-4-5
|
||||
anthropic/claude-opus-4-8 anthropic/claude-haiku-4-5
|
||||
|
||||
google/gemini-2.5-pro google/gemini-2.5-flash google/gemini-2.5-flash-lite
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user