Skip to content

Commit 765f1cd

Browse files
authored
chore (ai): remove deprecated useChat isLoading helper (#6276)
## Background `isLoading` in `useChat` has been replaced by `state`, which allows for more fine-grained ui state management. ## Summary Remove deprecated `isLoading` helper from `useChat`.
1 parent 6a101c9 commit 765f1cd

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

‎.changeset/twelve-waves-stare.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': major
3+
---
4+
5+
chore (ai): remove deprecated useChat isLoading helper

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ export type UseChatHelpers<MESSAGE_METADATA = unknown> = {
8787
) => void;
8888
metadata?: Object;
8989

90-
/**
91-
* Whether the API request is in progress
92-
*
93-
* @deprecated use `status` instead
94-
*/
95-
isLoading: boolean;
96-
9790
/**
9891
* Hook status:
9992
*
@@ -509,7 +502,6 @@ Default is undefined, which disables throttling.
509502
setInput,
510503
handleInputChange,
511504
handleSubmit,
512-
isLoading: status === 'submitted' || status === 'streaming',
513505
status,
514506
addToolResult,
515507
};

‎packages/vue/src/use-chat.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,6 @@ export type UseChatHelpers<MESSAGE_METADATA> = {
6969
},
7070
) => void;
7171

72-
/**
73-
* Whether the API request is in progress
74-
*
75-
* @deprecated use `status` instead
76-
*/
77-
isLoading: Ref<boolean>;
78-
7972
/**
8073
* Hook status:
8174
*
@@ -402,9 +395,6 @@ export function useChat<MESSAGE_METADATA = unknown>(
402395
setMessages,
403396
input,
404397
handleSubmit,
405-
isLoading: computed(
406-
() => status.value === 'submitted' || status.value === 'streaming',
407-
),
408398
status: status as Ref<'submitted' | 'streaming' | 'ready' | 'error'>,
409399
addToolResult,
410400
};

0 commit comments

Comments
 (0)