add gpt
This commit is contained in:
47
src/main.rs
47
src/main.rs
@@ -195,6 +195,12 @@ enum Commands {
|
||||
command: PdsCommands,
|
||||
},
|
||||
|
||||
/// GPT core/memory commands
|
||||
Gpt {
|
||||
#[command(subcommand)]
|
||||
command: GptCommands,
|
||||
},
|
||||
|
||||
/// Bot commands
|
||||
#[command(alias = "b")]
|
||||
Bot {
|
||||
@@ -240,6 +246,30 @@ enum BotCommands {
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum GptCommands {
|
||||
/// Show core record (AI identity/personality)
|
||||
Core {
|
||||
/// Download to local content directory
|
||||
#[arg(short, long)]
|
||||
download: bool,
|
||||
},
|
||||
/// Show latest memory record
|
||||
Memory {
|
||||
/// Download to local content directory
|
||||
#[arg(short, long)]
|
||||
download: bool,
|
||||
/// List all memory versions
|
||||
#[arg(short, long)]
|
||||
list: bool,
|
||||
},
|
||||
/// Push core/memory records to PDS
|
||||
Push {
|
||||
/// Collection to push (core or memory)
|
||||
collection: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum PdsCommands {
|
||||
/// Check PDS versions
|
||||
@@ -344,6 +374,23 @@ async fn main() -> Result<()> {
|
||||
}
|
||||
}
|
||||
}
|
||||
Commands::Gpt { command } => {
|
||||
match command {
|
||||
GptCommands::Core { download } => {
|
||||
commands::gpt::get_core(download).await?;
|
||||
}
|
||||
GptCommands::Memory { download, list } => {
|
||||
if list {
|
||||
commands::gpt::list_memory().await?;
|
||||
} else {
|
||||
commands::gpt::get_memory(download).await?;
|
||||
}
|
||||
}
|
||||
GptCommands::Push { collection } => {
|
||||
commands::gpt::push(&collection).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user