Skip to content

Commit a6b2500

Browse files
authored
Enable stream data protocol and deprecate experimental_streamData: true flag. (#1192)
1 parent f42bbb5 commit a6b2500

File tree

57 files changed

+799
-1452
lines changed

Some content is hidden

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

57 files changed

+799
-1452
lines changed

.changeset/two-bats-itch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': patch
3+
---
4+
5+
Deprecated the `experimental_streamData: true` setting from AIStreamCallbacksAndOptions. You can delete occurrences in your code. The stream data protocol is now used by default.

docs/pages/docs/api-reference/providers/inkeep-stream.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ export async function POST(req: Request) {
142142
}
143143
data.close();
144144
},
145-
experimental_streamData: true,
146145
});
147146

148147
return new StreamingTextResponse(stream, {}, data);

docs/pages/docs/api-reference/providers/mistral-stream.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export async function POST(req: Request) {
8484
onFinal(completion) {
8585
data.close();
8686
},
87-
experimental_streamData: true,
8887
});
8988

9089
// Respond with the stream

docs/pages/docs/api-reference/stream-data.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ export async function POST(req: Request) {
7979
// IMPORTANT! you must close StreamData manually or the response will never finish.
8080
data.close();
8181
},
82-
// IMPORTANT! until this is stable, you must explicitly opt in to supporting streamData.
83-
experimental_streamData: true,
8482
});
8583

8684
data.append({

docs/pages/docs/guides/providers/inkeep.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export async function POST(req: Request) {
123123
}
124124
data.close();
125125
},
126-
experimental_streamData: true,
127126
});
128127

129128
return new StreamingTextResponse(stream, {}, data);

examples/next-inkeep/app/api/chat/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export async function POST(req: Request) {
6868
}
6969
data.close();
7070
},
71-
experimental_streamData: true,
7271
});
7372

7473
return new StreamingTextResponse(stream, {}, data);

examples/next-langchain/app/api/stream-data-basic/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export async function POST(req: Request) {
2020
data.append(JSON.stringify({ key: 'value' })); // example
2121
data.close();
2222
},
23-
experimental_streamData: true,
2423
});
2524

2625
const llm = new ChatOpenAI({

examples/next-langchain/app/api/stream-data-chain/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export async function POST(req: Request) {
2626
data.append(JSON.stringify({ key: 'value' })); // example
2727
data.close();
2828
},
29-
experimental_streamData: true,
3029
});
3130

3231
await chain.stream({ product: value }, { callbacks: [handlers] });

examples/next-mistral/app/api/completion/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export async function POST(req: Request) {
3030
onFinal(completion) {
3131
data.close();
3232
},
33-
experimental_streamData: true,
3433
});
3534

3635
// Respond with the stream

examples/next-openai/app/api/chat-with-functions/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export async function POST(req: Request) {
9191
onFinal(completion) {
9292
data.close();
9393
},
94-
experimental_streamData: true,
9594
});
9695

9796
data.append({

0 commit comments

Comments
 (0)