Skip to content

Commit b6a0b0b

Browse files
Merge main into release
2 parents 78fc282 + 7bb8c35 commit b6a0b0b

21 files changed

Lines changed: 191 additions & 197 deletions

.changeset/silent-trains-bake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/ai': patch
3+
---
4+
5+
Update code execution and URL context features to reflect that they are generally available and no longer public preview.

.changeset/silly-hounds-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/ai': patch
3+
---
4+
5+
Fix `TemplateChatSession` type so it does not error on TypeScript build. See Github issue #9832.

.github/workflows/combine-prs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Combine PRs
16+
17+
on:
18+
workflow_dispatch: # allows you to manually trigger the workflow
19+
20+
# The minimum permissions required to run this Action
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
checks: read
25+
26+
jobs:
27+
combine-prs:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: combine-prs
32+
id: combine-prs
33+
# This action defaults to combining branches that begin with
34+
# "dependabot" but can be configured.
35+
uses: github/[email protected]
36+
with:
37+
labels: combined-pr # Optional: add a label to the combined PR

common/api-review/ai.api.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export interface CodeExecutionResultPart {
251251
thoughtSignature?: never;
252252
}
253253

254-
// @beta
254+
// @public
255255
export interface CodeExecutionTool {
256256
codeExecution: {};
257257
}
@@ -1389,21 +1389,13 @@ export class StringSchema extends Schema {
13891389
toJSON(): SchemaRequest;
13901390
}
13911391

