Crate gems

source ·
Expand description

§Gems

A crate for interacting with the Gemini API, allowing you to generate creative content, perform text-related tasks, and get information about supported models.

§Quick Start

Get started with the gems library by following these simple steps:

  1. Install the gems crate by adding the following line to your Cargo.toml file:
[dependencies]
gems = "0.0.4"
  1. Use the Client struct to interact with the Gemini API:
use gems::Client;

#[tokio::main]
async fn main() {
    let mut client = Client::new("your_api_key", "your_model");

    // Use the various functions provided by the client
    // For example:
    match client.generate_content("Hello").await {
        Ok(response) => {
            println!("{}", response);
        }
        Err(err) => {
            eprintln!("Error: {:?}", err);
        }
    }
}

§Subcommands

SubcommandDescription
generateGenerate creative content.
streamStream the generation of content.
countCount the number of tokens in a text.
embedEmbed content into a specified model.
batchBatch embed multiple contents.
infoGet information about the current model.
listList available models.

§GitHub Repository

You can access the source code for the gems crate on GitHub.

§Contributing

Contributions and feedback are welcome! If you’d like to contribute, report an issue, or suggest an enhancement, please engage with the project on GitHub. Your contributions help improve this crate for the community.

Re-exports§

Modules§