feat(interactions): Add Interactions API support for Java SDK#792
feat(interactions): Add Interactions API support for Java SDK#792prasadskarmarkar wants to merge 1 commit intogoogleapis:mainfrom
Conversation
56d09fa to
20356c9
Compare
f33cff4 to
58b3f4c
Compare
c40e15f to
a07675a
Compare
|
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. |
3a1b481 to
825fcdd
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
825fcdd to
4a3440f
Compare
|
@google-genai-bot review |
|
Hi @prasadskarmarkar, thanks for your work on the interactions API! Our internal team has actually been developing this feature in a private repo and we plan to launch it soon. Since our implementations overlap, we'll be moving forward with the internal version. We appreciate the contribution! |
|
Hi @jaycee-li, Thanks for the update! I’ve completed an initial implementation of Interactions API support in adk-java (google/adk-java#796) and am currently testing it. This work builds on the Interactions API support in java-genai. I also noticed the issue was recently labeled as an enhancement — just wanted to confirm whether this is something the team is planning to implement internally, or if external contributions would be welcome. Before I proceed further, I’d appreciate any guidance on how best to align. |
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