objectiveai_sdk/cli/command/logs/vector/
mod.rs1pub mod completions;
2
3#[derive(clap::Subcommand)]
4pub enum Command {
5 Completions {
6 #[command(subcommand)]
7 command: completions::Command,
8 },
9}
10
11pub type Request = completions::Request;
17pub type ResponseItem = completions::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::Completions { command } => completions::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 completions::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 completions::execute_jq(executor, request, jq, agent_arguments).await
51}