refactoring

different default system prompts for cli and audio
This commit is contained in:
2026-05-04 21:18:09 +02:00
parent 3d8975cfc1
commit 51b1123cf9
16 changed files with 80 additions and 45 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
use crate::config::OllamaModelConfig;
use crate::config::{HumanInterface, OllamaModelConfig};
use crate::tlt;
use crate::translate;
use ollama_rs::Ollama;
@@ -9,6 +9,7 @@ use ollama_rs::models::create::{CreateModelRequest, CreateModelStatus};
pub async fn create_model_from_config(
ollama: &Ollama,
config: &OllamaModelConfig,
interface: &HumanInterface
) -> Result<CreateModelStatus, OllamaError> {
let model_options = ModelOptions::default()
.num_ctx(config.context_size.unwrap_or(2048)) // 2048 is the ollama default.
@@ -17,7 +18,10 @@ pub async fn create_model_from_config(
let system_prompt = config
.system_prompt
.clone()
.unwrap_or(tlt!("system_prompt"));
.unwrap_or(match interface {
HumanInterface::Cli => tlt!("system_prompt_cli"),
HumanInterface::Audio => tlt!("system_prompt_audio"),
});
// print message to warn user of long waiting times
if let Ok(models) = ollama.list_local_models().await