Skip to content

Commit

Permalink
Merge pull request #44 from N3mes1s/fix_assistant_api
Browse files Browse the repository at this point in the history
Fix assistant api
  • Loading branch information
Dongri Jin authored Nov 21, 2023
2 parents e09ea65 + 5024306 commit 7ee0dfd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions examples/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
tools.insert("type".to_string(), "code_interpreter".to_string());

let req = AssistantRequest::new(GPT4_1106_PREVIEW.to_string());
req.clone()
.description("this is a test assistant".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());
req.clone().tools(vec![tools]);
let req = req.clone().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());
let req = req.clone().tools(vec![tools]);
println!("{:?}", req);

let result = client.create_assistant(req)?;
println!("{:?}", result.id);

Expand Down
2 changes: 1 addition & 1 deletion src/v1/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub struct AssistantObject {
pub model: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub instructions: Option<String>,
pub tools: Vec<String>,
pub tools: Vec<HashMap<String, String>>,
pub file_ids: Vec<String>,
pub metadata: HashMap<String, String>,
}
Expand Down

0 comments on commit 7ee0dfd

Please sign in to comment.