feat: multi turn streaming example
Closes #412
Small change, that enables calling agent.stream_competion(...).await?.stream().await?; inside Box::pin(async_stream::stream! { ... });.
The implementation hopefully handles wasm32 arch.
I have added a multi_turn_streaming.rs example. It is based on the previous version of the multi_turn_agent.rs example.
I considered implementing multi turn functionality like the new PromptRequest implementation, but it seemed too daunting a task, and this simple change enables for customised multi turn logic.
I have added a
multi_turn_streaming.rsexample. It is based on the previous version of themulti_turn_agent.rsexample. I considered implementing multi turn functionality like the new PromptRequest implementation, but it seemed too daunting a task, and this simple change enables for customised multi turn logic.
Great job spearheading this, I was looking to add some multi_turn for streaming but it was a bit much for my branch, esp considering the upcoming #388 streaming api improvements. The inclusion of Send is fixed by that branch, but we'll revisit this branch soon when #388 gets merged and use it for adding better streaming examples like multi turn and reasoning loops.
@0xMochan thanks for merging #388. I have refactored the example to work with the changes in that PR.
Hi @joshua-mo-143, thank you for letting me know. I have updated the example to use the new traits.
- There seems to be a new lint for the error type because all of the enum variants have the same postfix
Can you elaborate on this if it is still an issue? I am unsure if there is something I should change.
Hi @joshua-mo-143, thank you for letting me know. I have updated the example to use the new traits.
- There seems to be a new lint for the error type because all of the enum variants have the same postfix
Can you elaborate on this if it is still an issue? I am unsure if there is something I should change.
Should be fine, I think. There was an error in the release pipeline because we'd added a new crate that used some new breaking changes from rig-core.