Skip to content
Open
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: 10 additions & 0 deletions async-openai/src/types/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ pub struct ChatCompletionResponseMessage {
#[deprecated]
pub function_call: Option<FunctionCall>,

/// OpenRouter uses reasoning field to return thinking content when reasoning parser is enabled
#[serde(skip_serializing_if = "Option::is_none")]
pub reasoning: Option<String>,

/// If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio).
#[serde(skip_serializing_if = "Option::is_none")]
pub audio: Option<ChatCompletionResponseMessageAudio>,
Expand Down Expand Up @@ -494,6 +498,8 @@ pub enum ResponseFormat {
JsonSchema {
json_schema: ResponseFormatJsonSchema,
},
/// The type of response format being defined: grammar
Grammar { grammar: String },
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
Expand Down Expand Up @@ -1006,6 +1012,10 @@ pub struct ChatCompletionStreamResponseDelta {
#[deprecated]
pub function_call: Option<FunctionCallStream>,

/// OpenRouter uses reasoning field to return thinking content when reasoning parser is enabled
#[serde(skip_serializing_if = "Option::is_none")]
pub reasoning: Option<String>,

pub tool_calls: Option<Vec<ChatCompletionMessageToolCallChunk>>,
/// The role of the author of this message.
pub role: Option<Role>,
Expand Down