pub struct MultiExecutor { /* private fields */ }Expand description
Multi-tool executor
Implementations§
Source§impl MultiExecutor
impl MultiExecutor
Sourcepub fn new(client: Arc<ComposioClient>) -> Self
pub fn new(client: Arc<ComposioClient>) -> Self
Create a new multi-executor instance
§Arguments
client- Composio client instance
§Example
use composio_sdk::{ComposioClient, meta_tools::MultiExecutor};
use std::sync::Arc;
let client = ComposioClient::builder()
.api_key("your-api-key")
.build()?;
let executor = MultiExecutor::new(Arc::new(client));Sourcepub async fn execute_parallel(
&self,
session_id: &str,
tools: Vec<ToolCall>,
) -> Result<MultiExecutionResult, ComposioError>
pub async fn execute_parallel( &self, session_id: &str, tools: Vec<ToolCall>, ) -> Result<MultiExecutionResult, ComposioError>
Execute multiple tools in parallel
§Arguments
session_id- Session ID for execution contexttools- Vector of tool calls to execute (max 20)
§Returns
Multi-execution result with individual results and statistics
§Example
let executor = MultiExecutor::new(client);
let tools = vec![
ToolCall {
tool_slug: "GITHUB_GET_REPOS".to_string(),
arguments: json!({ "owner": "composio" }),
connected_account_id: None,
},
ToolCall {
tool_slug: "GITHUB_GET_ISSUES".to_string(),
arguments: json!({ "owner": "composio", "repo": "composio" }),
connected_account_id: None,
},
];
let result = executor.execute_parallel("session_123", tools).await?;
println!("Successful: {}, Failed: {}", result.successful, result.failed);Sourcepub async fn execute_sequential(
&self,
session_id: &str,
tools: Vec<ToolCall>,
) -> Result<MultiExecutionResult, ComposioError>
pub async fn execute_sequential( &self, session_id: &str, tools: Vec<ToolCall>, ) -> Result<MultiExecutionResult, ComposioError>
Execute tools sequentially (fallback for when parallel execution is not desired)
§Arguments
session_id- Session IDtools- Vector of tool calls
§Example
let executor = MultiExecutor::new(client);
let tools = vec![
ToolCall {
tool_slug: "GITHUB_CREATE_ISSUE".to_string(),
arguments: json!({ "title": "Bug", "body": "Description" }),
connected_account_id: None,
},
];
let result = executor.execute_sequential("session_123", tools).await?;Auto Trait Implementations§
impl Freeze for MultiExecutor
impl !RefUnwindSafe for MultiExecutor
impl Send for MultiExecutor
impl Sync for MultiExecutor
impl Unpin for MultiExecutor
impl UnsafeUnpin for MultiExecutor
impl !UnwindSafe for MultiExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more