aipim 0.1.1

AIPIM is a Rust library designed to provide a unified interface for interacting with various AI providers. It abstracts the complexities of different AI APIs, allowing developers to easily switch between providers without changing their codebase.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use async_trait::async_trait;

mod anthropic;
mod google;
mod openai;

pub use anthropic::Anthropic;
pub use google::Google;
pub use openai::OpenAI;

use crate::client::{Message, Response};

#[async_trait]
pub trait AIProvider {
    async fn send_message(&self, message: Message) -> anyhow::Result<Response>;
}