add basic i18n

This commit is contained in:
milan
2026-04-12 00:12:45 +02:00
parent 7958275438
commit 01e7da136c
8 changed files with 461 additions and 30 deletions
+9 -4
View File
@@ -103,9 +103,8 @@ impl AgentChat {
ollama_client: Ollama,
model: String,
mcp_clients: HashMap<String, MCPClient>,
system_prompt: String,
) -> Result<Self, ServiceError> {
let history = vec![ChatMessage::system(system_prompt)];
let history = vec![];
let mut servers = HashMap::new();
@@ -192,7 +191,13 @@ impl AgentChat {
{
let all_tools: Vec<ToolInfo> = self
.get_all_tools()
.map(|restricted_tool| restricted_tool.tool_info.clone())
.filter_map(|restricted_tool|{
if restricted_tool.permission == ToolPermission::Denied { // filters denied tools to save tokens
None
} else {
Some(restricted_tool.tool_info.clone())
}
})
.collect();
log::debug!("all tools: {all_tools:#?}");
@@ -347,7 +352,7 @@ mod tests {
).await.unwrap(),
)]);
let mut chat = AgentChat::new(ollama, "lfm2.5-thinking:1.2b".to_string(), mcp_clients, String::new()).await.unwrap();
let mut chat = AgentChat::new(ollama, "lfm2.5-thinking:1.2b".to_string(), mcp_clients).await.unwrap();
let tools: Vec<RestrictedTool> = chat.get_all_tools().cloned().collect();
assert_eq!(tools.len(), 1);