pub mod expression;
use clap::Subcommand;
#[derive(Subcommand)]
#[command(rename_all = "verbatim")]
pub enum GetCommand {
#[command(name = "get")]
Get,
}
#[derive(Subcommand)]
#[command(rename_all = "verbatim")]
pub enum Commands {
#[command(name = "list")]
List,
#[command(name = "expression")]
Expression {
#[command(subcommand)]
command: expression::Commands,
},
BranchTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
InlineFunction {
#[command(subcommand)]
command: GetCommand,
},
LeafTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
PartialPlaceholderBranchTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
PartialPlaceholderScalarFunctionTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
PartialPlaceholderVectorFunctionTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
PlaceholderScalarFunctionTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
PlaceholderVectorFunctionTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
RemoteFunction {
#[command(subcommand)]
command: GetCommand,
},
ScalarFunctionTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
VectorCompletionTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
VectorFunctionTaskExpression {
#[command(subcommand)]
command: GetCommand,
},
}
impl Commands {
pub async fn handle(self, handle: &objectiveai_cli_sdk::output::Handle) -> Result<(), crate::error::Error> {
match self {
Commands::List => {
const NAMES: &[&str] = &["expression", "BranchTaskExpression", "InlineFunction", "LeafTaskExpression", "PartialPlaceholderBranchTaskExpression", "PartialPlaceholderScalarFunctionTaskExpression", "PartialPlaceholderVectorFunctionTaskExpression", "PlaceholderScalarFunctionTaskExpression", "PlaceholderVectorFunctionTaskExpression", "RemoteFunction", "ScalarFunctionTaskExpression", "VectorCompletionTaskExpression", "VectorFunctionTaskExpression"];
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schemas>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schemas {
schemas: NAMES.iter().map(|s| s.to_string()).collect(),
},
},
).emit(handle).await;
Ok(())
}
Commands::Expression { command } => command.handle(handle).await,
Commands::BranchTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.BranchTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::InlineFunction { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.InlineFunction.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::LeafTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.LeafTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::PartialPlaceholderBranchTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.PartialPlaceholderBranchTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::PartialPlaceholderScalarFunctionTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.PartialPlaceholderScalarFunctionTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::PartialPlaceholderVectorFunctionTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.PartialPlaceholderVectorFunctionTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::PlaceholderScalarFunctionTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.PlaceholderScalarFunctionTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::PlaceholderVectorFunctionTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.PlaceholderVectorFunctionTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::RemoteFunction { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.RemoteFunction.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::ScalarFunctionTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.ScalarFunctionTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::VectorCompletionTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.VectorCompletionTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
Commands::VectorFunctionTaskExpression { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.alpha_vector.VectorFunctionTaskExpression.json"),
).expect("embedded JSON Schema must parse");
objectiveai_cli_sdk::output::Output::<objectiveai_cli_sdk::output::Schema>::Notification(
objectiveai_cli_sdk::output::Notification {
value: objectiveai_cli_sdk::output::Schema { schema },
},
).emit(handle).await;
Ok(())
}
}
}
}