Expand description
Async Rust client for Google Gemini Chat API.
This library provides an async HTTP client for interacting with Google Gemini,
similar to the Python gemini_client library.
§Example
use gemini_chat_api::{AsyncChatbot, Model, load_cookies};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load cookies from file
let (psid, psidts) = load_cookies("cookies.json")?;
// Create chatbot
let mut chatbot = AsyncChatbot::new(&psid, &psidts, Model::default(), None, 30).await?;
// Send message
let response = chatbot.ask("Hello! Tell me a joke.", None).await?;
println!("{}", response.content);
Ok(())
}Re-exports§
pub use client::AsyncChatbot;pub use client::ChatResponse;pub use client::Choice;pub use client::SavedConversation;pub use enums::Endpoint;pub use enums::Model;pub use error::Error;pub use error::Result;