Skip to content

Conversation

cynthiajoan
Copy link
Collaborator

Description

Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change.

Related Issues

Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (melos run analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@paulb777
Copy link
Member

/gemini summarize

Copy link

Summary of Changes

This pull request enhances the firebase_ai package by integrating new metadata capabilities into the live API responses. It introduces fields for 'grounding metadata' within content responses and 'usage metadata' for overall server responses, providing richer contextual information and metrics for AI interactions. These additions aim to improve the interpretability and utility of the AI model's output.

Highlights

  • Grounding Metadata: Added a new groundingMetadata field to the LiveServerContent class and updated its constructor to include this parameter. This metadata specifies sources used to ground generated content.
  • Usage Metadata: Introduced a new usageMetadata field to the LiveServerResponse class and updated its constructor. This field provides usage metadata about the response(s).
  • Parsing Logic Updates: Modified the parseServerResponse and _parseServerMessage functions to correctly parse and include the new usageMetadata and groundingMetadata fields from incoming JSON objects into their respective LiveServerResponse and LiveServerContent instances.
Changelog
  • packages/firebase_ai/firebase_ai/lib/src/live_api.dart
    • Added groundingMetadata parameter to the LiveServerContent constructor.
    • Introduced a new final GroundingMetadata? groundingMetadata field in the LiveServerContent class.
    • Added usageMetadata parameter to the LiveServerResponse constructor.
    • Introduced a new final UsageMetadata? usageMetadata field in the LiveServerResponse class.
    • Modified parseServerResponse to extract and include usageMetadata when constructing LiveServerResponse objects.
    • Modified _parseServerMessage to extract and include groundingMetadata when constructing LiveServerContent objects.
Activity
  • paulb777 requested a summary of the pull request using the /gemini summarize command.

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.

2 participants