Crates.io | aipim |
lib.rs | aipim |
version | 0.1.1 |
source | src |
created_at | 2024-06-27 20:13:39.054212 |
updated_at | 2024-06-27 20:52:10.834539 |
description | 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. |
homepage | |
repository | https://github.com/fcoury/aipim |
max_upload_size | |
id | 1286115 |
size | 84,042 |
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.
Add this to your Cargo.toml
:
[dependencies]
aipim = "0.1.0"
Here's a simple example to get you started:
use aipim::client::Client;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
dotenv::dotenv().ok();
let client = Client::new("gpt-4o");
let response = client.message().text("Hello, world!").send().await?;
println!("Response: {}", response.text);
Ok(())
}
client
: Contains the Client
and MessageBuilder
structs.provider
: Contains the AIProvider
trait and implementations for different providers.We welcome contributions! Please see our CONTRIBUTING.md for more details.
This project is licensed under the MIT License. See the LICENSE file for details.