objectiveai_sdk/cli/command/functions/executions/
mod.rs1pub mod create;
2
3#[derive(clap::Subcommand)]
4pub enum Command {
5 Create {
6 #[command(subcommand)]
7 command: create::Command,
8 },
9}
10
11pub type Request = create::Request;
17pub type ResponseItem = create::ResponseItem;
18
19impl TryFrom<Command> for Request {
20 type Error = crate::cli::command::FromArgsError;
21 fn try_from(command: Command) -> Result<Self, Self::Error> {
22 match command {
23 Command::Create { command } => create::Request::try_from(command),
24 }
25 }
26}
27
28#[cfg(feature = "cli-executor")]
29pub async fn execute<E: crate::cli::command::CommandExecutor>(
30 executor: &E,
31 request: Request,
32 agent_arguments: Option<&crate::cli::command::AgentArguments>,
33) -> Result<
34 std::pin::Pin<Box<dyn futures::Stream<Item = Result<ResponseItem, E::Error>> + Send>>,
35 E::Error,
36> {
37 create::execute(executor, request, agent_arguments).await
38}
39
40#[cfg(feature = "cli-executor")]
41pub async fn execute_jq<E: crate::cli::command::CommandExecutor>(
42 executor: &E,
43 request: Request,
44 jq: String,
45 agent_arguments: Option<&crate::cli::command::AgentArguments>,
46) -> Result<
47 std::pin::Pin<Box<dyn futures::Stream<Item = Result<serde_json::Value, E::Error>> + Send>>,
48 E::Error,
49> {
50 create::execute_jq(executor, request, jq, agent_arguments).await
51}