Skip to content

Release v2.0.1

Choose a tag to compare

@github-actions github-actions released this 17 Sep 22:02
· 15 commits to main since this release

⚠️ 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 returns TurnContent instead of untyped Object.
  • Migration:
    • For plain text turns, use turn.text() (or turn.content().text()).
    • For multimodal turns, use turn.parts() (or turn.content().parts()).
    • To check the underlying type, use turn.content().isText() or turn.content().isParts().
    • Alternatively, turn.content().value() returns the raw underlying String or List<Content>.

2. InteractionParams.Request.input() returns InteractionInput instead of Object

  • What changed: params.input() on InteractionParams.Request, ModelInteractionParams, and AgentInteractionParams now returns InteractionInput instead of Object.
  • 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()
    • Inspect variant with input.isText(), input.isContents(), input.isTurns(), or input.isSteps().
    • Note: Builder methods (.input(String), .input(Content...), .input(Turn...), .input(Step...), etc.) remain fully supported with convenient overloads.

3. AgentInteractionParams.environment() returns BaseEnvironment instead of Object

  • What changed: params.environment() now returns BaseEnvironment instead of Object.
  • Migration:
    • Preset names (e.g. "remote", "default"): params.environment().preset().
    • Custom environment configs: params.environment().config().
    • Inspect with env.isPreset() or env.isCustom().
    • Or retrieve the underlying value via params.environment().value().

4. Trigger.interaction() returns TriggerInteraction instead of Object

  • What changed: trigger.interaction() now returns TriggerInteraction instead of untyped Object.
  • Migration:
    • Inspect with interaction.isRequest() or interaction.isResource().
    • Access with interaction.request() or interaction.resource().

🚀 Enhancements

  • Fluent Turn Factory Methods: Added Turn.user(String), Turn.user(Content...), Turn.user(List<Content>), Turn.model(String), Turn.model(Content...), and Turn.model(List<Content>).
  • Full Polymorphic Jackson Deserializers: Added specialized custom Jackson serializers and deserializers for TurnContent and InteractionInput to 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.1
  • io.github.glaforge:gemini-interactions-api-sdk:2.0.1
  • io.github.glaforge:gemini-interactions-server:2.0.1