Skip to content

Commit c9b0733

Browse files
authored
skip serialization if option is none in CreateRunRequest (64bit#236)
1 parent 8a9cdd8 commit c9b0733

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

async-openai/src/types/run.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ pub struct CreateRunRequest {
189189
pub assistant_id: String,
190190

191191
/// The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.
192+
#[serde(skip_serializing_if = "Option::is_none")]
192193
pub model: Option<String>,
193194

194195
/// Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis.
@@ -207,6 +208,7 @@ pub struct CreateRunRequest {
207208
#[serde(skip_serializing_if = "Option::is_none")]
208209
pub tools: Option<Vec<AssistantTools>>,
209210

211+
#[serde(skip_serializing_if = "Option::is_none")]
210212
pub metadata: Option<HashMap<String, serde_json::Value>>,
211213

212214
/// The sampling temperature used for this run. If not set, defaults to 1.

0 commit comments

Comments
 (0)