Skip to content

Conversation

@DellaBitta
Copy link
Contributor

Discussion

Implement new tools to use Grounding with Google Maps, similar to how Grounding with Google Search works.

Testing

Integration tests.

API Changes

See internal doc: go/fal-maps-grounding-api

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

⚠️ No Changeset found

Latest commit: d89df3c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @DellaBitta, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates Google Maps grounding capabilities into the AI system, enabling models to leverage location-based information for more contextually relevant responses. It introduces new API structures for defining Google Maps tools and handling maps-specific grounding data, alongside mechanisms for providing geographical context in requests. This enhancement allows for richer, location-aware AI interactions.

Highlights

  • New Google Maps API Interfaces: Introduced new interfaces including GoogleMaps, GoogleMapsGroundChunk, and GoogleMapsTool to specifically support Google Maps grounding functionality.
  • Extended Core API Types: Updated existing API types such as Tool, GroundingChunk, GroundingMetadata, and ToolConfig to integrate the new Google Maps capabilities and retrieval configuration.
  • Location and Language Configuration: Added LatLng and RetrievalConfig interfaces, allowing users to specify geographical coordinates and language codes for more precise grounding requests.
  • Comprehensive Integration Tests: Implemented a suite of integration tests to validate Google Maps grounding across various scenarios, including enabling the widget and providing explicit latitude/longitude.
  • Documentation Updates: Updated documentation to reflect the new Google Maps grounding capabilities, including usage requirements and details on the new API structures.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 introduces support for Google Maps Grounding, adding new tools, configurations, and response types. The changes include new API definitions and integration tests to validate the feature. My review focuses on a critical issue with unexported TypeScript interfaces that would break the SDK for consumers, a documentation error, and opportunities to improve the new test code by reducing duplication and removing dead code. Overall, the implementation is solid, and the tests cover the necessary scenarios.

Comment on lines +187 to +222
it('generateContent: google maps grounding prompt location', async () => {
const model = getGenerativeModel(testConfig.ai, {
model: testConfig.model,
generationConfig: commonGenerationConfig,
safetySettings: commonSafetySettings,
tools: [{ googleMaps: {} }]
});

const result = await model.generateContent(
'Where is a good place to grab a coffee near Arlington, MA?'
);
const response = result.response;
const groundingMetadata = response.candidates?.[0].groundingMetadata;
expect(groundingMetadata).to.exist;
expect(
groundingMetadata!.groundingChunks
).to.have.length.greaterThanOrEqual(1);
groundingMetadata!.groundingChunks!.forEach(groundingChunk => {
expect(groundingChunk.maps).to.exist;
expect(groundingChunk.maps!.uri).to.exist;
expect(groundingChunk.maps!.title).to.exist;
expect(groundingChunk.maps!.placeId).to.exist;
});
expect(
groundingMetadata?.groundingSupports
).to.have.length.greaterThanOrEqual(1);
groundingMetadata!.groundingSupports!.forEach(groundingSupport => {
expect(
groundingSupport.groundingChunkIndices
).to.have.length.greaterThanOrEqual(1);
expect(groundingSupport.segment).to.exist;
expect(groundingSupport.segment?.endIndex).to.exist;
expect(groundingSupport.segment?.text).to.exist;
});
expect(groundingMetadata!.googleMapsWidgetContextToken).to.not.exist;
});
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a lot of duplicated code across the new tests for Google Maps grounding. The assertions for groundingMetadata, groundingChunks, and groundingSupports are identical in multiple tests.

To improve maintainability and reduce redundancy, consider extracting this common assertion logic into a helper function. For example:

function assertGoogleMapsGrounding(groundingMetadata: any) {
  expect(groundingMetadata).to.exist;
  expect(
    groundingMetadata.groundingChunks
  ).to.have.length.greaterThanOrEqual(1);
  groundingMetadata.groundingChunks.forEach(groundingChunk => {
    expect(groundingChunk.maps).to.exist;
    expect(groundingChunk.maps.uri).to.exist;
    expect(groundingChunk.maps.title).to.exist;
    expect(groundingChunk.maps.placeId).to.exist;
  });
  expect(
    groundingMetadata.groundingSupports
  ).to.have.length.greaterThanOrEqual(1);
  groundingMetadata.groundingSupports.forEach(groundingSupport => {
    expect(
      groundingSupport.groundingChunkIndices
    ).to.have.length.greaterThanOrEqual(1);
    expect(groundingSupport.segment).to.exist;
    expect(groundingSupport.segment.endIndex).to.exist;
    expect(groundingSupport.segment.text).to.exist;
  });
}

Then each test can simply call assertGoogleMapsGrounding(groundingMetadata);.

@firebase firebase deleted a comment from gemini-code-assist bot Jan 15, 2026
@firebase firebase deleted a comment from gemini-code-assist bot Jan 15, 2026
@firebase firebase deleted a comment from gemini-code-assist bot Jan 15, 2026
@firebase firebase deleted a comment from gemini-code-assist bot Jan 15, 2026
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