- Updated `BootstrapManager` to use `AppConfig::from_env().expect(...)` and `AppConfig::from_database(...).expect(...)` ensuring failures are explicit rather than silently ignored. - Refactored error propagation in bootstrap flow to use `?` where appropriate, improving reliability of configuration loading. - Added import of `llm_models` in `bot` module and introduced `ConfigManager` usage to fetch the LLM model identifier at runtime. - Integrated dynamic LLM model handler selection via `llm_models::get_handler(&model)`. - Replaced static environment variable retrieval for embedding configuration with runtime
21 lines
507 B
Rust
21 lines
507 B
Rust
use super::ModelHandler;
|
|
|
|
pub struct GptOss20bHandler;
|
|
|
|
impl ModelHandler for GptOss20bHandler {
|
|
fn is_analysis_complete(&self, buffer: &str) -> bool {
|
|
buffer.ends_with("final")
|
|
}
|
|
|
|
fn process_content(&self, content: &str) -> String {
|
|
if let Some(pos) = content.find("final") {
|
|
content[..pos].to_string()
|
|
} else {
|
|
content.to_string()
|
|
}
|
|
}
|
|
|
|
fn has_analysis_markers(&self, buffer: &str) -> bool {
|
|
buffer.contains("**")
|
|
}
|
|
}
|