Skip to content

Commit 45d216f

Browse files
tombeckenhamclaude
andcommitted
chore(ai-openrouter): expand changeset, wire format into generate:models
Rewrite the ai-openrouter changeset to reflect the full scope of the PR: the 0.12.13 SDK bump (not 0.9.11), the ChatGenerationParams -> ChatRequest rename, and the deliberate removal of topK/topA/minP/repetitionPenalty/ includeReasoning/verbosity/webSearchOptions from OpenRouterBaseOptions so callers get a TS error instead of silent stripping. Append pnpm format to generate:models so regenerated model-meta and provider files land formatted in a single command. Remove the now-unused compare-openrouter-models.ts script — the models file is sorted alphabetically so a plain git diff is sufficient. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a45e2fb commit 45d216f

8 files changed

Lines changed: 205 additions & 277 deletions

File tree

.changeset/giant-garlics-crash.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
'@tanstack/ai-openrouter': patch
33
---
44

5-
- Bump `@openrouter/sdk` to 0.9.11
6-
- Updated model list with latest models (Opus 4.6, Sonnet 4.6, Gemini 3.1 Pro, etc.)
7-
- Native structured output support for OpenRouter
8-
- Refactored text-provider-options to derive types from SDK's `ChatGenerationParams`
9-
- Refactored options passthrough to use camelCase naming convention
10-
- Improved error handling
5+
- Upgrade `@openrouter/sdk` to 0.12.13 (from 0.8.0)
6+
- Migrate adapters and tests to the SDK's renamed chat types (`ChatGenerationParams``ChatRequest`, `ChatResponse``ChatResult`) and the renamed `chatRequest` key on `chat.send`
7+
- Derive `text-provider-options` types from the SDK's `ChatRequest` so provider options stay in lockstep with the SDK surface
8+
- Drop `topK` / `topA` / `minP` / `repetitionPenalty` / `includeReasoning` / `verbosity` / `webSearchOptions` from `OpenRouterBaseOptions` now that the SDK narrows `ChatRequest` to OpenAI-compatible fields — callers passing these previously saw them silently stripped at runtime, and now get a TypeScript error instead
9+
- Add those same keys to `excludedParams` in the model-catalog generator so future syncs don't reintroduce them
10+
- Add native structured output support using JSON Schema response formats
11+
- Refactor options passthrough to use camelCase naming convention
12+
- Refresh the model catalog with the latest OpenRouter models (Opus 4.6, Sonnet 4.6, Gemini 3.1 Pro, etc.) and remove the deprecated `openrouter/auto` model
13+
- Unify the outbound request payload envelope
14+
- Improve error handling and add tests for nested payloads, structured output parsing, and error cases

.changeset/sync-models.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
'@tanstack/ai-anthropic': patch
23
'@tanstack/ai-openrouter': patch
34
---
45

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"dev": "pnpm run watch",
4040
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
4141
"generate-docs": "node scripts/generate-docs.ts && pnpm run copy:readme",
42-
"generate:models": "pnpm generate:models:fetch && pnpm regenerate:models && tsx scripts/sync-provider-models.ts",
42+
"generate:models": "pnpm generate:models:fetch && pnpm regenerate:models && tsx scripts/sync-provider-models.ts && pnpm format",
4343
"generate:models:fetch": "tsx scripts/fetch-openrouter-models.ts",
4444
"regenerate:models": "tsx scripts/convert-openrouter-models.ts",
4545
"sync-docs-config": "node scripts/sync-docs-config.ts",

packages/typescript/ai-anthropic/src/model-meta.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,36 @@ const CLAUDE_OPUS_4_6_FAST = {
453453
AnthropicSamplingOptions
454454
>
455455

456+
const CLAUDE_OPUS_4_7 = {
457+
name: 'claude-opus-4.7',
458+
id: 'claude-opus-4.7',
459+
context_window: 1_000_000,
460+
max_output_tokens: 128_000,
461+
supports: {
462+
input: ['text', 'image'],
463+
extended_thinking: true,
464+
priority_tier: true,
465+
},
466+
pricing: {
467+
input: {
468+
normal: 5,
469+
cached: 0.5,
470+
},
471+
output: {
472+
normal: 25,
473+
},
474+
},
475+
} as const satisfies ModelMeta<
476+
AnthropicContainerOptions &
477+
AnthropicContextManagementOptions &
478+
AnthropicMCPOptions &
479+
AnthropicServiceTierOptions &
480+
AnthropicStopSequencesOptions &
481+
AnthropicThinkingOptions &
482+
AnthropicToolChoiceOptions &
483+
AnthropicSamplingOptions
484+
>
485+
456486
export const ANTHROPIC_MODELS = [
457487
CLAUDE_OPUS_4_6.id,
458488
CLAUDE_OPUS_4_5.id,
@@ -467,6 +497,8 @@ export const ANTHROPIC_MODELS = [
467497
CLAUDE_HAIKU_3.id,
468498

469499
CLAUDE_OPUS_4_6_FAST.id,
500+
501+
CLAUDE_OPUS_4_7.id,
470502
] as const
471503

472504
// const ANTHROPIC_IMAGE_MODELS = [] as const
@@ -577,6 +609,14 @@ export type AnthropicChatModelProviderOptionsByName = {
577609
AnthropicThinkingOptions &
578610
AnthropicToolChoiceOptions &
579611
AnthropicSamplingOptions
612+
[CLAUDE_OPUS_4_7.id]: AnthropicContainerOptions &
613+
AnthropicContextManagementOptions &
614+
AnthropicMCPOptions &
615+
AnthropicServiceTierOptions &
616+
AnthropicStopSequencesOptions &
617+
AnthropicThinkingOptions &
618+
AnthropicToolChoiceOptions &
619+
AnthropicSamplingOptions
580620
}
581621

582622
/**
@@ -603,4 +643,5 @@ export type AnthropicModelInputModalitiesByName = {
603643
[CLAUDE_HAIKU_3_5.id]: typeof CLAUDE_HAIKU_3_5.supports.input
604644
[CLAUDE_HAIKU_3.id]: typeof CLAUDE_HAIKU_3.supports.input
605645
[CLAUDE_OPUS_4_6_FAST.id]: typeof CLAUDE_OPUS_4_6_FAST.supports.input
646+
[CLAUDE_OPUS_4_7.id]: typeof CLAUDE_OPUS_4_7.supports.input
606647
}

0 commit comments

Comments
 (0)