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
//! Gemini Interactions API (Beta).
//!
//! The Interactions API is Google's new direction for the Gemini API. It replaces
//! the `generateContent` request/response shape with a stateful
//! [`Interaction`](crate::interactions::Interaction) resource built around a
//! typed [`Step`](crate::interactions::Step) timeline, polymorphic content
//! blocks, and an explicit streaming event model.
//!
//! Unlike `generateContent`, the Interactions API offers:
//!
//! - **Server-side history** via `previous_interaction_id` (no need to resend the
//! full transcript each turn).
//! - **Observable execution steps** — thoughts, tool calls, tool results, and the
//! final model output are all surfaced as typed
//! [`Step`](crate::interactions::Step) entries.
//! - **Background and long-running tasks** via `background = true`.
//! - **Agentic workflows** with native multi-step tool use.
//!
//! This module is gated behind the `interactions` feature flag. It is additive and
//! does not change any existing `generateContent` API.
//!
//! # Quick start
//!
//! ```rust,ignore
//! use adk_gemini::{Gemini, Model};
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let gemini = Gemini::new("YOUR_API_KEY")?;
//!
//! let interaction = gemini
//! .create_interaction()
//! .model(Model::Gemini35Flash)
//! .input_text("Explain agentic workflows in one sentence.")
//! .send()
//! .await?;
//!
//! println!("{}", interaction.output_text().unwrap_or_default());
//! # Ok(())
//! # }
//! ```
//!
//! # Status
//!
//! The Interactions API is in **beta**. Google may introduce breaking changes to
//! the request/response schema. The types here track the `Api-Revision:
//! 2026-05-20` schema (the `steps` schema with polymorphic `response_format`).
pub
pub use AgentConfig;
pub use InteractionBuilder;
pub use ;
pub use ;
pub use ;
pub use ;
/// The `Api-Revision` header value pinning the steps-schema contract this module
/// targets. Sent on every Interactions API request.
pub const API_REVISION: &str = "2026-05-20";