diff --git a/csml_engine/src/init.rs b/csml_engine/src/init.rs index fc0b6ccc..90e6bbfa 100644 --- a/csml_engine/src/init.rs +++ b/csml_engine/src/init.rs @@ -102,6 +102,12 @@ pub fn init_conversation_info<'a>( * Initialize the bot */ pub fn init_bot(bot: &mut CsmlBot) -> Result<(), EngineError> { + // load native components into the bot + bot.native_components = match load_components() { + Ok(components) => Some(components), + Err(err) => return Err(EngineError::Interpreter(err.format_error())), + }; + match validate_bot(&bot) { CsmlResult { flows: Some(flows), @@ -122,12 +128,6 @@ pub fn init_bot(bot: &mut CsmlBot) -> Result<(), EngineError> { _ => return Err(EngineError::Interpreter(format!("empty bot"))), } - // load native components into the bot - bot.native_components = match load_components() { - Ok(components) => Some(components), - Err(err) => return Err(EngineError::Interpreter(err.format_error())), - }; - Ok(()) } diff --git a/csml_engine/src/interpreter_actions.rs b/csml_engine/src/interpreter_actions.rs index 593a4758..8b6e25e8 100644 --- a/csml_engine/src/interpreter_actions.rs +++ b/csml_engine/src/interpreter_actions.rs @@ -43,7 +43,6 @@ pub fn interpret_step( memories.insert(mem.key.clone(), mem); }, MSG::Message(msg) => { - println!("{:?}", msg); send_msg_to_callback_url(data, vec![msg.clone()], interaction_order, false); data.messages.push(msg); } @@ -145,7 +144,7 @@ pub fn interpret_step( if let Ok(var) = env::var(DEBUG) { if var == "true" { let el = now.elapsed()?; - println!( + eprintln!( "Save message & memories bulk at the end of step - {}.{}", el.as_secs(), el.as_millis() diff --git a/csml_interpreter/src/data/primitive/object.rs b/csml_interpreter/src/data/primitive/object.rs index 24278bed..5b3874f4 100644 --- a/csml_interpreter/src/data/primitive/object.rs +++ b/csml_interpreter/src/data/primitive/object.rs @@ -603,7 +603,7 @@ impl PrimitiveObject { interval ) ); - Ok(PrimitiveBoolean::get_literal(true, interval)) + Ok(PrimitiveObject::get_literal(&object.value, interval)) } None => Ok(PrimitiveBoolean::get_literal(false, interval)) } diff --git a/csml_interpreter/src/interpreter/variable_handler/gen_generic_component.rs b/csml_interpreter/src/interpreter/variable_handler/gen_generic_component.rs index 025d84ee..809f835b 100644 --- a/csml_interpreter/src/interpreter/variable_handler/gen_generic_component.rs +++ b/csml_interpreter/src/interpreter/variable_handler/gen_generic_component.rs @@ -426,7 +426,6 @@ pub fn gen_generic_component( } for key in keys { - println!("=> {}", key); if let Some(result) = memoization.get(key) { hashmap.insert( key.to_owned(),