Repository navigation
Release v2.0.1
⚠️ Breaking Changes & Migration Guide
Release 2.0.1 completes the type-safety overhaul by eliminating untyped Object return types from core SDK models and replacing them with type-safe union records:
1. Interaction.Turn.content() returns TurnContent instead of Object
- What changed:
turn.content()now returnsTurnContentinstead of untypedObject. - Migration:
- For plain text turns, use
turn.text()(orturn.content().text()). - For multimodal turns, use
turn.parts()(orturn.content().parts()). - To check the underlying type, use
turn.content().isText()orturn.content().isParts(). - Alternatively,
turn.content().value()returns the raw underlyingStringorList<Content>.
- For plain text turns, use
2. InteractionParams.Request.input() returns InteractionInput instead of Object
- What changed:
params.input()onInteractionParams.Request,ModelInteractionParams, andAgentInteractionParamsnow returnsInteractionInputinstead ofObject. - Migration:
- Extract the input via type-safe accessors:
- Plain text:
params.input().text() - Content parts:
params.input().contents() - Conversation turns:
params.input().turns() - Interaction steps:
params.input().steps() - Raw value:
params.input().value()
- Plain text:
- Inspect variant with
input.isText(),input.isContents(),input.isTurns(), orinput.isSteps(). - Note: Builder methods (
.input(String),.input(Content...),.input(Turn...),.input(Step...), etc.) remain fully supported with convenient overloads.
- Extract the input via type-safe accessors:
3. AgentInteractionParams.environment() returns BaseEnvironment instead of Object
- What changed:
params.environment()now returnsBaseEnvironmentinstead ofObject. - Migration:
- Preset names (e.g.
"remote","default"):params.environment().preset(). - Custom environment configs:
params.environment().config(). - Inspect with
env.isPreset()orenv.isCustom(). - Or retrieve the underlying value via
params.environment().value().
- Preset names (e.g.
4. Trigger.interaction() returns TriggerInteraction instead of Object
- What changed:
trigger.interaction()now returnsTriggerInteractioninstead of untypedObject. - Migration:
- Inspect with
interaction.isRequest()orinteraction.isResource(). - Access with
interaction.request()orinteraction.resource().
- Inspect with
🚀 Enhancements
- Fluent Turn Factory Methods: Added
Turn.user(String),Turn.user(Content...),Turn.user(List<Content>),Turn.model(String),Turn.model(Content...), andTurn.model(List<Content>). - Full Polymorphic Jackson Deserializers: Added specialized custom Jackson serializers and deserializers for
TurnContentandInteractionInputto transparently handle JSON arrays, objects, and strings. - Documentation: Comprehensive updates across
README.md,AGENTS.md, and the Agent Skill (skills/gemini-interactions-java-api/SKILL.md).
📦 Artifacts Published to Maven Central
io.github.glaforge:gemini-interactions-parent:2.0.1io.github.glaforge:gemini-interactions-api-sdk:2.0.1io.github.glaforge:gemini-interactions-server:2.0.1