fix: return vector

This commit is contained in:
0xMRTT 2023-06-17 15:37:33 +02:00
parent c1268ca56a
commit 81fb1c96d7
Signed by: 0xMRTT
GPG Key ID: 910B287304120902
2 changed files with 4 additions and 3 deletions

View File

@ -33,7 +33,7 @@ struct DeltaChoice {
pub content: String,
}
pub async fn ask(prompt: &str) -> Result<String, Box<dyn std::error::Error>> {
pub async fn ask(prompt: &str) -> Result<Vec<Delta>, Box<dyn std::error::Error>> {
let mut body = String::new();
body.push_str(r#"{
@ -66,5 +66,5 @@ pub async fn ask(prompt: &str) -> Result<String, Box<dyn std::error::Error>> {
println!("{:?}", deltas);
return Ok(deltas.last().unwrap().detail.choices[0].delta.content.clone());
return Ok(deltas);
}

View File

@ -7,7 +7,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut response = ask("Hello, world!").await?;
println!("{}", response);
println!("{:?}", response);
Ok(())
}