Skip to content

Commit 21977ca

Browse files
authored
add sonnet to vibe coding platform (#1244)
- **Update dependencies** - **Add Claude Sonnet 4.5 to Vibe Coding Platform** ### Description <!-- ✍️ Write a short summary of your work. Screenshots and videos are welcome! --> ### Demo URL <!-- Provide a URL to a live deployment where we can test your PR. If a demo isn't possible feel free to omit this section. --> ### Type of Change - [ ] New Example - [ ] Example updates (Bug fixes, new features, etc.) - [ ] Other (changes to the codebase, but not to examples) ### New Example Checklist - [ ] 🛫 `npm run new-example` was used to create the example - [ ] 📚 The template wasn't used but I carefuly read the [Adding a new example](https://github.com/vercel/examples#adding-a-new-example) steps and implemented them in the example - [ ] 📱 Is it responsive? Are mobile and tablets considered?
1 parent 02abd08 commit 21977ca

File tree

5 files changed

+109
-105
lines changed

5 files changed

+109
-105
lines changed

apps/vibe-coding-platform/ai/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ import { type GatewayModelId } from '@ai-sdk/gateway'
33
export enum Models {
44
AmazonNovaPro = 'amazon/nova-pro',
55
AnthropicClaude4Sonnet = 'anthropic/claude-4-sonnet',
6+
AnthropicClaude45Sonnet = 'anthropic/claude-sonnet-4.5',
67
GoogleGeminiFlash = 'google/gemini-2.5-flash',
78
MoonshotKimiK2 = 'moonshotai/kimi-k2',
89
OpenAIGPT5 = 'gpt-5',
910
XaiGrok3Fast = 'xai/grok-3-fast',
1011
}
1112

12-
export const DEFAULT_MODEL = Models.OpenAIGPT5
13+
export const DEFAULT_MODEL = Models.AnthropicClaude45Sonnet
1314

1415
export const SUPPORTED_MODELS: GatewayModelId[] = [
1516
Models.AmazonNovaPro,
1617
Models.AnthropicClaude4Sonnet,
18+
Models.AnthropicClaude45Sonnet,
1719
Models.GoogleGeminiFlash,
1820
Models.MoonshotKimiK2,
1921
Models.OpenAIGPT5,

apps/vibe-coding-platform/ai/gateway.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import type { LanguageModelV2 } from '@ai-sdk/provider'
77
export async function getAvailableModels() {
88
const gateway = gatewayInstance()
99
const response = await gateway.getAvailableModels()
10-
return response.models
11-
.map((model) => ({ id: model.id, name: model.name }))
12-
.concat([{ id: Models.OpenAIGPT5, name: 'GPT-5' }])
10+
return response.models.map((model) => ({ id: model.id, name: model.name }))
1311
}
1412

1513
export interface ModelOptions {
@@ -37,7 +35,10 @@ export function getModelOptions(
3735
}
3836
}
3937

40-
if (modelId === Models.AnthropicClaude4Sonnet) {
38+
if (
39+
modelId === Models.AnthropicClaude4Sonnet ||
40+
modelId === Models.AnthropicClaude45Sonnet
41+
) {
4142
return {
4243
model: gateway(modelId),
4344
headers: { 'anthropic-beta': 'fine-grained-tool-streaming-2025-05-14' },

apps/vibe-coding-platform/ai/tools/generate-files/get-contents.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export async function* getContents(
3737
const deferred = new Deferred<void>()
3838
const result = streamObject({
3939
...getModelOptions(params.modelId, { reasoningEffort: 'minimal' }),
40+
maxOutputTokens: 64000,
4041
system:
4142
'You are a file content generator. You must generate files based on the conversation history and the provided paths. NEVER generate lock files (pnpm-lock.yaml, package-lock.json, yarn.lock) - these are automatically created by package managers.',
4243
messages: [

apps/vibe-coding-platform/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"type-check": "tsc --noEmit"
1111
},
1212
"dependencies": {
13-
"@ai-sdk/gateway": "1.0.21",
14-
"@ai-sdk/openai": "2.0.28",
13+
"@ai-sdk/gateway": "1.0.32",
14+
"@ai-sdk/openai": "2.0.42",
1515
"@ai-sdk/provider": "^2.0.0",
16-
"@ai-sdk/react": "2.0.40",
17-
"@ai-sdk/vercel": "1.0.15",
16+
"@ai-sdk/react": "2.0.59",
17+
"@ai-sdk/vercel": "1.0.20",
1818
"@radix-ui/react-checkbox": "1.3.3",
1919
"@radix-ui/react-dialog": "1.1.14",
2020
"@radix-ui/react-label": "2.1.7",
@@ -23,7 +23,7 @@
2323
"@radix-ui/react-select": "2.2.5",
2424
"@radix-ui/react-slot": "1.2.3",
2525
"@vercel/sandbox": "0.0.17",
26-
"ai": "5.0.40",
26+
"ai": "5.0.59",
2727
"arctic": "3.7.0",
2828
"botid": "1.4.5",
2929
"class-variance-authority": "0.7.1",
@@ -32,7 +32,7 @@
3232
"jose": "6.0.12",
3333
"lucide-react": "0.528.0",
3434
"ms": "2.1.3",
35-
"next": "15.4.5",
35+
"next": "15.5.4",
3636
"next-themes": "^0.4.6",
3737
"nuqs": "2.4.3",
3838
"react": "19.1.0",

0 commit comments

Comments
 (0)