add basic i18n
This commit is contained in:
+9
-9
@@ -1,9 +1,11 @@
|
||||
mod config;
|
||||
mod model;
|
||||
mod human_interface;
|
||||
mod i18n;
|
||||
|
||||
|
||||
use crate::i18n::translate;
|
||||
use own_mcp::audio::{AudioClientTrait};
|
||||
use own_mcp::mcp::chat::{PermissionAnswer, ToolPermission};
|
||||
use crate::config::Config;
|
||||
use crate::model::create_model_from_config;
|
||||
use crate::human_interface::HumanInterface;
|
||||
@@ -25,20 +27,18 @@ async fn main() {
|
||||
|
||||
let ollama = config.ollama_instance();
|
||||
let model_name = &config.ollama_config().model.name;
|
||||
|
||||
create_model_from_config(&ollama, &config.ollama_config().model).await.inspect_err(|e|{
|
||||
log::error!("failed creating ollama model {model_name}: {e}");
|
||||
std::process::exit(1);
|
||||
}).unwrap();
|
||||
let system_prompt = "Du bist ein Assistent, der per Sprache bedient wird. Du erhälst die Transkription \
|
||||
und dein Output wird per Sprache ausgegeben und sollte dementsprechend auch kurz sein und kein Markdown enthalten. \
|
||||
Wichtiger als deine Antworten sind deine Aktionen.\
|
||||
Nutze bitte die tools, falls du sie brauchst um Informationen zu bekommen (z.B. über das aktuelle Datum oder den aktuellen Wochentag). \
|
||||
Du bist in einem Agent Loop und kannst mehrere Tools hintereinander nutzen. \
|
||||
Falls der Nutzer das Nutzen eines Tools ablehnt, sag ihm bescheid, dass du es brauchst.".to_string();
|
||||
|
||||
let mcp_clients = config.mcp_clients().await;
|
||||
let mcp_clients = config.mcp_clients().await.inspect_err(|e|{
|
||||
log::error!("failed creating MCP clients: {e}");
|
||||
std::process::exit(1);
|
||||
}).unwrap();
|
||||
|
||||
let mut agent_chat = own_mcp::AgentChat::new(ollama, model_name.clone(), mcp_clients, system_prompt).await.inspect_err(
|
||||
let mut agent_chat = own_mcp::AgentChat::new(ollama, model_name.clone(), mcp_clients).await.inspect_err(
|
||||
|e| {
|
||||
log::error!("error creating agent: {}", e);
|
||||
std::process::exit(1);
|
||||
|
||||
Reference in New Issue
Block a user