diff options
| author | elvis <elvis@claros.ar> | 2026-09-26 20:20:19 -0300 |
|---|---|---|
| committer | elvis <elvis@claros.ar> | 2026-09-26 20:20:19 -0300 |
| commit | 8518a63f55153e7f45fd49ad6caff5555f4e374f (patch) | |
| tree | 636684eea3fa6f35d78282ab95eb687ef49154af /crates/asist-app/src/registry.rs | |
| parent | 69de76dc9cbedc6092d1e5ce84094a8030de1470 (diff) | |
| download | asist-p-8518a63f55153e7f45fd49ad6caff5555f4e374f.tar.gz asist-p-8518a63f55153e7f45fd49ad6caff5555f4e374f.zip | |
Translate code, comments, logs and terminal UI to English; add English README; rename scriptsHEADmain
Diffstat (limited to 'crates/asist-app/src/registry.rs')
| -rw-r--r-- | crates/asist-app/src/registry.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/crates/asist-app/src/registry.rs b/crates/asist-app/src/registry.rs index a3a10ed..124dc63 100644 --- a/crates/asist-app/src/registry.rs +++ b/crates/asist-app/src/registry.rs @@ -1,9 +1,9 @@ -//! Montaje del juego de herramientas. +//! Assembling the tool set. //! -//! `ToolRegistry::from_config` sólo conoce las que no dependen de nada -//! —el reloj, la shell—, porque vive en el núcleo. Las que necesitan la red o -//! el modelo multimodal se añaden aquí, que es exactamente el punto de -//! extensión documentado en docs/EXTENDER.md. +//! `ToolRegistry::from_config` only knows the ones that depend on nothing +//! (the clock, the shell), because it lives in the core. The ones that need +//! the network or the multimodal model are added here, which is exactly the +//! extension point documented in docs/EXTENDER.md. use std::sync::Arc; use std::time::Duration; @@ -15,8 +15,8 @@ use asist_tools::{ Camera, CameraConfig, Screen, ScreenConfig, SearchBackend, VisionTool, WebSearch, }; -/// Lo que no se pudo activar y por qué, para decírselo al usuario al arrancar -/// en vez de dejarlo en silencio. +/// What could not be enabled and why, to tell the user at startup instead +/// of staying silent. pub struct Skipped { pub tool: &'static str, pub reason: String, @@ -39,7 +39,7 @@ pub fn build(config: &Config, llm: &Arc<LlmClient>) -> (ToolRegistry, Vec<Skippe }), } - // Las dos que ven comparten forma, así que se registran igual. + // The two that see share a shape, so they are registered the same way. for (result, tool) in [ (camera_tool(&config.camera, llm), "mirar_por_la_camara"), (screen_tool(&config.screen, llm), "mirar_la_pantalla"), @@ -60,15 +60,15 @@ fn search_tool(config: &SearchConfig) -> Result<Option<WebSearch>, String> { } let backend = match config.backend.trim().to_lowercase().as_str() { "tavily" => { - // La clave sale del entorno, nunca del fichero de configuración. + // The key comes from the environment, never from the configuration file. let key = std::env::var(&config.api_key_env) .ok() .map(|k| k.trim().to_string()) .filter(|k| !k.is_empty()) .ok_or_else(|| { format!( - "la variable {} está vacía o sin definir; expórtala o cambia \ - search.backend a «searxng»", + "the variable {} is empty or unset; export it or change \ + search.backend to «searxng»", config.api_key_env ) })?; @@ -77,15 +77,15 @@ fn search_tool(config: &SearchConfig) -> Result<Option<WebSearch>, String> { "searxng" => SearchBackend::SearxNG { base_url: config.base_url.clone(), }, - "ddgs" | "comando" => { + "ddgs" | "command" | "comando" => { let (program, args) = config .command .split_first() - .ok_or_else(|| "search.command está vacío".to_string())?; + .ok_or_else(|| "search.command is empty".to_string())?; if !std::path::Path::new(program).exists() && !program.contains('/') { - // Un nombre suelto se busca en el PATH; una ruta tiene que existir. + // A bare name is looked up in PATH; a path must exist. } else if !std::path::Path::new(program).exists() { - return Err(format!("no existe el buscador {program}")); + return Err(format!("the search program {program} does not exist")); } SearchBackend::Command { program: program.into(), @@ -137,8 +137,8 @@ fn screen_tool( finish(VisionTool::screen(Box::new(source), Arc::clone(llm))) } -/// Registrar una herramienta que va a fallar siempre es peor que no tenerla: -/// el modelo la llamaría, se comería el error y gastaría un turno entero. +/// Registering a tool that will always fail is worse than not having it: +/// the model would call it, swallow the error and waste a whole turn. fn finish(tool: VisionTool) -> Result<Option<VisionTool>, String> { match tool.available() { Ok(()) => Ok(Some(tool)), |