-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
313 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
pub mod src { | ||
mod app; | ||
mod chat; | ||
mod cli; | ||
mod defaults; | ||
mod error; | ||
mod handler; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
mod subcommands; | ||
|
||
use clap::{Arg, Command}; | ||
use lumni::api::spec::ApplicationSpec; | ||
use subcommands::db::create_db_subcommand; | ||
pub use subcommands::db::handle_db_subcommand; | ||
use subcommands::profile::create_profile_subcommand; | ||
pub use subcommands::profile::handle_profile_subcommand; | ||
|
||
use super::chat::db::{ConversationDatabase, UserProfileDbHandler}; | ||
use crate::external as lumni; | ||
|
||
pub fn parse_cli_arguments(spec: ApplicationSpec) -> Command { | ||
let name = Box::leak(spec.name().into_boxed_str()) as &'static str; | ||
let version = Box::leak(spec.version().into_boxed_str()) as &'static str; | ||
Command::new(name) | ||
.version(version) | ||
.about("CLI for prompt interaction") | ||
.arg_required_else_help(false) | ||
.subcommand(create_db_subcommand()) | ||
.subcommand(create_profile_subcommand()) | ||
.arg( | ||
Arg::new("profile") | ||
.long("profile") | ||
.short('p') | ||
.help("Use a specific profile") | ||
.global(true), | ||
) | ||
.arg( | ||
Arg::new("system") | ||
.long("system") | ||
.short('s') | ||
.help("System prompt"), | ||
) | ||
.arg( | ||
Arg::new("assistant") | ||
.long("assistant") | ||
.short('a') | ||
.help("Specify an assistant to use"), | ||
) | ||
.arg( | ||
Arg::new("server") | ||
.long("server") | ||
.short('S') | ||
.help("Server to use for processing the request"), | ||
) | ||
.arg(Arg::new("options").long("options").short('o').help( | ||
"Comma-separated list of model options e.g., \ | ||
temperature=1,max_tokens=100", | ||
)) | ||
} |
Oops, something went wrong.