Skip to content

Conversation

hsubox76
Copy link
Contributor

See API proposal: https://docs.google.com/document/d/1AktXyYVmeyR2L78BImDRh_8DC5YIpR_kuQxfiLFnTXA/edit?tab=t.0 (internal)

  • Adds CodeExecutionTool type that can be sent by the user
  • Adds ExecutableCodePart and CodeExecutionResultPart types that can be returned from the model

All generated documentation is in docs-devsite/ and was copied from the API proposal.

Copy link

changeset-bot bot commented Sep 11, 2025

🦋 Changeset detected

Latest commit: 33bd257

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 11, 2025

Size Report 1

Affected Products

  • @firebase/ai

    TypeBase (06ab5c4)Merge (b05d9f9)Diff
    browser62.2 kB62.4 kB+260 B (+0.4%)
    main65.7 kB66.1 kB+370 B (+0.6%)
    module62.2 kB62.4 kB+260 B (+0.4%)
  • firebase

    TypeBase (06ab5c4)Merge (b05d9f9)Diff
    firebase-ai.js49.1 kB49.3 kB+245 B (+0.5%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/wdssFbVncX.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 11, 2025

Size Analysis Report 1

Affected Products

  • @firebase/ai

    • ChatSession

      Size

      TypeBase (06ab5c4)Merge (b05d9f9)Diff
      size21.6 kB21.6 kB+39 B (+0.2%)
      size-with-ext-deps39.3 kB39.3 kB+39 B (+0.1%)
    • GenerativeModel

      Size

      TypeBase (06ab5c4)Merge (b05d9f9)Diff
      size25.3 kB25.3 kB+39 B (+0.2%)
      size-with-ext-deps43.1 kB43.1 kB+39 B (+0.1%)
    • Language

      Size

      TypeBase (06ab5c4)Merge (b05d9f9)Diff
      size?6.64 kB? (?)
      size-with-ext-deps?24.2 kB? (?)

      Dependency

      TypeBase (06ab5c4)Merge (b05d9f9)Diff
      functions?

      chromeAdapterFactory
      decodeInstanceIdentifier
      factory
      registerAI

      ?
      classes?

      AIError
      AIService
      Backend
      ChromeAdapterImpl
      GoogleAIBackend
      VertexAIBackend

      ?
      variables?

      11 dependencies

      AIErrorCode
      AI_TYPE
      Availability
      BackendType
      DEFAULT_LOCATION
      InferenceMode
      Language
      Task
      logger
      name
      version

      ?
      enums??

      External Dependency

      ModuleBase (06ab5c4)Merge (b05d9f9)Diff
      @firebase/app?

      _registerComponent
      registerVersion

      ?
      @firebase/component?

      Component

      ?
      @firebase/logger?

      Logger

      ?
      @firebase/util?

      FirebaseError

      ?
    • Outcome

      Size

      TypeBase (06ab5c4)Merge (b05d9f9)Diff
      size?6.70 kB? (?)
      size-with-ext-deps?24.3 kB? (?)

      Dependency

      TypeBase (06ab5c4)Merge (b05d9f9)Diff
      functions?

      chromeAdapterFactory
      decodeInstanceIdentifier
      factory
      registerAI

      ?
      classes?

      AIError
      AIService
      Backend
      ChromeAdapterImpl
      GoogleAIBackend
      VertexAIBackend

      ?
      variables?

      11 dependencies

      AIErrorCode
      AI_TYPE
      Availability
      BackendType
      DEFAULT_LOCATION
      InferenceMode
      Outcome
      Task
      logger
      name
      version

      ?
      enums??

      External Dependency

      ModuleBase (06ab5c4)Merge (b05d9f9)Diff
      @firebase/app?

      _registerComponent
      registerVersion

      ?
      @firebase/component?

      Component

      ?
      @firebase/logger?

      Logger

      ?
      @firebase/util?

      FirebaseError

      ?
    • getGenerativeModel

      Size

      TypeBase (06ab5c4)Merge (b05d9f9)Diff
      size25.7 kB25.7 kB+39 B (+0.2%)
      size-with-ext-deps43.5 kB43.5 kB+39 B (+0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/Z2EmPYBnDk.html

'firebase': minor
---

Add Code Execution feature.
Copy link
Contributor

Choose a reason for hiding this comment

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

Added code execution feature


| Property | Type | Description |
| --- | --- | --- |
| [outcome](./ai.codeexecutionresult.md#codeexecutionresultoutcome) | [Outcome](./ai.md#outcome) | The result of the execution. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| [outcome](./ai.codeexecutionresult.md#codeexecutionresultoutcome) | [Outcome](./ai.md#outcome) | The result of the execution. |
| [outcome](./ai.codeexecutionresult.md#codeexecutionresultoutcome) | [Outcome](./ai.md#outcome) | The result of the code execution. |


| Property | Type | Description |
| --- | --- | --- |
| [codeExecution](./ai.codeexecutiontool.md#codeexecutiontoolcodeexecution) | {} | Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. |
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these red highlighted characters? Here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that it's just Github's syntax highlighting becoming confused, the markdown preview looks fine. I think it doesn't like the {} and it becomes confused about seeing | and . characters after it.

Copy link
Contributor

@dlarocque dlarocque left a comment

Choose a reason for hiding this comment

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

Approved but I think we should add some mock response tests and trivial integration tests.

@hsubox76
Copy link
Contributor Author

Approved but I think we should add some mock response tests and trivial integration tests.

There's a mock response test in packages/ai/src/methods/generate-content.test.ts - can add an integration one.

@hsubox76 hsubox76 marked this pull request as ready for review September 12, 2025 16:38
@hsubox76 hsubox76 requested review from a team as code owners September 12, 2025 16:38
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.

5 participants