use crate::common::utils::setup_test_env; use anyhow::Result; use meridian::{ agents::{base_agent::BaseAgent, AgentBehavior}, context::ContextSession, llms::{ messages::{Message, MessageType, Role}, open_ai::messages::OpenAIMessage, }, prompts::{templates, UserPrompt}, }; #[test] fn test_agent() -> Result<()> { setup_test_env()?; let mut context = ContextSession::new()?; context.add_text_to_context("test", "Hello, world!"); let mut agent = BaseAgent::open_ai(); agent.add_message(MessageType::OpenAI(OpenAIMessage::new( "Hello, world! What's your name?", Role::User, ))); let response = agent.call(UserPrompt(templates::get_context_prompt( "Hello, world!".to_string(), &context, )))?; println!("{:?}", response); assert!(!response.is_empty()); Ok(()) }