Skip to content

Conversation

@prasadskarmarkar
Copy link

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 methods
  • AsyncInteractions.java - Asynchronous client with CompletableFuture support
  • Integration with existing Client.java

Type System (66 classes in types/interactions/)

  • 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

Key Features

  • 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

Test Coverage

  • Unit tests for validation, types, serialization
  • Mock-based integration tests

Examples

  • 38 example files demonstrating all features
  • Coverage of all content types, tools, and configurations

Not Yet Implemented

  • SSE streaming (InteractionSseEvent) - Framework prepared but not complete
  • Replay tests - Pending

Fixes: #749

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

- Unit tests for validation, types, serialization
- Mock-based integration tests

- example files demonstrating all features
- Coverage of all content types, tools, and configurations

- SSE streaming (InteractionSseEvent) - Framework prepared but not complete
- Replay tests - Pending

Fixes: googleapis#749
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.

Support for Interactions API

1 participant