Skip to content

Commit

Permalink
Fix content, refusal serialization for CreateChatCompletionRequest (#267
Browse files Browse the repository at this point in the history
)

They are optional per the openai docs.
  • Loading branch information
chirino authored Sep 11, 2024
1 parent 05d5a1b commit 1e66487
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions async-openai/src/types/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ pub struct ChatCompletionRequestUserMessage {
#[builder(build_fn(error = "OpenAIError"))]
pub struct ChatCompletionRequestAssistantMessage {
/// The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<ChatCompletionRequestAssistantMessageContent>,
/// The refusal message by the assistant.
#[serde(skip_serializing_if = "Option::is_none")]
pub refusal: Option<String>,
/// An optional name for the participant. Provides the model information to differentiate between participants of the same role.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down

0 comments on commit 1e66487

Please sign in to comment.