1392-
// Warning: (ae-incompatible-release-tags) The symbol "TemplateChatSession" is marked as @beta, but its signature references "TemplateRequestInternal" which is marked as @internal
1393-
//
13941392
// @beta
1395-
export class TemplateChatSession extends ChatSessionBase<StartTemplateChatParams, TemplateRequestInternal, TemplateFunctionDeclarationsTool> {
1396-
constructor(apiSettings: ApiSettings, params: StartTemplateChatParams, requestOptions?: RequestOptions | undefined);
1397-
// @internal
1398-
_callGenerateContent(formattedRequest: TemplateRequestInternal, singleRequestOptions?: RequestOptions): Promise<GenerateContentResult>;
1399-
// @internal
1400-
_callGenerateContentStream(formattedRequest: TemplateRequestInternal, singleRequestOptions?: RequestOptions): Promise<GenerateContentStreamResult>;
1401-
// @internal
1402-
_formatRequest(incomingContent: Content, tempHistory: Content[]): TemplateRequestInternal;
1393+
export interface TemplateChatSession {
1394+
getHistory(): Promise<Content[]>;
14031395
// (undocumented)
14041396
params: StartTemplateChatParams;
14051397
// (undocumented)
1406-
requestOptions?: RequestOptions | undefined;
1398+
requestOptions?: RequestOptions;
14071399
sendMessage(request: string | Array<string | Part>, singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentResult>;
14081400
sendMessageStream(request: string | Array<string | Part>, singleRequestOptions?: SingleRequestOptions): Promise<GenerateContentStreamResult>;
14091401
}
@@ -1436,7 +1428,9 @@ export interface TemplateFunctionDeclarationsToolInternal {
14361428
templateFunctions?: TemplateFunctionDeclarationInternal[];
14371429
}
14381430

1439-
// @beta
1431+
// Warning: (ae-internal-missing-underscore) The name "TemplateGenerateContentRequest" should be prefixed with an underscore because the declaration is marked as @internal
1432+
//
1433+
// @internal
14401434
export interface TemplateGenerateContentRequest {
14411435
// (undocumented)
14421436
[key: string]: unknown;
@@ -1520,9 +1514,6 @@ export const ThinkingLevel: {
15201514
// @public
15211515
export type ThinkingLevel = (typeof ThinkingLevel)[keyof typeof ThinkingLevel];
15221516

1523-
// Warning: (ae-incompatible-release-tags) The symbol "Tool" is marked as @public, but its signature references "CodeExecutionTool" which is marked as @beta
1524-
// Warning: (ae-incompatible-release-tags) The symbol "Tool" is marked as @public, but its signature references "URLContextTool" which is marked as @beta
1525-
//
15261517
// @public
15271518
export type Tool = FunctionDeclarationsTool | GoogleSearchTool | CodeExecutionTool | URLContextTool;
15281519

@@ -1540,7 +1531,7 @@ export interface Transcription {
15401531
// @public
15411532
export type TypedSchema = IntegerSchema | NumberSchema | StringSchema | BooleanSchema | ObjectSchema | ArraySchema | AnyOfSchema;
15421533

1543-
// @beta
1534+
// @public
15441535
export interface URLContext {
15451536
}
15461537

@@ -1549,7 +1540,7 @@ export interface URLContextMetadata {
15491540
urlMetadata: URLMetadata[];
15501541
}
15511542

1552-
// @beta
1543+
// @public
15531544
export interface URLContextTool {
15541545
urlContext: URLContext;
15551546
}

docs-devsite/_toc.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ toc:
212212
path: /docs/reference/js/ai.templatefunctiondeclaration.md
213213
- title: TemplateFunctionDeclarationsTool
214214
path: /docs/reference/js/ai.templatefunctiondeclarationstool.md
215-
- title: TemplateGenerateContentRequest
216-
path: /docs/reference/js/ai.templategeneratecontentrequest.md
217215
- title: TemplateGenerativeModel
218216
path: /docs/reference/js/ai.templategenerativemodel.md
219217
- title: TemplateImagenModel

docs-devsite/ai.codeexecutiontool.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

1212
# CodeExecutionTool interface
13-
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
14-
>
15-
1613
A tool that enables the model to use code execution.
1714

1815
<b>Signature:</b>
@@ -25,14 +22,11 @@ export interface CodeExecutionTool
2522

2623
| Property | Type | Description |
2724
| --- | --- | --- |
28-
| [codeExecution](./ai.codeexecutiontool.md#codeexecutiontoolcodeexecution) | {} | <b><i>(Public Preview)</i></b> Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options. |
25+
| [codeExecution](./ai.codeexecutiontool.md#codeexecutiontoolcodeexecution) | {} | Currently, this is an empty object, but it's reserved for future configuration options. |
2926

3027
## CodeExecutionTool.codeExecution
3128

32-
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
33-
>
34-
35-
Specifies the Google Search configuration. Currently, this is an empty object, but it's reserved for future configuration options.
29+
Currently, this is an empty object, but it's reserved for future configuration options.
3630

3731
<b>Signature:</b>
3832

docs-devsite/ai.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ The Firebase AI Web SDK.
5050
| [ObjectSchema](./ai.objectschema.md#objectschema_class) | Schema class for "object" types. The <code>properties</code> param must be a map of <code>Schema</code> objects. |
5151
| [Schema](./ai.schema.md#schema_class) | Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with <code>JSON.stringify()</code> into a JSON string accepted by Vertex AI REST endpoints. (This string conversion is automatically done when calling SDK methods.) |
5252
| [StringSchema](./ai.stringschema.md#stringschema_class) | Schema class for "string" types. Can be used with or without enum values. |
53-
| [TemplateChatSession](./ai.templatechatsession.md#templatechatsession_class) | <b><i>(Public Preview)</i></b> <code>ChatSession</code> class for use with server prompt templates that enables sending chat messages and stores history of sent and received messages so far. |
5453
| [TemplateGenerativeModel](./ai.templategenerativemodel.md#templategenerativemodel_class) | <b><i>(Public Preview)</i></b> [GenerativeModel](./ai.generativemodel.md#generativemodel_class) APIs that execute on a server-side template.<!-- -->This class should only be instantiated with [getTemplateGenerativeModel()](./ai.md#gettemplategenerativemodel_9476bbc)<!-- -->. |
5554
| [TemplateImagenModel](./ai.templateimagenmodel.md#templateimagenmodel_class) | Class for Imagen model APIs that execute on a server-side template.<!-- -->This class should only be instantiated with [getTemplateImagenModel()](./ai.md#gettemplateimagenmodel_9476bbc)<!-- -->. |
5655
| [VertexAIBackend](./ai.vertexaibackend.md#vertexaibackend_class) | Configuration class for the Vertex AI Gemini API.<!-- -->Use this with [AIOptions](./ai.aioptions.md#aioptions_interface) when initializing the AI service via [getAI()](./ai.md#getai_a94a413) to specify the Vertex AI Gemini API as the backend. |
@@ -69,7 +68,7 @@ The Firebase AI Web SDK.
6968
| [CitationMetadata](./ai.citationmetadata.md#citationmetadata_interface) | Citation metadata that may be found on a [GenerateContentCandidate](./ai.generatecontentcandidate.md#generatecontentcandidate_interface)<!-- -->. |
7069
| [CodeExecutionResult](./ai.codeexecutionresult.md#codeexecutionresult_interface) | The results of code execution run by the model. |
7170
| [CodeExecutionResultPart](./ai.codeexecutionresultpart.md#codeexecutionresultpart_interface) | Represents the code execution result from the model. |
72-
| [CodeExecutionTool](./ai.codeexecutiontool.md#codeexecutiontool_interface) | <b><i>(Public Preview)</i></b> A tool that enables the model to use code execution. |
71+
| [CodeExecutionTool](./ai.codeexecutiontool.md#codeexecutiontool_interface) | A tool that enables the model to use code execution. |
7372
| [Content](./ai.content.md#content_interface) | Content type for both prompts and response candidates. |
7473
| [CountTokensRequest](./ai.counttokensrequest.md#counttokensrequest_interface) | Params for calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens) |
7574
| [CountTokensResponse](./ai.counttokensresponse.md#counttokensresponse_interface) | Response from calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens)<!-- -->. |
@@ -141,16 +140,16 @@ The Firebase AI Web SDK.
141140
| [StartAudioConversationOptions](./ai.startaudioconversationoptions.md#startaudioconversationoptions_interface) | <b><i>(Public Preview)</i></b> Options for [startAudioConversation()](./ai.md#startaudioconversation_01c8e7f)<!-- -->. |
142141
| [StartChatParams](./ai.startchatparams.md#startchatparams_interface) | Params for [GenerativeModel.startChat()](./ai.generativemodel.md#generativemodelstartchat)<!-- -->. |
143142
| [StartTemplateChatParams](./ai.starttemplatechatparams.md#starttemplatechatparams_interface) | <b><i>(Public Preview)</i></b> Params for [TemplateGenerativeModel.startChat()](./ai.templategenerativemodel.md#templategenerativemodelstartchat)<!-- -->. |
143+
| [TemplateChatSession](./ai.templatechatsession.md#templatechatsession_interface) | <b><i>(Public Preview)</i></b> Interface representing a <code>ChatSession</code> class for use with server prompt templates that enables sending chat messages and stores history of sent and received messages so far. |
144144
| [TemplateFunctionDeclaration](./ai.templatefunctiondeclaration.md#templatefunctiondeclaration_interface) | <b><i>(Public Preview)</i></b> Structured representation of a template function declaration. Included in this declaration are the function name and parameters. This <code>TemplateFunctionDeclaration</code> is a representation of a block of code that can be used as a Tool by the model and executed by the client. Note: Template function declarations do not support description fields. |
145145
| [TemplateFunctionDeclarationsTool](./ai.templatefunctiondeclarationstool.md#templatefunctiondeclarationstool_interface) | <b><i>(Public Preview)</i></b> A piece of code that enables the system to interact with external systems. |
146-
| [TemplateGenerateContentRequest](./ai.templategeneratecontentrequest.md#templategeneratecontentrequest_interface) | <b><i>(Public Preview)</i></b> Request sent through [TemplateGenerativeModel.generateContent()](./ai.templategenerativemodel.md#templategenerativemodelgeneratecontent) |
147146
| [TextPart](./ai.textpart.md#textpart_interface) | Content part interface if the part represents a text string. |
148147
| [ThinkingConfig](./ai.thinkingconfig.md#thinkingconfig_interface) | Configuration for "thinking" behavior of compatible Gemini models.<!-- -->Certain models utilize a thinking process before generating a response. This allows them to reason through complex problems and plan a more coherent and accurate answer. |
149148
| [ToolConfig](./ai.toolconfig.md#toolconfig_interface) | Tool config. This config is shared for all tools provided in the request. |
150149
| [Transcription](./ai.transcription.md#transcription_interface) | <b><i>(Public Preview)</i></b> Transcription of audio. This can be returned from a [LiveGenerativeModel](./ai.livegenerativemodel.md#livegenerativemodel_class) if transcription is enabled with the <code>inputAudioTranscription</code> or <code>outputAudioTranscription</code> properties on the [LiveGenerationConfig](./ai.livegenerationconfig.md#livegenerationconfig_interface)<!-- -->. |
151-
| [URLContext](./ai.urlcontext.md#urlcontext_interface) | <b><i>(Public Preview)</i></b> Specifies the URL Context configuration. |
150+
| [URLContext](./ai.urlcontext.md#urlcontext_interface) | Specifies the URL Context configuration. |
152151
| [URLContextMetadata](./ai.urlcontextmetadata.md#urlcontextmetadata_interface) | Metadata related to [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface)<!-- -->. |
153-
| [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) | <b><i>(Public Preview)</i></b> A tool that allows you to provide additional context to the models in the form of public web URLs. By including URLs in your request, the Gemini model will access the content from those pages to inform and enhance its response. |
152+
| [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) | A tool that allows you to provide additional context to the models in the form of public web URLs. By including URLs in your request, the Gemini model will access the content from those pages to inform and enhance its response. |
154153
| [URLMetadata](./ai.urlmetadata.md#urlmetadata_interface) | Metadata for a single URL retrieved by the [URLContextTool](./ai.urlcontexttool.md#urlcontexttool_interface) tool. |
155154
| [UsageMetadata](./ai.usagemetadata.md#usagemetadata_interface) | Usage metadata about a [GenerateContentResponse](./ai.generatecontentresponse.md#generatecontentresponse_interface)<!-- -->. |
156155
| [VideoMetadata](./ai.videometadata.md#videometadata_interface) | Describes the input video content. |

docs-devsite/ai.templatechatsession.md

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,81 +9,70 @@ overwritten. Changes should be made in the source code at
99
https://github.com/firebase/firebase-js-sdk
1010
{% endcomment %}
1111

12-
# TemplateChatSession class
12+
# TemplateChatSession interface
1313
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
1414
>
1515
16-
`ChatSession` class for use with server prompt templates that enables sending chat messages and stores history of sent and received messages so far.
16+
Interface representing a `ChatSession` class for use with server prompt templates that enables sending chat messages and stores history of sent and received messages so far.
1717

1818
<b>Signature:</b>
1919

2020
```typescript
21-
export declare class TemplateChatSession extends ChatSessionBase<StartTemplateChatParams, TemplateRequestInternal, TemplateFunctionDeclarationsTool>
21+
export interface TemplateChatSession
2222
```
23-
<b>Extends:</b> [ChatSessionBase](./ai.chatsessionbase.md#chatsessionbase_class)<!-- -->&lt;[StartTemplateChatParams](./ai.starttemplatechatparams.md#starttemplatechatparams_interface)<!-- -->, TemplateRequestInternal, [TemplateFunctionDeclarationsTool](./ai.templatefunctiondeclarationstool.md#templatefunctiondeclarationstool_interface)<!-- -->&gt;
24-
25-
## Constructors
26-
27-
| Constructor | Modifiers | Description |
28-
| --- | --- | --- |
29-
| [(constructor)(apiSettings, params, requestOptions)](./ai.templatechatsession.md#templatechatsessionconstructor) | | <b><i>(Public Preview)</i></b> Constructs a new instance of the <code>TemplateChatSession</code> class |
3023

3124
## Properties
3225

33-
| Property | Modifiers | Type | Description |
34-
| --- | --- | --- | --- |
35-
| [params](./ai.templatechatsession.md#templatechatsessionparams) | | [StartTemplateChatParams](./ai.starttemplatechatparams.md#starttemplatechatparams_interface) | <b><i>(Public Preview)</i></b> |
36-
| [requestOptions](./ai.templatechatsession.md#templatechatsessionrequestoptions) | | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | <b><i>(Public Preview)</i></b> |
26+
| Property | Type | Description |
27+
| --- | --- | --- |
28+
| [params](./ai.templatechatsession.md#templatechatsessionparams) | [StartTemplateChatParams](./ai.starttemplatechatparams.md#starttemplatechatparams_interface) | <b><i>(Public Preview)</i></b> |
29+
| [requestOptions](./ai.templatechatsession.md#templatechatsessionrequestoptions) | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) | <b><i>(Public Preview)</i></b> |
3730

3831
## Methods
3932

40-
| Method | Modifiers | Description |
41-
| --- | --- | --- |
42-
| [sendMessage(request, singleRequestOptions)](./ai.templatechatsession.md#templatechatsessionsendmessage) | | <b><i>(Public Preview)</i></b> Sends a chat message and receives a non-streaming [GenerateContentResult](./ai.generatecontentresult.md#generatecontentresult_interface) |
43-
| [sendMessageStream(request, singleRequestOptions)](./ai.templatechatsession.md#templatechatsessionsendmessagestream) | | <b><i>(Public Preview)</i></b> Sends a chat message and receives the response as a [GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. |
33+
| Method | Description |
34+
| --- | --- |
35+
| [getHistory()](./ai.templatechatsession.md#templatechatsessiongethistory) | <b><i>(Public Preview)</i></b> Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. |
36+
| [sendMessage(request, singleRequestOptions)](./ai.templatechatsession.md#templatechatsessionsendmessage) | <b><i>(Public Preview)</i></b> Sends a chat message and receives a non-streaming [GenerateContentResult](./ai.generatecontentresult.md#generatecontentresult_interface) |
37+
| [sendMessageStream(request, singleRequestOptions)](./ai.templatechatsession.md#templatechatsessionsendmessagestream) | <b><i>(Public Preview)</i></b> Sends a chat message and receives the response as a [GenerateContentStreamResult](./ai.generatecontentstreamresult.md#generatecontentstreamresult_interface) containing an iterable stream and a response promise. |
4438

45-
## TemplateChatSession.(constructor)
39+
## TemplateChatSession.params
4640

4741
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
4842
>
4943

50-
Constructs a new instance of the `TemplateChatSession` class
51-
5244
<b>Signature:</b>
5345

5446
```typescript
55-
constructor(apiSettings: ApiSettings, params: StartTemplateChatParams, requestOptions?: RequestOptions | undefined);
47+
params: StartTemplateChatParams;
5648
```
5749

58-
#### Parameters
59-
60-
| Parameter | Type | Description |
61-
| --- | --- | --- |
62-
| apiSettings | ApiSettings | |
63-
| params | [StartTemplateChatParams](./ai.starttemplatechatparams.md#starttemplatechatparams_interface) | |
64-
| requestOptions | [RequestOptions](./ai.requestoptions.md#requestoptions_interface) \| undefined | |
65-
66-
## TemplateChatSession.params
50+
## TemplateChatSession.requestOptions
6751

6852
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
6953
>
7054

7155
<b>Signature:</b>
7256

7357
```typescript
74-
params: StartTemplateChatParams;
58+
requestOptions?: RequestOptions;
7559
```
7660

77-
## TemplateChatSession.requestOptions
61+
## TemplateChatSession.getHistory()
7862

7963
> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8064
>
8165

66+
Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history.
67+
8268
<b>Signature:</b>
8369

8470
```typescript
85-
requestOptions?: RequestOptions | undefined;
71+
getHistory(): Promise<Content[]>;
8672
```
73+
<b>Returns:</b>
74+
75+
Promise&lt;[Content](./ai.content.md#content_interface)<!-- -->\[\]&gt;
8776

8877
## TemplateChatSession.sendMessage()
8978

0 commit comments

Comments
 (0)