You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Public API to initialize Chat with history #819
Currently, the Chat API in google-genai (Java SDK) does not expose a way to initialize a Chat session with an existing history of messages (e.g., loaded from persistent storage).
When reloading a session from disk (e.g. JSON/YAML), developers currently have to work around this limitation by either:
Re-sending all previous messages to the model, which is slow and consumes tokens.
Using reflection to manually populate the private comprehensiveHistory and curatedHistory fields in ChatBase, which is fragile and not recommended.
It would be very beneficial to have a public API (e.g., an overload of Chats.create() or a builder method) that accepts an initial List<Content> to restore the conversation state.
Hi @vorburger, Thanks for raising this Feature request. After reviewing the current java-genai SDK documentation and source code, there is no public API available to initialize a Chat instance with pre-existing history. we'll be filing a feature request to track this internally.
Activity
hemasekhar-p commentedon Feb 11, 2026
Hi @vorburger, Thanks for raising this Feature request. After reviewing the current java-genai SDK documentation and source code, there is no public API available to initialize a Chat instance with pre-existing history. we'll be filing a feature request to track this internally.
vorburger commentedon Oct 4, 2026
This might not actually be required anymore with the Interactions API... I'm looking into whether I'll close this.
@hemasekhar-p do you want to assign this issue to me?
vorburger commentedon Oct 8, 2026
With the move to the Interactions API, this isn't really required anymore; I'm therefore closing this.