extern crate failure;
use rust_bert::pipelines::conversation::{ConversationManager, ConversationModel};
fn main() -> failure::Fallible<()> {
let conversation_model = ConversationModel::new(Default::default())?;
let mut conversation_manager = ConversationManager::new();
let conversation_1_id =
conversation_manager.create("Going to the movies tonight - any suggestions?");
let _conversation_2_id = conversation_manager.create("What's the last book you have read?");
let output = conversation_model.generate_responses(&mut conversation_manager);
println!("{:?}", output);
let _ = conversation_manager
.get(&conversation_1_id)
.unwrap()
.add_user_input("Is it an action movie?");
let output = conversation_model.generate_responses(&mut conversation_manager);
println!("{:?}", output);
let output = conversation_model.generate_responses(&mut conversation_manager);
println!("{:?}", output);
Ok(())
}