Skip to content

Commit

Permalink
feat: update ChatMessage type with 'refusal' and 'content' is now opt…
Browse files Browse the repository at this point in the history
…ional
  • Loading branch information
transitive-bullshit committed Aug 7, 2024
1 parent e64ce9f commit 7aa6efb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ export type ToolCall = {
};

export type ChatMessage = {
/** The contents of the message. `content` is required for all messages, and may be null for assistant messages with function calls. */
content: string | null;
/**
* The contents of the message. `content` may be null for assistant messages
* with function calls or `undefined` for assistant messages if a `refusal`
* was given by the model.
*/
content?: string | null;
/** The refusal message generated by the model. */
refusal?: string | null;
/** The role of the messages author. One of `system`, `user`, `assistant`, 'tool', or `function`. */
role: Role;
/** The name and arguments of a function that should be called, as generated by the model. */
Expand Down

0 comments on commit 7aa6efb

Please sign in to comment.