feat(interactions): Add Interactions API support for Java SDK #792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements the Interactions API for the Java SDK, addressing feature request #749.
Based on the OpenAPI spec at ai.google.dev/static/api/interactions.openapi.json
and API documentation at ai.google.dev/api/interactions-api.
Core Clients
Interactions.java) - create, get, cancel, delete operationsAsyncInteractions.java) - CompletableFuture-based operationsStreaming Support (SSE)
Type System
Core Types
Content Types (17)
TextContent, ImageContent, AudioContent, VideoContent, DocumentContent, ThoughtContent,
ThoughtSummaryContent, FunctionCallContent, FunctionResultContent, CodeExecutionCallContent,
CodeExecutionResultContent, GoogleSearchCallContent, GoogleSearchResultContent,
UrlContextCallContent, UrlContextResultContent, FileSearchCallContent, McpServerToolCallContent
Tool Types (7)
Function, GoogleSearch, CodeExecution, FileSearch, UrlContext, ComputerUse, McpServer
Key Features
✓ Multi-turn conversations via previousInteractionId
✓ Manual function calling workflow (application-side execution required)
✓ Background operation support with cancel capability
✓ Rich media support (text, images, audio, video, documents)
✓ Comprehensive tool ecosystem with 7 built-in tools
✓ SSE streaming with resumption support
✓ Agent configuration (Deep Research, Dynamic agents)
Testing
Examples (43 files)
Non-Streaming (19)
Streaming (23)
Pending Work
Fixes: #749