Skip to content

Commit aaf0647

Browse files
authored
Merge pull request #101 from dongri/json-format-runs
Add response_format
2 parents 1d7edd5 + 349102f commit aaf0647

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/v1/run.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use super::thread::CreateThreadRequest;
22
use serde::{Deserialize, Serialize};
3+
use serde_json::Value;
34
use std::collections::HashMap;
45

56
use crate::impl_builder_methods;
@@ -15,6 +16,8 @@ pub struct CreateRunRequest {
1516
pub tools: Option<Vec<HashMap<String, String>>>,
1617
#[serde(skip_serializing_if = "Option::is_none")]
1718
pub metadata: Option<HashMap<String, String>>,
19+
#[serde(skip_serializing_if = "Option::is_none")]
20+
pub response_format: Option<Value>, // 1: json!("auto"), 2: json!({"type": "json_object"})
1821
}
1922

2023
impl CreateRunRequest {
@@ -25,6 +28,7 @@ impl CreateRunRequest {
2528
instructions: None,
2629
tools: None,
2730
metadata: None,
31+
response_format: None,
2832
}
2933
}
3034
}
@@ -34,7 +38,8 @@ impl_builder_methods!(
3438
model: String,
3539
instructions: String,
3640
tools: Vec<HashMap<String, String>>,
37-
metadata: HashMap<String, String>
41+
metadata: HashMap<String, String>,
42+
response_format: Value
3843
);
3944

4045
#[derive(Debug, Serialize, Clone)]

0 commit comments

Comments
 (0)