Crates.io | gemini-ai |
lib.rs | gemini-ai |
version | 0.1.1672 |
source | src |
created_at | 2024-11-20 07:39:38.154167 |
updated_at | 2024-12-09 14:35:43.658774 |
description | A Rust based Gemini AI API, enabling access to advanced natural language processing and multimodal models. |
homepage | https://crates.io/crates/gemini-ai |
repository | https://github.com/HashiramaSenjuhari/gemini-ai |
max_upload_size | |
id | 1454444 |
size | 109,840 |
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.
Added Rag Concept Model
Added Pdf,Audio,Video Uploading feature
Added Function Calling Feature
MaxTokenLimit Based Response
Instruction Based Response
MaxTokenLimit Based Response
Instruction Based Response
To add this crate to your project, include it in your Cargo.toml
:
[dependencies]
gemini-ai = "0.1.167"
let builder = GeminiContentGenBuilder::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
//eg function calling
let feature1 = Properties::new(
"get_current_place_detail",
"current palce details",
Some(gemini_ai::pulse::format::Paramters {
r#type: String::from("object"),
properties: gemini_ai::pulse::format::SubProperties {
name: String::from("events"),
r#type: String::from("string"),
description: String::from("Render all the events located in current location"),
},
}),
Some(&["events"]),
);
let feature = feature(&[&feature1]);
let pluse = GeminiPulse::new()
.env("GEMINI_API_KEY")
.model(gemini_ai::Models::GEMINI_1_5_PRO)
.train(&feature)
.instruction("your are great in telling events in the current place")
.tell("banglore at 24 november 2024")
.build()
.output();
let builder = GeminiContentGenBuilder::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();