- Include detailed architecture overview in `docs/architecture.md`. - Add `docs/configuration.md`, detailing configuration file structure and settings. - Provide a step-by-step provider implementation guide in `docs/provider-implementation.md`. - Add frequently asked questions (FAQ) document in `docs/faq.md`. - Create `docs/migration-guide.md` for future breaking changes and version upgrades. - Introduce new examples in `examples/` showcasing basic chat, custom providers, and theming. - Add a changelog (`CHANGELOG.md`) for tracking significant changes. - Provide contribution guidelines (`CONTRIBUTING.md`) and a Code of Conduct (`CODE_OF_CONDUCT.md`).
29 lines
863 B
Rust
29 lines
863 B
Rust
// This example demonstrates how to use the session controller.
|
|
|
|
use owlen_core::session::Session;
|
|
|
|
fn main() {
|
|
// Create a new session.
|
|
let mut session = Session::new("my-session");
|
|
println!("Created new session: {}", session.name);
|
|
|
|
// Add messages to the session.
|
|
session.add_message("user", "Hello, Owlen!");
|
|
session.add_message("bot", "Hello, user! How can I help you today?");
|
|
|
|
// Get the messages from the session.
|
|
let messages = session.get_messages();
|
|
println!("\nMessages in session:");
|
|
for message in messages {
|
|
println!(" {}: {}", message.role, message.content);
|
|
}
|
|
|
|
// Clear the session.
|
|
session.clear_messages();
|
|
println!("\nSession cleared.");
|
|
|
|
let messages_after_clear = session.get_messages();
|
|
println!("Messages in session after clear: {}", messages_after_clear.len());
|
|
}
|
|
|