#gemini #ai #rag #ai-api #bard #language-model #api-access

gemini-ai

A Rust based Gemini AI API, enabling access to advanced natural language processing and multimodal models

21 releases

new 0.1.1676 Feb 20, 2025
0.1.1675 Feb 20, 2025
0.1.1672 Dec 9, 2024
0.1.166 Nov 30, 2024

#79 in Machine learning

Download history 564/week @ 2024-11-15 834/week @ 2024-11-22 296/week @ 2024-11-29 757/week @ 2024-12-06 179/week @ 2024-12-13 48/week @ 2024-12-20 37/week @ 2024-12-27 60/week @ 2025-01-03 30/week @ 2025-01-10

2,294 downloads per month
Used in gemini-cli

MIT license

62KB
1.5K SLoC

Gemini AI Rust Wrapper

Welcome to the Rust Gemini AI! This crate provides a Rust interface to interact with the Gemini AI API, which powers advanced natural language processing (NLP) and multimodal capabilities.

License Gemini AI Logo

New Feature Added

  • Added Rag Concept Model

  • Added Pdf,Audio,Video Uploading feature

  • MaxTokenLimit Based Response

  • Instruction Based Response

Previous New Feature Added

  • MaxTokenLimit Based Response

  • Instruction Based Response

Features

  • Instruction Processing: Based on instruction customize the response in the way you like.
  • Natural Language Processing: Access powerful language models like Gemini 1.5 Pro for advanced text analysis, summarization, and generation.
  • Multimodal Capabilities: Interact with Gemini models that can handle not only text but also images, audio,pdf, and video inputs.
  • Easy Integration: A straightforward API wrapper for easy integration into your Rust projects.

Installation

To add this crate to your project, include it in your Cargo.toml:


   [dependencies]
   gemini-ai = "0.1.167"

       let builder = Gemini::new()
        .env("GEMINI_API_KEY")
        .model(gemini_ai::Models::GEMINI_1_5_PRO_002)
        // .memory(gemini_ai::Memorys::Json)
        .no_memory()
        .kind(gemini_ai::Kind::Image("statics/OIP.jpeg"))
        .instruction("")
        .text("hi tell character name")
        .max_token(gemini_ai::TokenLen::Default)
        .build()
        .output();

   let string = decode_gemini(&builder); // optional to decode the output if it sends the reponse else error
        let builder = Gemini::new()
        .env("GEMINI_API_KEY")
        .model(gemini_ai::Models::GEMINI_1_5_PRO_002)
        // .memory(gemini_ai::Memorys::Json)
        .no_memory()
        .kind(gemini_ai::Kind::Audio("statics/OIP.mpeg"))
        .instruction("tell hi")
        .text("hi tell character name")
        .max_token(gemini_ai::TokenLen::Default)
        .build()
        .output();

Issue post your problem truebillionhari@gmail.com

Dependencies

~4–18MB
~260K SLoC