Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ollama-rs/src/generation/tools/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait Tool: Send + Sync {
fn call(
&mut self,
parameters: Self::Params,
) -> impl Future<Output = Result<String>> + Send + Sync;
) -> impl Future<Output = Result<String>> + Send;
}

pub trait Parameters: DeserializeOwned + JsonSchema {}
Expand All @@ -36,14 +36,14 @@ pub(crate) trait ToolHolder: Send + Sync {
fn call(
&mut self,
parameters: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + '_ + Send + Sync>>;
) -> Pin<Box<dyn Future<Output = Result<String>> + '_ + Send>>;
}

impl<T: Tool> ToolHolder for T {
fn call(
&mut self,
parameters: Value,
) -> Pin<Box<dyn Future<Output = Result<String>> + '_ + Send + Sync>> {
) -> Pin<Box<dyn Future<Output = Result<String>> + '_ + Send>> {
Box::pin(async move {
// Json returned from the model can sometimes be in different formats, see https://github.com/pepperoni21/ollama-rs/issues/210
// This is a work-around for this issue.
Expand Down