mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 23:25:39 +00:00
Merge pull request #44 from N3mes1s/fix_assistant_api
Fix assistant api
This commit is contained in:
@ -14,10 +14,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
tools.insert("type".to_string(), "code_interpreter".to_string());
|
tools.insert("type".to_string(), "code_interpreter".to_string());
|
||||||
|
|
||||||
let req = AssistantRequest::new(GPT4_1106_PREVIEW.to_string());
|
let req = AssistantRequest::new(GPT4_1106_PREVIEW.to_string());
|
||||||
req.clone()
|
let req = req.clone().description("this is a test assistant".to_string());
|
||||||
.description("this is a test assistant".to_string());
|
let req = req.clone().instructions("You are a personal math tutor. When asked a question, write and run Python code to answer the question.".to_string());
|
||||||
req.clone().instructions("You are a personal math tutor. When asked a question, write and run Python code to answer the question.".to_string());
|
let req = req.clone().tools(vec![tools]);
|
||||||
req.clone().tools(vec![tools]);
|
println!("{:?}", req);
|
||||||
|
|
||||||
let result = client.create_assistant(req)?;
|
let result = client.create_assistant(req)?;
|
||||||
println!("{:?}", result.id);
|
println!("{:?}", result.id);
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ pub struct AssistantObject {
|
|||||||
pub model: String,
|
pub model: String,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub instructions: Option<String>,
|
pub instructions: Option<String>,
|
||||||
pub tools: Vec<String>,
|
pub tools: Vec<HashMap<String, String>>,
|
||||||
pub file_ids: Vec<String>,
|
pub file_ids: Vec<String>,
|
||||||
pub metadata: HashMap<String, String>,
|
pub metadata: HashMap<String, String>,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user