teodor-new-chat-ui 2.0.35 → 2.0.36

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.
@@ -22,6 +22,11 @@ export interface ChatContextValue {
22
22
  error: string | null;
23
23
  lastCheckpointId: string | null;
24
24
  streamingAssistantId: string | null;
25
+ hasMoreHistory: boolean;
26
+ isLoadingHistory: boolean;
27
+ loadOlderMessages: (opts?: {
28
+ limit?: number;
29
+ }) => Promise<void>;
25
30
  refreshThreads: () => Promise<void>;
26
31
  createThread: (title?: string) => Promise<string>;
27
32
  deleteThread: (threadId: string) => Promise<void>;
@@ -15,6 +15,11 @@ export type MessagesAction = {
15
15
  payload: {
16
16
  messages: ChatMessage[];
17
17
  };
18
+ } | {
19
+ type: "prepend";
20
+ payload: {
21
+ messages: ChatMessage[];
22
+ };
18
23
  } | {
19
24
  type: "user_message";
20
25
  payload: {
@@ -31,6 +36,7 @@ export declare function messagesReducer(state: MessagesState, action: MessagesAc
31
36
  export declare function useMessagesReducer(initial?: ChatMessage[]): {
32
37
  readonly reset: (messages?: ChatMessage[]) => void;
33
38
  readonly seed: (messages: ChatMessage[]) => void;
39
+ readonly prepend: (messages: ChatMessage[]) => void;
34
40
  readonly pushUser: (message: ChatMessage) => void;
35
41
  readonly onEvent: (ev: StreamEvent) => void;
36
42
  readonly state: MessagesState;