Skip to content

feat!(ai): Remove GroundingAttribution #9079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/slimy-mirrors-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'firebase': major
'@firebase/ai': major
---

Remove GroundingAttribution
14 changes: 0 additions & 14 deletions common/api-review/ai.api.md
Original file line number Diff line number Diff line change
@@ -489,27 +489,13 @@ export interface GoogleSearchTool {
googleSearch: GoogleSearch;
}

// @public @deprecated (undocumented)
export interface GroundingAttribution {
// (undocumented)
confidenceScore?: number;
// (undocumented)
retrievedContext?: RetrievedContextAttribution;
// (undocumented)
segment: Segment;
// (undocumented)
web?: WebAttribution;
}

// @public
export interface GroundingChunk {
web?: WebGroundingChunk;
}

// @public
export interface GroundingMetadata {
// @deprecated (undocumented)
groundingAttributions: GroundingAttribution[];
groundingChunks?: GroundingChunk[];
groundingSupports?: GroundingSupport[];
// @deprecated (undocumented)
2 changes: 0 additions & 2 deletions docs-devsite/_toc.yaml
Original file line number Diff line number Diff line change
@@ -80,8 +80,6 @@ toc:
path: /docs/reference/js/ai.googlesearch.md
- title: GoogleSearchTool
path: /docs/reference/js/ai.googlesearchtool.md
- title: GroundingAttribution
path: /docs/reference/js/ai.groundingattribution.md
- title: GroundingChunk
path: /docs/reference/js/ai.groundingchunk.md
- title: GroundingMetadata
62 changes: 0 additions & 62 deletions docs-devsite/ai.groundingattribution.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs-devsite/ai.groundingmetadata.md
Original file line number Diff line number Diff line change
@@ -26,26 +26,12 @@ export interface GroundingMetadata

| Property | Type | Description |
| --- | --- | --- |
| [groundingAttributions](./ai.groundingmetadata.md#groundingmetadatagroundingattributions) | [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface)<!-- -->\[\] | |
| [groundingChunks](./ai.groundingmetadata.md#groundingmetadatagroundingchunks) | [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface)<!-- -->\[\] | A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response. |
| [groundingSupports](./ai.groundingmetadata.md#groundingmetadatagroundingsupports) | [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface)<!-- -->\[\] | A list of [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) objects. Each object details how specific segments of the model's response are supported by the <code>groundingChunks</code>. |
| [retrievalQueries](./ai.groundingmetadata.md#groundingmetadataretrievalqueries) | string\[\] | |
| [searchEntryPoint](./ai.groundingmetadata.md#groundingmetadatasearchentrypoint) | [SearchEntrypoint](./ai.searchentrypoint.md#searchentrypoint_interface) | Google Search entry point for web searches. This contains an HTML/CSS snippet that must be embedded in an app to display a Google Search entry point for follow-up web searches related to a model's “Grounded Response”. |
| [webSearchQueries](./ai.groundingmetadata.md#groundingmetadatawebsearchqueries) | string\[\] | A list of web search queries that the model performed to gather the grounding information. These can be used to allow users to explore the search results themselves. |

## GroundingMetadata.groundingAttributions

> Warning: This API is now obsolete.
>
> Use [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) instead.
>

<b>Signature:</b>

```typescript
groundingAttributions: GroundingAttribution[];
```

## GroundingMetadata.groundingChunks

A list of [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) objects. Each chunk represents a piece of retrieved content (for example, from a web page). that the model used to ground its response.
1 change: 0 additions & 1 deletion docs-devsite/ai.md
Original file line number Diff line number Diff line change
@@ -96,7 +96,6 @@ The Firebase AI Web SDK.
| [GenerativeContentBlob](./ai.generativecontentblob.md#generativecontentblob_interface) | Interface for sending an image. |
| [GoogleSearch](./ai.googlesearch.md#googlesearch_interface) | Specifies the Google Search configuration. |
| [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface) | A tool that allows a Gemini model to connect to Google Search to access and incorporate up-to-date information from the web into its responses.<!-- -->Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). |
| [GroundingAttribution](./ai.groundingattribution.md#groundingattribution_interface) | |
| [GroundingChunk](./ai.groundingchunk.md#groundingchunk_interface) | Represents a chunk of retrieved data that supports a claim in the model's response. This is part of the grounding information provided when grounding is enabled. |
| [GroundingMetadata](./ai.groundingmetadata.md#groundingmetadata_interface) | Metadata returned when grounding is enabled.<!-- -->Currently, only Grounding with Google Search is supported (see [GoogleSearchTool](./ai.googlesearchtool.md#googlesearchtool_interface)<!-- -->).<!-- -->Important: If using Grounding with Google Search, you are required to comply with the "Grounding with Google Search" usage requirements for your chosen API provider: [Gemini Developer API](https://ai.google.dev/gemini-api/terms#grounding-with-google-search) or Vertex AI Gemini API (see [Service Terms](https://cloud.google.com/terms/service-terms) section within the Service Specific Terms). |
| [GroundingSupport](./ai.groundingsupport.md#groundingsupport_interface) | Provides information about how a specific segment of the model's response is supported by the retrieved grounding chunks. |
15 changes: 0 additions & 15 deletions packages/ai/src/types/responses.ts
Original file line number Diff line number Diff line change
@@ -212,10 +212,6 @@ export interface GroundingMetadata {
* @deprecated Use {@link GroundingSupport} instead.
*/
retrievalQueries?: string[];
/**
* @deprecated Use {@link GroundingChunk} instead.
*/
groundingAttributions: GroundingAttribution[];
}

/**
@@ -334,17 +330,6 @@ export interface Segment {
text: string;
}

/**
* @deprecated
* @public
*/
export interface GroundingAttribution {
segment: Segment;
confidenceScore?: number;
web?: WebAttribution;
retrievedContext?: RetrievedContextAttribution;
}

/**
* @public
*/
Loading
Oops, something went wrong.