use meridian::{
    llms::{
        communication::email::{send_email, write_text_email, Email},
        open_ai::OpenAIClient,
        ProviderModel,
    },
    prompts::{BasePrompt, UserPrompt},
};

use anyhow::Result;

use crate::common::utils::setup_test_env;
#[test]
fn test_write_text_email() -> Result<()> {
    setup_test_env()?;
    let email = write_text_email(
        vec!["tim@fiveonefour.com".to_string()],
        "Hello, world!",
        OpenAIClient::new(),
    )?;
    println!("{:?}", email);
    Ok(())
}

#[test]
fn test_send_email() -> Result<()> {
    setup_test_env()?;
    let email = Email::new(
        "aurora@514.ai",
        "Test email",
        vec!["tim@fiveonefour.com"],
        "Hello, world!",
    );

    send_email(&email)?;
    Ok(())
}

#[test]
fn test_send_to() -> Result<()> {
    setup_test_env()?;
    let response = UserPrompt("Hello, world!".to_string()).send_to(ProviderModel::gpt_4o())?;
    println!("{:?}", response);
    Ok(())
}
