feat(onboard): refresh model discovery and canonicalize provider aliases (#341)
* feat(onboard): add model refresh command with ttl cache * fix(onboard): refresh curated models and canonicalize provider aliases * fix(channels): align agent_turn call signature * fix(channels): call run_tool_call_loop for stable channel runtime
This commit is contained in:
parent
0995c57776
commit
c842ece12c
4 changed files with 1150 additions and 148 deletions
26
src/main.rs
26
src/main.rs
|
|
@ -178,6 +178,12 @@ enum Commands {
|
|||
cron_command: CronCommands,
|
||||
},
|
||||
|
||||
/// Manage provider model catalogs
|
||||
Models {
|
||||
#[command(subcommand)]
|
||||
model_command: ModelCommands,
|
||||
},
|
||||
|
||||
/// Manage channels (telegram, discord, slack)
|
||||
Channel {
|
||||
#[command(subcommand)]
|
||||
|
|
@ -235,6 +241,20 @@ enum CronCommands {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
enum ModelCommands {
|
||||
/// Refresh and cache provider models
|
||||
Refresh {
|
||||
/// Provider name (defaults to configured default provider)
|
||||
#[arg(long)]
|
||||
provider: Option<String>,
|
||||
|
||||
/// Force live refresh and ignore fresh cache
|
||||
#[arg(long)]
|
||||
force: bool,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
enum ChannelCommands {
|
||||
/// List configured channels
|
||||
|
|
@ -435,6 +455,12 @@ async fn main() -> Result<()> {
|
|||
|
||||
Commands::Cron { cron_command } => cron::handle_command(cron_command, &config),
|
||||
|
||||
Commands::Models { model_command } => match model_command {
|
||||
ModelCommands::Refresh { provider, force } => {
|
||||
onboard::run_models_refresh(&config, provider.as_deref(), force)
|
||||
}
|
||||
},
|
||||
|
||||
Commands::Service { service_command } => service::handle_command(&service_command, &config),
|
||||
|
||||
Commands::Doctor => doctor::run(&config),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue