teodor-new-chat-ui 4.3.273 → 4.3.275
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/context/hooks/useChatStreamingService.d.ts +6 -1
- package/dist/index.esm.js +4262 -4232
- package/dist/index.umd.js +39 -39
- package/package.json +1 -1
|
@@ -6,6 +6,10 @@ export type ThreadInfoEvent = Extract<StreamEvent, {
|
|
|
6
6
|
type HeartbeatEvent = Extract<StreamEvent, {
|
|
7
7
|
type: 'heartbeat';
|
|
8
8
|
}>;
|
|
9
|
+
export type StateHistoryEvent = HistoryPayload & {
|
|
10
|
+
type: 'state_history';
|
|
11
|
+
seq?: number;
|
|
12
|
+
};
|
|
9
13
|
export interface StreamClosedInfo {
|
|
10
14
|
reason: 'complete' | 'aborted' | 'error';
|
|
11
15
|
lastSeq: number;
|
|
@@ -21,6 +25,7 @@ interface UseChatStreamingServiceOptions {
|
|
|
21
25
|
baseUrl: string;
|
|
22
26
|
onThreadInfo: (event: ThreadInfoEvent) => void;
|
|
23
27
|
onMessageEvent: (event: ReducerStreamEvent) => void;
|
|
28
|
+
onStateHistory?: (event: StateHistoryEvent) => void;
|
|
24
29
|
onUnhandledEvent?: (event: StreamEvent) => void;
|
|
25
30
|
onSequenceGap?: (gap: {
|
|
26
31
|
from: number;
|
|
@@ -52,7 +57,7 @@ interface StartStreamCallbacks {
|
|
|
52
57
|
* here means we continue to rely on the well-tested streaming hook for all SSE
|
|
53
58
|
* behaviour while the provider focuses purely on state updates.
|
|
54
59
|
*/
|
|
55
|
-
export declare function useChatStreamingService({ baseUrl, onThreadInfo, onMessageEvent, onUnhandledEvent, onSequenceGap, onStreamClosed, onConnectionError, onAuthError, onHeartbeat, }: UseChatStreamingServiceOptions): {
|
|
60
|
+
export declare function useChatStreamingService({ baseUrl, onThreadInfo, onMessageEvent, onStateHistory, onUnhandledEvent, onSequenceGap, onStreamClosed, onConnectionError, onAuthError, onHeartbeat, }: UseChatStreamingServiceOptions): {
|
|
56
61
|
startStream: (request: ChatRequest, callbacks?: StartStreamCallbacks) => void;
|
|
57
62
|
stop: () => void;
|
|
58
63
|
isStreaming: boolean;
|