feat: mark Function trait as Send (#12)
Allow to use Client in places that are also Send.
This commit is contained in:
committed by
GitHub
parent
3afeec1d58
commit
8e9f7a5386
@@ -133,7 +133,7 @@ pub enum ToolChoice {
|
|||||||
// Custom
|
// Custom
|
||||||
|
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait Function {
|
pub trait Function: Send {
|
||||||
async fn execute(&self, arguments: String) -> Box<dyn Any + Send>;
|
async fn execute(&self, arguments: String) -> Box<dyn Any + Send>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
7
tests/v1_tool_test.rs
Normal file
7
tests/v1_tool_test.rs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
use mistralai_client::v1::client::Client;
|
||||||
|
|
||||||
|
trait _Trait: Send {}
|
||||||
|
struct _Foo {
|
||||||
|
_dummy: Client,
|
||||||
|
}
|
||||||
|
impl _Trait for _Foo {}
|
||||||
Reference in New Issue
Block a user