Skip to content

Commit 2e78acb

Browse files
authoredMay 13, 2024··
Deprecate StreamingReactResponse. (#1570)
1 parent 325ca55 commit 2e78acb

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed
 

‎.changeset/eighty-numbers-matter.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': patch
3+
---
4+
5+
Deprecate StreamingReactResponse (use AI SDK RSC instead).

‎packages/core/react/use-chat.ts

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ export type UseChatHelpers = {
7373
data?: JSONValue[];
7474
};
7575

76+
/**
77+
@deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
78+
*/
7679
type StreamingReactResponseAction = (payload: {
7780
messages: Message[];
7881
data?: Record<string, string>;
@@ -115,6 +118,7 @@ const getStreamedResponse = async (
115118
}),
116119
);
117120

121+
// TODO deprecated, remove in next major release
118122
if (typeof api !== 'string') {
119123
// In this case, we are handling a Server Action. No complex mode handling needed.
120124

‎packages/core/shared/types.ts

+6
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,15 @@ export interface Message {
9090
tool_call_id?: string;
9191
createdAt?: Date;
9292
content: string;
93+
94+
/**
95+
@deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
96+
*/
9397
ui?: string | JSX.Element | JSX.Element[] | null | undefined;
98+
9499
role: 'system' | 'user' | 'assistant' | 'function' | 'data' | 'tool';
95100
/**
101+
*
96102
* If the message has a role of `function`, the `name` field is the name of the function.
97103
* Otherwise, the name field should not be set.
98104
*/

‎packages/core/streams/streaming-react-response.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@ type Payload = {
2020
content: string;
2121
};
2222

23+
/**
24+
@deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
25+
*/
2326
export type ReactResponseRow = Payload & {
2427
next: null | Promise<ReactResponseRow>;
2528
};
2629

2730
/**
28-
* A utility class for streaming React responses.
31+
A utility class for streaming React responses.
32+
33+
@deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
2934
*/
3035
export class experimental_StreamingReactResponse {
3136
constructor(

0 commit comments

Comments
 (0)
Please sign in to comment.