Added merge
All checks were successful
Publish Metadata Agent Image / build-and-push-image (push) Successful in 1m7s
Publish Web Player Image / build-and-push-image (push) Successful in 1m11s
Publish Server Image / build-and-push-image (push) Successful in 2m14s

This commit is contained in:
2026-03-19 00:55:49 +00:00
parent 4a272f373d
commit e1782a6e3b
13 changed files with 949 additions and 23 deletions

View File

@@ -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()),
}
}
}