feat: mark Function trait as Send (#12)

Allow to use Client in places that are also Send.
This commit is contained in:
Federico G. Schwindt
2024-07-24 19:16:11 +01:00
committed by GitHub
parent 3afeec1d58
commit 8e9f7a5386
2 changed files with 8 additions and 1 deletions

View File

@@ -133,7 +133,7 @@ pub enum ToolChoice {
// Custom
#[async_trait]
pub trait Function {
pub trait Function: Send {
async fn execute(&self, arguments: String) -> Box<dyn Any + Send>;
}

7
tests/v1_tool_test.rs Normal file
View File

@@ -0,0 +1,7 @@
use mistralai_client::v1::client::Client;
trait _Trait: Send {}
struct _Foo {
_dummy: Client,
}
impl _Trait for _Foo {}