mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 10:20:15 +01:00
✂️ refactor: Artifacts and Tool Callbacks to Pass UI Resources (#9581)
* ✂️ refactor: use artifacts and callbacks to pass UI resources
* chore: imports
* refactor: Update UIResource type imports and definitions across components and tests
* refactor: Update ToolCallInfo test data structure and enhance TAttachment type definition
---------
Co-authored-by: Samuel Path <samuel.path@shopify.com>
This commit is contained in:
parent
916742ab9d
commit
180046a3c5
14 changed files with 1072 additions and 199 deletions
|
|
@ -552,20 +552,33 @@ export type MemoryArtifact = {
|
|||
type: 'update' | 'delete' | 'error';
|
||||
};
|
||||
|
||||
export type UIResource = {
|
||||
type?: string;
|
||||
data?: unknown;
|
||||
uri?: string;
|
||||
mimeType?: string;
|
||||
text?: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type TAttachmentMetadata = {
|
||||
type?: Tools;
|
||||
messageId: string;
|
||||
toolCallId: string;
|
||||
[Tools.memory]?: MemoryArtifact;
|
||||
[Tools.ui_resources]?: UIResource[];
|
||||
[Tools.web_search]?: SearchResultData;
|
||||
[Tools.file_search]?: SearchResultData;
|
||||
[Tools.memory]?: MemoryArtifact;
|
||||
};
|
||||
|
||||
export type TAttachment =
|
||||
| (TFile & TAttachmentMetadata)
|
||||
| (Pick<TFile, 'filename' | 'filepath' | 'conversationId'> & {
|
||||
expiresAt: number;
|
||||
} & TAttachmentMetadata);
|
||||
} & TAttachmentMetadata)
|
||||
| (Partial<Pick<TFile, 'filename' | 'filepath'>> &
|
||||
Pick<TFile, 'conversationId'> &
|
||||
TAttachmentMetadata);
|
||||
|
||||
export type TMessage = z.input<typeof tMessageSchema> & {
|
||||
children?: TMessage[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue