Skip to content

Commit

Permalink
Update ChatMessage type with 'refusal' and 'content' is now optional (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit authored Aug 8, 2024
1 parent e64ce9f commit 5f34047
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 if one was 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 5f34047

Please sign in to comment.