Overview
Currently the future returned by Tool::call requires Sync:
pub trait Tool: Send + Sync {
fn call(
&mut self,
parameters: Self::Params,
) -> impl Future<Output = Result<String>> + Send + Sync;
}
https://docs.rs/ollama-rs/latest/ollama_rs/generation/tools/trait.Tool.html
Does this future actually need to be Sync or can it just be Send?
Cause of issue
Using bollard::Docker::start_exec I get a stream with the type Pin<Box<dyn Stream<Item = Result<LogOutput, Error>> + Send>>
Because this type is not Sync I can't call it from a Tool implementation without jumping through hoops.
https://docs.rs/bollard/0.19.4/bollard/exec/enum.StartExecResults.html#variant.Attached.field.output
Overview
Currently the future returned by
Tool::callrequires Sync:https://docs.rs/ollama-rs/latest/ollama_rs/generation/tools/trait.Tool.html
Does this future actually need to be Sync or can it just be Send?
Cause of issue
Using
bollard::Docker::start_execI get a stream with the typePin<Box<dyn Stream<Item = Result<LogOutput, Error>> + Send>>Because this type is not Sync I can't call it from a
Toolimplementation without jumping through hoops.https://docs.rs/bollard/0.19.4/bollard/exec/enum.StartExecResults.html#variant.Attached.field.output