Skip to content

Commit 75293df

Browse files
committed
Merge remote-tracking branch 'origin/v5' into v5-providerOptions-remaining2
* origin/v5: (25 commits) chore(providers/langchain): extract to separate package (#5928) Version Packages (canary) (#5898) fix (docs): fix typo (#5914) (#5919) docs: update chat-with-pdf page to include updated provider information (#5895) (#5917) docs: Added documentation for function call parsing middleware (#5900) refactoring: extract SharedV2Headers (#5912) feat (providers/openai): add support for reasoning summaries (#5906) (#5909) fix (docs): fix OpenRouter code examples (#5876) (#5893) fix(providers/xai): return actual usage when streaming instead of NaN (#5873) (#5891) fix (docs): fix valibotSchema import (#5865) (#5889) fix (providers/fal): improve model compatibility (#5855) (#5892) chore: extract spec types (#5901) chore: remove logprobs (#5896) Version Packages (canary) (#5872) chore (ci): unify jobs & remove unnecessary example builds (#5894) feat (ai): allow using provider default temperature by specifying null (#5890) fix(ai/mcp-stdio): make `createChildProcess` synchronous to prevent spawn race condition (#5852) (#5888) feat (providers/google): add thinking config to provider options (#5842) (#5887) fix (examples): avoid mixed message types in `use-chat-streamdata-multistep` (#5824) (#5886) chore: restructure language model supported urls (#5882) ...
2 parents 8426631 + c9fbc57 commit 75293df

File tree

289 files changed

+4258
-5525
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

289 files changed

+4258
-5525
lines changed

.changeset/calm-boats-complain.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/provider': major
3+
---
4+
5+
chore: restructure language model supported urls

.changeset/cool-gifts-film.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/openai': patch
3+
---
4+
5+
chore(providers/openai): update embedding model to use providerOptions

.changeset/fair-swans-kneel.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/google-vertex': patch
3+
---
4+
5+
chore(providers/google-vertex): update embedding model to use providerOptions

.changeset/fast-students-turn.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@ai-sdk/openai-compatible': patch
3+
'@ai-sdk/xai': patch
4+
---
5+
6+
fix(providers/xai): return actual usage when streaming instead of NaN

.changeset/five-ravens-hammer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/google': patch
3+
---
4+
5+
feat (providers/google): add thinking config to provider options

.changeset/itchy-deers-jog.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/provider': major
3+
---
4+
5+
chore: remove logprobs

.changeset/mean-monkeys-sip.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/openai': patch
3+
---
4+
5+
feat (providers/openai): add support for reasoning summaries

.changeset/moody-yaks-love.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/google': patch
3+
---
4+
5+
chore(providers/google): update embedding model to use providerOptions

.changeset/pre.json

+31-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,25 @@
5959
"@ai-sdk/gladia": "1.0.0-canary.1",
6060
"@ai-sdk/hume": "1.0.0-canary.0",
6161
"@ai-sdk/lmnt": "1.0.0-canary.0",
62-
"@ai-sdk/revai": "1.0.0-canary.0"
62+
"@ai-sdk/revai": "1.0.0-canary.0",
63+
"@example/ai-core": "0.0.0",
64+
"@example/express": "0.0.0",
65+
"@example/fastify": "0.0.0",
66+
"@example/hono": "0.0.0",
67+
"@example/mcp": "0.0.0",
68+
"@example/nest": "0.0.0",
69+
"@example/next-fastapi": "0.0.0",
70+
"@example/next-google-vertex": "0.0.0",
71+
"@example/next-langchain": "0.0.0",
72+
"@example/next-openai": "0.0.0",
73+
"@example/next-openai-kasada-bot-protection": "0.0.0",
74+
"@example/next-openai-pages": "0.0.0",
75+
"@example/next-openai-telemetry": "0.0.0",
76+
"@example/next-openai-telemetry-sentry": "0.0.0",
77+
"@example/next-openai-rate-limits": "0.0.0",
78+
"@example/node-http-server": "0.0.0",
79+
"@example/nuxt-openai": "0.0.0",
80+
"@example/sveltekit-openai": "0.0.0"
6381
},
6482
"changesets": [
6583
"afraid-moles-cross",
@@ -72,9 +90,11 @@
7290
"big-panthers-judge",
7391
"brave-numbers-drive",
7492
"brown-poems-boil",
93+
"calm-boats-complain",
7594
"chilled-queens-remember",
7695
"clean-numbers-cover",
7796
"cool-buckets-shout",
97+
"cool-gifts-film",
7898
"cool-shrimps-kick",
7999
"cuddly-icons-kick",
80100
"cuddly-kangaroos-double",
@@ -86,8 +106,11 @@
86106
"eleven-lobsters-rescue",
87107
"fair-cobras-tan",
88108
"fair-cups-travel",
109+
"fair-swans-kneel",
110+
"fast-students-turn",
89111
"few-kangaroos-remember",
90112
"fifty-camels-visit",
113+
"five-ravens-hammer",
91114
"fix-env-mutation",
92115
"flat-plums-bake",
93116
"fluffy-pets-pump",
@@ -104,14 +127,17 @@
104127
"hungry-pets-hear",
105128
"hungry-zebras-applaud",
106129
"itchy-cars-relax",
130+
"itchy-deers-jog",
107131
"late-brooms-suffer",
108132
"late-foxes-battle",
109133
"lemon-terms-hug",
110134
"light-rules-film",
111135
"little-zebras-suffer",
112136
"many-beans-exercise",
137+
"mean-monkeys-sip",
113138
"metal-insects-tease",
114139
"modern-kings-smoke",
140+
"moody-yaks-love",
115141
"nasty-spiders-sparkle",
116142
"neat-pillows-occur",
117143
"new-vans-obey",
@@ -133,8 +159,11 @@
133159
"seven-pens-itch",
134160
"silent-nails-taste",
135161
"six-moose-know",
162+
"slimy-chefs-play",
163+
"slow-pants-buy",
136164
"smart-swans-drive",
137165
"smooth-mirrors-kneel",
166+
"spicy-mangos-brush",
138167
"strange-apricots-enjoy",
139168
"strange-camels-decide",
140169
"sweet-turtles-kiss",
@@ -150,6 +179,7 @@
150179
"tricky-hats-fly",
151180
"tricky-zebras-cover",
152181
"twelve-kids-travel",
182+
"twelve-pianos-destroy",
153183
"unlucky-bobcats-wash",
154184
"violet-taxis-work",
155185
"wicked-flowers-study",

.changeset/slimy-chefs-play.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/fal': patch
3+
---
4+
5+
fix (providers/fal): improve model compatibility

.changeset/slow-pants-buy.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/amazon-bedrock': patch
3+
---
4+
5+
chore(providers/bedrock): update embedding model to use providerOptions

.changeset/spicy-mangos-brush.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/provider': major
3+
---
4+
5+
chore: remove object generation mode

.changeset/spotty-swans-know.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@ai-sdk/langchain': patch
3+
---
4+
5+
chore(providers/langchain): extract to separate package

.changeset/twelve-pianos-destroy.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': patch
3+
---
4+
5+
feat (ai): allow using provider default temperature by specifying null

.github/workflows/ci.yml

+72
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,78 @@ on:
77
branches: [main, v5]
88

99
jobs:
10+
prettier:
11+
name: 'Prettier'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: 9.12.3
21+
22+
- name: Use Node.js 22
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: 'pnpm'
27+
28+
- name: Install dependencies
29+
run: pnpm install --frozen-lockfile
30+
31+
- name: Run Prettier check
32+
run: pnpm run prettier-check
33+
34+
eslint:
35+
name: 'ESLint'
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
41+
- name: Setup pnpm
42+
uses: pnpm/action-setup@v4
43+
with:
44+
version: 9.12.3
45+
46+
- name: Use Node.js 22
47+
uses: actions/setup-node@v4
48+
with:
49+
node-version: 22
50+
cache: 'pnpm'
51+
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile
54+
55+
- name: Run ESLint check
56+
run: pnpm run lint
57+
58+
types:
59+
name: 'TypeScript'
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
65+
- name: Setup pnpm
66+
uses: pnpm/action-setup@v4
67+
with:
68+
version: 9.12.3
69+
70+
- name: Use Node.js 22
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: 22
74+
cache: 'pnpm'
75+
76+
- name: Install dependencies
77+
run: pnpm install --frozen-lockfile
78+
79+
- name: Run TypeScript type check
80+
run: pnpm run type-check:full
81+
1082
test:
1183
name: 'Test'
1284
runs-on: ubuntu-latest

.github/workflows/quality.yml

-80
This file was deleted.

content/cookbook/01-next/23-chat-with-pdf.mdx

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ Some language models like Anthropic's Claude Sonnet 3.5 and Google's Gemini 2.0
1010

1111
<Note>
1212
This example requires a provider that supports PDFs, such as Anthropic's
13-
Claude Sonnet 3.5 or Google's Gemini 2.0. Note OpenAI's GPT-4o does not
14-
currently support PDFs. Check the [provider
13+
Claude 3.7, Google's Gemini 2.5, or OpenAI's GPT-4.1. Check the [provider
1514
documentation](/providers/ai-sdk-providers) for up-to-date support
1615
information.
1716
</Note>

content/cookbook/01-next/24-stream-text-multistep.mdx

+5-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function POST(req: Request) {
2727
execute: async dataStream => {
2828
// step 1 example: forced tool call
2929
const result1 = streamText({
30-
model: openai('gpt-4o-mini', { structuredOutputs: true }),
30+
model: openai('gpt-4o-mini'),
3131
system: 'Extract the user goal from the conversation.',
3232
messages,
3333
toolChoice: 'required', // force the model to call a tool
@@ -54,7 +54,10 @@ export async function POST(req: Request) {
5454
system:
5555
'You are a helpful assistant with a different system prompt. Repeat the extract user goal in your answer.',
5656
// continue the workflow stream with the messages from the previous step:
57-
messages: [...messages, ...(await result1.response).messages],
57+
messages: [
58+
...convertToCoreMessages(messages),
59+
...(await result1.response).messages,
60+
],
5861
});
5962

6063
// forward the 2nd result to the client (incl. the finish event):

content/cookbook/01-next/31-generate-object-with-file-prompt.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export async function POST(request: Request) {
9494
},
9595
],
9696
schema: z.object({
97-
summary: z.string().describe('A 50 word sumamry of the PDF.'),
97+
summary: z.string().describe('A 50 word summary of the PDF.'),
9898
}),
9999
});
100100

content/docs/03-ai-sdk-core/10-generating-structured-data.mdx

-13
Original file line numberDiff line numberDiff line change
@@ -186,19 +186,6 @@ const { object } = await generateObject({
186186
});
187187
```
188188

189-
## Generation Mode
190-
191-
While some models (like OpenAI) natively support object generation, others require alternative methods, like modified [tool calling](/docs/ai-sdk-core/tools-and-tool-calling). The `generateObject` function allows you to specify the method it will use to return structured data.
192-
193-
- `auto`: The provider will choose the best mode for the model. This recommended mode is used by default.
194-
- `tool`: A tool with the JSON schema as parameters is provided and the provider is instructed to use it.
195-
- `json`: The response format is set to JSON when supported by the provider, e.g. via json modes or grammar-guided generation. If grammar-guided generation is not supported, the JSON schema and instructions to generate JSON that conforms to the schema are injected into the system prompt.
196-
197-
<Note>
198-
Please note that not every provider supports all generation modes. Some
199-
providers do not support object generation at all.
200-
</Note>
201-
202189
## Schema Name and Description
203190

204191
You can optionally specify a name and description for the schema. These are used by some providers for additional LLM guidance, e.g. via tool or schema name.

0 commit comments

Comments
 (0)