fix(ai)!: replace ChatSession class with interface - #10334
Conversation
🦋 Changeset detectedLatest commit: 2f7ed3e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Vertex AI Mock Responses Check
|
Changeset File Check ✅
|
There was a problem hiding this comment.
Code Review
This pull request refactors the @firebase/ai package to export a ChatSession interface instead of a class, removing the ChatSessionBase class from the public API and updating the documentation and API reports accordingly. The feedback highlights that the new ChatSession interface is missing the getHistory() method, which was previously available on the class, and recommends adding it back. Additionally, the reviewer suggests updating the JSDoc of the internal ChatSessionImpl class from @public to @internal and ensuring the API report is updated to include the getHistory() method.
Export a simpler public
ChatSessioninterface representing the properties and methods ofChatSessionthat we want to make public and document. This is a breaking change.This prevents us having to export the
ChatSessionBaseclass and other implementation details of theChatSessionclass that users don't need and just causes clutter in the docs.The only drawback is that users don't have access to the class itself in order to do
instanceofcomparisons, but we are betting that is a rare use case.