Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ChatMessage type with 'refusal' and 'content' is now optional #46

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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