Refactor codebase for consistency and readability
- Standardize array and vector formatting for clarity. - Adjust spacing and indentation in examples and TUI code. - Ensure proper newline usage across files (e.g., LICENSE, TOML files, etc.). - Simplify `.to_string()` and `.ok()` calls for brevity.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// This example demonstrates a basic chat interaction without the TUI.
|
||||
|
||||
use owlen_core::model::Model;
|
||||
use owlen_core::provider::Provider;
|
||||
use owlen_core::session::Session;
|
||||
use owlen_ollama::OllamaProvider; // Assuming you have an Ollama provider
|
||||
use owlen_core::provider::Provider;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), anyhow::Error> {
|
||||
|
||||
@@ -16,10 +16,16 @@ impl Provider for MyCustomProvider {
|
||||
}
|
||||
|
||||
async fn chat(&self, session: &Session, model: &Model) -> Result<String, anyhow::Error> {
|
||||
println!("Custom provider received chat request for model: {}", model.name);
|
||||
println!(
|
||||
"Custom provider received chat request for model: {}",
|
||||
model.name
|
||||
);
|
||||
// In a real implementation, you would send the session data to an API.
|
||||
let message_count = session.get_messages().len();
|
||||
Ok(format!("This is a custom response. You have {} messages in your session.", message_count))
|
||||
Ok(format!(
|
||||
"This is a custom response. You have {} messages in your session.",
|
||||
message_count
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ fn main() {
|
||||
println!("\nSession cleared.");
|
||||
|
||||
let messages_after_clear = session.get_messages();
|
||||
println!("Messages in session after clear: {}", messages_after_clear.len());
|
||||
println!(
|
||||
"Messages in session after clear: {}",
|
||||
messages_after_clear.len()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user