Added doker compose
All checks were successful
Publish Metadata Agent Image / build-and-push-image (push) Successful in 1m6s
Publish Web Player Image / build-and-push-image (push) Successful in 1m9s
Publish Server Image / build-and-push-image (push) Successful in 2m16s

This commit is contained in:
2026-03-18 13:04:13 +00:00
parent a50efd0082
commit f4fa01ef7e
6 changed files with 130 additions and 2 deletions

View File

@@ -32,6 +32,10 @@ pub struct Args {
#[arg(long, env = "FURUMI_AGENT_OLLAMA_MODEL", default_value = "qwen3:14b")]
pub ollama_model: String,
/// Authorization header value for Ollama API (e.g. "Bearer <token>" or "Basic <base64>")
#[arg(long, env = "FURUMI_AGENT_OLLAMA_AUTH")]
pub ollama_auth: Option<String>,
/// Inbox scan interval in seconds
#[arg(long, env = "FURUMI_AGENT_POLL_INTERVAL_SECS", default_value_t = 30)]
pub poll_interval_secs: u64,

View File

@@ -22,6 +22,7 @@ pub async fn normalize(
&state.config.ollama_model,
&state.system_prompt,
&user_message,
state.config.ollama_auth.as_deref(),
)
.await?;
@@ -125,6 +126,7 @@ async fn call_ollama(
model: &str,
system_prompt: &str,
user_message: &str,
auth: Option<&str>,
) -> anyhow::Result<String> {
let client = reqwest::Client::builder()
.timeout(std::time::Duration::from_secs(120))
@@ -151,7 +153,11 @@ async fn call_ollama(
tracing::info!(%url, model, prompt_len = user_message.len(), "Calling Ollama API...");
let start = std::time::Instant::now();
let resp = client.post(&url).json(&request).send().await?;
let mut req = client.post(&url).json(&request);
if let Some(auth_header) = auth {
req = req.header("Authorization", auth_header);
}
let resp = req.send().await?;
let elapsed = start.elapsed();
if !resp.status().is_success() {