Added merge
This commit is contained in:
@@ -5,6 +5,8 @@ use clap::Parser;
|
||||
/// Default system prompt, compiled into the binary as a fallback.
|
||||
const DEFAULT_SYSTEM_PROMPT: &str = include_str!("../prompts/normalize.txt");
|
||||
|
||||
const DEFAULT_MERGE_PROMPT: &str = include_str!("../prompts/merge.txt");
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about = "Furumi Agent: music metadata ingest and normalization")]
|
||||
pub struct Args {
|
||||
@@ -47,6 +49,10 @@ pub struct Args {
|
||||
/// Path to a custom system prompt file (overrides the built-in default)
|
||||
#[arg(long, env = "FURUMI_AGENT_SYSTEM_PROMPT_FILE")]
|
||||
pub system_prompt_file: Option<PathBuf>,
|
||||
|
||||
/// Path to a custom merge prompt file (overrides the built-in default)
|
||||
#[arg(long, env = "FURUMI_AGENT_MERGE_PROMPT_FILE")]
|
||||
pub merge_prompt_file: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl Args {
|
||||
@@ -76,4 +82,14 @@ impl Args {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_merge_prompt(&self) -> Result<String, Box<dyn std::error::Error>> {
|
||||
match &self.merge_prompt_file {
|
||||
Some(path) => {
|
||||
tracing::info!("Loading merge prompt from {:?}", path);
|
||||
Ok(std::fs::read_to_string(path)?)
|
||||
}
|
||||
None => Ok(DEFAULT_MERGE_PROMPT.to_owned()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user