mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-24 04:10:15 +01:00
refactor: improve typing of Text part
This commit is contained in:
parent
a1cd9983e8
commit
89eeb71373
2 changed files with 2 additions and 2 deletions
|
|
@ -31,7 +31,7 @@ const Part = memo(({ part, isSubmitting, showCursor, messageId, isCreatedByUser
|
|||
if (part.type === ContentTypes.ERROR) {
|
||||
return <ErrorMessage text={part[ContentTypes.TEXT].value} className="my-2" />;
|
||||
} else if (part.type === ContentTypes.TEXT) {
|
||||
const text = typeof part.text === 'string' ? part.text : (part.text as { value: string }).value;
|
||||
const text = typeof part.text === 'string' ? part.text : part.text.value;
|
||||
|
||||
if (typeof text !== 'string') {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ export type ContentPart = (
|
|||
|
||||
export type TMessageContentParts =
|
||||
| { type: ContentTypes.ERROR; text: Text & PartMetadata }
|
||||
| { type: ContentTypes.TEXT; text: string; tool_call_ids?: string[] | (Text & PartMetadata) }
|
||||
| { type: ContentTypes.TEXT; text: string | (Text & PartMetadata); tool_call_ids?: string[] }
|
||||
| {
|
||||
type: ContentTypes.TOOL_CALL;
|
||||
tool_call: (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue