Crates.io | jemini |
lib.rs | jemini |
version | 0.1.1 |
source | src |
created_at | 2024-02-17 22:42:40.948374 |
updated_at | 2024-02-21 02:48:55.589099 |
description | THIS IS A WIP! (But the simplest functionality there) A, _hopefully_ Rusty wrapper for the Gemini REST API: https://ai.google.dev/tutorials/rest_quickstart?hl=en Note: This API's subject and models from the phind:codellama family are co-authors. |
homepage | |
repository | https://github.com/alphastrata/jemini |
max_upload_size | |
id | 1143588 |
size | 4,344,735 |
Jemini is a Rust library that provides a simple and intuitive interface for interacting with the Google Gemini REST API.
It exists because I couldn't help but notice that there's no Rust option in their docs... shame on you Google.
And, there are the results for the mandatory crates.io
search.
Note: This API's subject and models from the phind:codellama family are co-authors.
It is by no means exhaustive, and is most definitely a WIP, however the included examples should show you how useful/not-useful it would be to your use case.
To get started with Jemini, add it as a dependency to your Rust project's Cargo.toml
file:
[dependencies]
jemini = "0.1.0"
After adding Jemini as a dependency, you will need to obtain an API key from the Google Gemini API to interact with the services.
NOTE: A Google AI Studio account is required (Currently free).
Make sure to set the GEMINI_API_KEY environment variable with your API key before running your application.
Then, in your main.rs
:
use jemini::{JeminiClient, GeminiError};
#[tokio::main]
async fn main() -> Result<(), GeminiError> {
let client = JeminiClient::new()?;
let response: GeminiResponse = client.text_only("What is the meaning of life?").await?;
dbg!(&response);
println!("{}", response.most_recent().unwrap());
Ok(())
}
NOTE:
GeminiError
will#transparent
most of / all of the errors possible from the dependency crates so be aware of that should you encounter problems.
To run the tests for Jemini, use the following command:
cargo test
Contributions to Jemini are welcome! Please feel free to open an issue or submit a pull request if you have improvements or bug fixes.
Jemini is licensed under the MIT License.
https://crates.io/crates/google-generative-ai-rs by https://crates.io/users/avastmick