teodor-new-chat-ui 4.3.581 → 4.3.583

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.
@@ -1,8 +1,17 @@
1
- import { type ChatRequest, type ProjectInfo, type ChatMessage, type StreamSubmitPayload, type SendOptions, type StreamEvent } from "@/types";
1
+ import { type ChatRequest, type ProjectInfo, type ChatMessage, type StreamSubmitPayload, type SendOptions, type MessagePart, type StreamEvent } from "@/types";
2
2
  export type EditContextMeta = {
3
3
  checkpointId?: string | null;
4
4
  checkpointNs?: string | null;
5
5
  };
6
+ /**
7
+ * Options for sending a message via handleSendMessage.
8
+ */
9
+ export interface SendMessageOptions {
10
+ /** Files to upload (will be converted to contentParts after upload) */
11
+ files?: File[];
12
+ /** Pre-built content parts (e.g., already-uploaded documents with URLs) */
13
+ contentParts?: MessagePart[];
14
+ }
6
15
  export interface UseChatControllerProps {
7
16
  submit: (payload: StreamSubmitPayload, options?: SendOptions) => Promise<void>;
8
17
  chatRequest: ChatRequest;
@@ -37,7 +46,7 @@ export declare function useChatController({ submit, chatRequest, lastCheckpointI
37
46
  setDismissError: import("react").Dispatch<import("react").SetStateAction<boolean>>;
38
47
  composerValue: string;
39
48
  handleComposerChange: (text: string) => void;
40
- handleSendMessage: (text: string, attachments: File[]) => Promise<void>;
49
+ handleSendMessage: (text: string, optionsOrFiles?: SendMessageOptions | File[]) => Promise<void>;
41
50
  handleQuickPrompt: (prompt: string, isComposerDisabled: boolean) => void;
42
51
  handleExcelUpload: (file: File) => Promise<void>;
43
52
  startEditing: (messageId: string, content: string, meta?: EditContextMeta) => void;