Skip to content

Commit

Permalink
feat: add status, attachments and metadata fields to all messages (#876)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Sep 22, 2024
1 parent 2b81a63 commit 3187013
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-toes-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@assistant-ui/react": patch
---

feat: add status, attachments and metadata fields to all messages
6 changes: 6 additions & 0 deletions packages/react/src/types/AssistantTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,25 @@ export type MessageStatus =
export type ThreadSystemMessage = MessageCommonProps & {
role: "system";
content: [TextContentPart];
status?: undefined;
attachments?: undefined;
metadata?: undefined;
};

export type ThreadUserMessage = MessageCommonProps & {
role: "user";
content: ThreadUserContentPart[];
attachments: readonly MessageAttachment[];
status?: undefined;
metadata?: undefined;
// TODO metadata
};

export type ThreadAssistantMessage = MessageCommonProps & {
role: "assistant";
content: ThreadAssistantContentPart[];
status: MessageStatus;
attachments?: undefined;
/**
* @deprecated Use `metadata.roundtrips` instead.
*/
Expand Down

0 comments on commit 3187013

Please sign in to comment.