refactoring

partially implement tts for human interface
This commit is contained in:
milan
2026-04-14 21:26:10 +02:00
parent c2e9709aa0
commit ef468e8fd6
9 changed files with 160 additions and 37 deletions
+13 -6
View File
@@ -7,9 +7,9 @@ use crate::config::Config;
use crate::human_interface::HumanInterface;
use crate::i18n::translate;
use crate::model::create_model_from_config;
use base64::Engine;
use clap::Parser;
use std::fmt::Display;
use base64::Engine;
/// partial mcp client with cli and voice interaction
#[derive(Parser, Debug)]
@@ -31,7 +31,7 @@ fn basic_auth_tool() {
.interact()
.unwrap();
let encoded= base64::prelude::BASE64_STANDARD.encode(format!("{}:{}", username, password));
let encoded = base64::prelude::BASE64_STANDARD.encode(format!("{}:{}", username, password));
println!("Basic {}", encoded);
}
@@ -86,7 +86,6 @@ async fn main() {
);
let mut human_interface = human_interface::cli::CommandLine::new();
human_interface.run().await.unwrap();
loop {
let user_message = human_interface.expect_user_message().await.unwrap();
@@ -96,13 +95,21 @@ async fn main() {
immutable_interface
.ask_for_permission(mcp_server_name, tool_name)
.await
.inspect_err(exit_msg!("Human interface error"))
.inspect_err(exit_msg!(
"Human interface error while asking for permission"
))
.unwrap()
})
.await
.inspect_err(exit_msg!("failed communicating with agent"))
.inspect_err(exit_msg!("Failed communicating with agent."))
.unwrap();
human_interface
.agent_message(agent_message.content)
.await
.inspect_err(exit_msg!(
"Human interface error while trying to display message"
))
.unwrap();
human_interface.agent_message(agent_message.content);
}
}