docs(readme): update examples
This commit is contained in:
@@ -182,7 +182,7 @@ async fn main() {
|
|||||||
let stream_result = client
|
let stream_result = client
|
||||||
.chat_stream(model, messages, Some(options))
|
.chat_stream(model, messages, Some(options))
|
||||||
.await
|
.await
|
||||||
.expect("Failed to create stream.");
|
.unwrap();
|
||||||
stream_result
|
stream_result
|
||||||
.for_each(|chunk_result| async {
|
.for_each(|chunk_result| async {
|
||||||
match chunk_result {
|
match chunk_result {
|
||||||
@@ -197,7 +197,6 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
print!("\n") // To persist the last chunk output.
|
print!("\n") // To persist the last chunk output.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user