1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//! Native Gemini provider for the `aither` trait ecosystem.
//!
//! This crate integrates Google’s **Gemini Developer API** with the shared abstractions from
//! `aither-core`. Each capability (chat, embeddings, images, audio, moderation) is implemented
//! as a thin wrapper around the corresponding REST endpoint so other providers can follow the same
//! patterns.
//!
//! # Quick start
//!
//! ```no_run
//! use aither_core::{
//! LanguageModel,
//! llm::{LLMRequest, Message, collect_text, model::Parameters},
//! };
//! use aither_gemini::Gemini;
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let gemini = Gemini::new(std::env::var("GEMINI_API_KEY")?);
//! let request = LLMRequest::new([
//! Message::system("You are a concise assistant."),
//! Message::user("Explain Tokio in two bullet points."),
//! ])
//! .with_parameters(Parameters::default());
//! let stream = gemini.respond(request);
//! let full = collect_text(stream).await?;
//! println!("{full}");
//! # Ok(()) }
//! ```
pub use ;
pub use GeminiError;
pub use GeminiProvider;
/// Gemini model identifiers, for use with [`Gemini::with_text_model`].
///
/// These are plain constants rather than per-model constructors: a constructor
/// named after a model version has to be renamed every time Google ships one,
/// and callers who pin a model want the identifier, not a wrapper around it.
/// Provider tag stamped on reasoning state produced by this crate.
///
/// Reasoning state is only ever replayed to the provider that signed it, so
/// this string must stay stable across releases; changing it silently
/// invalidates state stored in existing transcripts.
pub const PROVIDER_NAME: &str = "google";