feat(interactions): Add Interactions API support for Java SDK#792
Open
prasadskarmarkar wants to merge 1 commit intogoogleapis:mainfrom
Open
feat(interactions): Add Interactions API support for Java SDK#792prasadskarmarkar wants to merge 1 commit intogoogleapis:mainfrom
prasadskarmarkar wants to merge 1 commit intogoogleapis:mainfrom
Conversation
56d09fa to
20356c9
Compare
f33cff4 to
58b3f4c
Compare
c40e15f to
a07675a
Compare
Author
|
Hi @hemasekhar-p , This PR implements full Interactions API support for the Java SDK (including SSE streaming) and addresses #749. Tagging @jaycee-li for visibility, as this PR adds Interactions API support and integrates with the existing client and streaming infrastructure. |
013b6a3 to
3a1b481
Compare
Implements the Interactions API for the Java SDK, addressing feature request googleapis#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. - `Interactions.java` - Synchronous client with create, get, cancel, delete methods - `AsyncInteractions.java` - Asynchronous client with CompletableFuture support - Integration with existing `Client.java` - `Interaction` - Core response type with status, outputs, usage metadata - `CreateInteractionConfig` - Rich configuration with model/agent, tools, generation config - `Content` types - TextContent, ImageContent, AudioContent, VideoContent, DocumentContent, FunctionCallContent, FunctionResultContent, CodeExecutionCallContent, GoogleSearchCallContent, UrlContextCallContent, ThoughtContent, McpServerToolCallContent, and more - `Tool` types - Function, GoogleSearch, CodeExecution, FileSearch, UrlContext, ComputerUse, McpServer - `GenerationConfig` - Interactions-specific config with thinking level, speech/image config - Multi-turn conversations via previousInteractionId - Manual function calling workflow (no AFC - requires application-side execution) - Background operation support with cancel capability - Rich media support (text, images, audio, video, documents) - Comprehensive tool ecosystem - SSE streaming support (InteractionSseEvent) for real-time interaction updates - Unit tests for validation, types, serialization - Mock-based integration tests - example files demonstrating all features - Coverage of all content types, tools, and configurations - Replay tests - Pending- setup done - working on generating replay JSON files for testing Fixes: googleapis#749
3a1b481 to
825fcdd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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