Fix function call type

This commit is contained in:
Dongri Jin
2023-10-06 17:19:46 +09:00
parent b079334e67
commit 6431c9cbdd
2 changed files with 30 additions and 6 deletions

View File

@ -46,7 +46,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
required: Some(vec![String::from("coin")]),
},
}]),
function_call: Some(FunctionCallType::auto), //Some(FunctionCallType::Function { name: "test".to_string() })
function_call: Some(FunctionCallType::Auto), // Some(FunctionCallType::Function { name: "test".to_string() }),
temperature: None,
top_p: None,
n: None,
@ -59,6 +59,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
user: None,
};
// debug reuqest json
// let serialized = serde_json::to_string(&req).unwrap();
// println!("{}", serialized);
let result = client.chat_completion(req)?;
match result.choices[0].finish_reason {