mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-07 02:58:50 +01:00
fix: types for step handler
This commit is contained in:
parent
fbead7de40
commit
e478e10c96
3 changed files with 60 additions and 38 deletions
|
|
@ -13,7 +13,7 @@ export namespace Agents {
|
|||
};
|
||||
|
||||
export type MessageContentImageUrl = {
|
||||
type: 'image_url';
|
||||
type: ContentTypes.IMAGE_URL;
|
||||
image_url: string | { url: string; detail?: ImageDetail };
|
||||
};
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ export namespace Agents {
|
|||
| MessageContentText
|
||||
| MessageContentImageUrl
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
| (Record<string, any> & { type?: ContentTypes | 'image_url' | 'text_delta' | string })
|
||||
| (Record<string, any> & { type?: ContentTypes | string })
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
| (Record<string, any> & { type?: never });
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ export namespace Agents {
|
|||
|
||||
/** The arguments to the tool call */
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
args: string | Record<string, any>;
|
||||
args?: string | Record<string, any>;
|
||||
|
||||
/** If provided, an identifier associated with the tool call */
|
||||
id?: string;
|
||||
|
|
@ -50,14 +50,14 @@ export namespace Agents {
|
|||
/** The Step Id of the Tool Call */
|
||||
id: string;
|
||||
/** The Completed Tool Call */
|
||||
tool_call: ToolCall;
|
||||
tool_call?: ToolCall;
|
||||
/** The content index of the tool call */
|
||||
index: number;
|
||||
};
|
||||
|
||||
export type ToolCallContent = {
|
||||
type: ContentTypes.TOOL_CALL;
|
||||
tool_call: ToolCall;
|
||||
tool_call?: ToolCall;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -215,5 +215,5 @@ export namespace Agents {
|
|||
*/
|
||||
content?: MessageContentComplex[];
|
||||
}
|
||||
export type ContentType = ContentTypes.TEXT | 'image_url' | string;
|
||||
export type ContentType = ContentTypes.TEXT | ContentTypes.IMAGE_URL | string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
export enum ContentTypes {
|
||||
TEXT = 'text',
|
||||
TEXT_DELTA = 'text_delta',
|
||||
TOOL_CALL = 'tool_call',
|
||||
IMAGE_FILE = 'image_file',
|
||||
IMAGE_URL = 'image_url',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue