Skip to content

feat: add Interactions API with full implementation, examples, and de… - #74

Merged
flachesis merged 1 commit into
mainfrom
interaction-api
Jul 10, 2026
Merged

feat: add Interactions API with full implementation, examples, and de…#74
flachesis merged 1 commit into
mainfrom
interaction-api

Conversation

@flachesis

Copy link
Copy Markdown
Owner

…precation marks

Implement the Interactions API as the modern interface for Gemini models and agents, alongside the existing generateContent API (now deprecated).

Core implementation (src/interactions/):

  • model.rs: Interaction, Step (18 variants), InteractionContent, InteractionTool (9 variants), ResponseFormat, InteractionGenerationConfig, InteractionUsage, AgentConfig, CreateInteractionRequest, 40+ supporting enums/structs
  • builder.rs: InteractionBuilder with 40+ fluent methods
  • stream.rs: InteractionEvent (7 variants), StepDeltaData (22 variants), InteractionStream type alias
  • handle.rs: InteractionHandle (get/cancel/delete/poll_until_completed)
  • mod.rs: Convenience methods on Interaction (output_text, function_calls, citations, etc.)

Client extensions (src/client.rs):

  • GeminiClient: create/get/cancel/delete interaction (streaming + non-streaming)
  • Gemini: create_interaction(), interaction(), get_interaction()

Deprecation marks:

  • ContentBuilder, GenerateContentRequest, GenerationResponse, GenerationConfig, Gemini::generate_content() marked #[deprecated]
  • Internal #[allow(deprecated)] added to generation, batch, and client modules

18 new examples covering: basic, streaming, multi-turn, multimodal, structured output, function calling, thinking, google search, google maps, code execution, url context, file search, image gen, TTS, background execution, deep research agent, advanced config, error handling, custom client, and tracing.

README.md updated with Interactions API quick start section. Migration plan documented in interactions-api/migration-plan.md.

…precation marks

Implement the Interactions API as the modern interface for Gemini models
and agents, alongside the existing generateContent API (now deprecated).

Core implementation (src/interactions/):
- model.rs: Interaction, Step (18 variants), InteractionContent, InteractionTool
  (9 variants), ResponseFormat, InteractionGenerationConfig, InteractionUsage,
  AgentConfig, CreateInteractionRequest, 40+ supporting enums/structs
- builder.rs: InteractionBuilder with 40+ fluent methods
- stream.rs: InteractionEvent (7 variants), StepDeltaData (22 variants),
  InteractionStream type alias
- handle.rs: InteractionHandle (get/cancel/delete/poll_until_completed)
- mod.rs: Convenience methods on Interaction (output_text, function_calls,
  citations, etc.)

Client extensions (src/client.rs):
- GeminiClient: create/get/cancel/delete interaction (streaming + non-streaming)
- Gemini: create_interaction(), interaction(), get_interaction()

Deprecation marks:
- ContentBuilder, GenerateContentRequest, GenerationResponse, GenerationConfig,
  Gemini::generate_content() marked #[deprecated]
- Internal #[allow(deprecated)] added to generation, batch, and client modules

18 new examples covering: basic, streaming, multi-turn, multimodal, structured
output, function calling, thinking, google search, google maps, code execution,
url context, file search, image gen, TTS, background execution, deep research
agent, advanced config, error handling, custom client, and tracing.

README.md updated with Interactions API quick start section.
Migration plan documented in interactions-api/migration-plan.md.
@flachesis
flachesis merged commit e230655 into main Jul 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant