Skip to content

fix(ai)!: replace ChatSession class with interface - #10334

Draft
hsubox76 wants to merge 4 commits into
mainfrom
ch-chat-interface
Draft

fix(ai)!: replace ChatSession class with interface#10334
hsubox76 wants to merge 4 commits into
mainfrom
ch-chat-interface

Conversation

@hsubox76

Copy link
Copy Markdown
Contributor

Export a simpler public ChatSession interface representing the properties and methods of ChatSession that we want to make public and document. This is a breaking change.

This prevents us having to export the ChatSessionBase class and other implementation details of the ChatSession class 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 instanceof comparisons, but we are betting that is a rare use case.

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f7ed3e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@firebase/ai Minor
firebase Minor

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

@github-actions

Copy link
Copy Markdown
Contributor

Vertex AI Mock Responses Check ⚠️

A newer major version of the mock responses for Vertex AI unit tests is available. update_vertexai_responses.sh should be updated to clone the latest version of the responses: v17.0

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/ai/src/public-types.ts
Comment thread packages/ai/src/methods/chat-session.ts
Comment thread common/api-review/ai.api.md
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.

1 participant