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.
What's Implemented
Core Client Classes
Interactions.java- Synchronous client with create, get, cancel, delete methodsAsyncInteractions.java- Asynchronous client with CompletableFuture supportClient.javaType System (66 classes in types/interactions/)
Interaction- Core response type with status, outputs, usage metadataCreateInteractionConfig- Rich configuration with model/agent, tools, generation configContenttypes - TextContent, ImageContent, AudioContent, VideoContent, DocumentContent, FunctionCallContent, FunctionResultContent, CodeExecutionCallContent, GoogleSearchCallContent, UrlContextCallContent, ThoughtContent, McpServerToolCallContent, and moreTooltypes - Function, GoogleSearch, CodeExecution, FileSearch, UrlContext, ComputerUse, McpServerGenerationConfig- Interactions-specific config with thinking level, speech/image configKey Features
Test Coverage
Examples
Not Yet Implemented
Fixes: #749