pub mod prompts;
pub mod recursive;
pub mod request;
pub mod response;
pub mod state;
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 = "prompts")]
Prompts {
#[command(subcommand)]
command: prompts::Commands,
},
#[command(name = "recursive")]
Recursive {
#[command(subcommand)]
command: recursive::Commands,
},
#[command(name = "request")]
Request {
#[command(subcommand)]
command: request::Commands,
},
#[command(name = "response")]
Response {
#[command(subcommand)]
command: response::Commands,
},
#[command(name = "state")]
State {
#[command(subcommand)]
command: state::Commands,
},
DescriptionObject {
#[command(subcommand)]
command: GetCommand,
},
EssayObject {
#[command(subcommand)]
command: GetCommand,
},
EssayTasksObject {
#[command(subcommand)]
command: GetCommand,
},
IndexObject {
#[command(subcommand)]
command: GetCommand,
},
ScalarBranchTaskObject {
#[command(subcommand)]
command: GetCommand,
},
ScalarInputSchemaObject {
#[command(subcommand)]
command: GetCommand,
},
ScalarLeafTaskObject {
#[command(subcommand)]
command: GetCommand,
},
TasksLengthObject {
#[command(subcommand)]
command: GetCommand,
},
VectorBranchTaskObject {
#[command(subcommand)]
command: GetCommand,
},
VectorInputSchemaObject {
#[command(subcommand)]
command: GetCommand,
},
VectorLeafTaskObject {
#[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] = &["prompts", "recursive", "request", "response", "state", "DescriptionObject", "EssayObject", "EssayTasksObject", "IndexObject", "ScalarBranchTaskObject", "ScalarInputSchemaObject", "ScalarLeafTaskObject", "TasksLengthObject", "VectorBranchTaskObject", "VectorInputSchemaObject", "VectorLeafTaskObject"];
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::Prompts { command } => command.handle(handle).await,
Commands::Recursive { command } => command.handle(handle).await,
Commands::Request { command } => command.handle(handle).await,
Commands::Response { command } => command.handle(handle).await,
Commands::State { command } => command.handle(handle).await,
Commands::DescriptionObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.DescriptionObject.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::EssayObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.EssayObject.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::EssayTasksObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.EssayTasksObject.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::IndexObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.IndexObject.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::ScalarBranchTaskObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.ScalarBranchTaskObject.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::ScalarInputSchemaObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.ScalarInputSchemaObject.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::ScalarLeafTaskObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.ScalarLeafTaskObject.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::TasksLengthObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.TasksLengthObject.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::VectorBranchTaskObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.VectorBranchTaskObject.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::VectorInputSchemaObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.VectorInputSchemaObject.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::VectorLeafTaskObject { .. } => {
let schema: serde_json::Value = serde_json::from_str(
include_str!("../../../../../objectiveai-json-schema/functions.inventions.VectorLeafTaskObject.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(())
}
}
}
}