Skip to content

Conversation

@jacobsimionato
Copy link
Collaborator

These were some first steps I made towards redoing the event logic before I had to stop working today. They're a bit scattered!

  • Rename GenerativeModelWrapper to FirebaseAiGenerativeModel seeing as this is a Firebase AI logic-specific implementation of an interface.
  • Rename DynamicUi to SurfaceWidget seeing as this widget is specifically for displaying an individual surface.
  • Fix a bug in ai_client.dart that was causing capturedResult to be pulled incorrectly resulting in an infinite loop of inferences.
  • Refactor GenerativeModelInterface to remove unused parameters.

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 some great refactoring for clarity, improves logging for LLM inferences, and fixes a critical bug related to parsing model output. My review highlights a syntax error in the new logging code that needs to be fixed and suggests re-adding a removed test to maintain test coverage for the token tracking functionality.

@polina-c
Copy link
Collaborator

polina-c commented Aug 5, 2025

It is very rare that widget names in Flutter contain the word 'Widget'. Instead they contain some word that means something visual, like 'Button' or 'View'.

How about:

  • Surface
  • SurfaceView
  • EphemeralView
  • something else?

@gspencergoog
Copy link
Collaborator

It is very rare that widget names in Flutter contain the word 'Widget'. Instead they contain some word that means something visual, like 'Button' or 'View'.

DynamicSurface?

Copy link
Collaborator

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

I'm going to approve this and submit so we can get the bug fix. We can refine the naming in future PRs.

List<Tool>? tools,
ToolConfig? toolConfig,
}) {
return GenerativeModelWrapper(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I named that so that it could grow into the interface to any generative model. I know it is still specific to Firebase AI Logic right now, but eventually it shouldn't be.

@gspencergoog gspencergoog merged commit 290afa9 into main Aug 5, 2025
3 checks passed
@jacobsimionato jacobsimionato deleted the events branch September 28, 2025 21:51
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.

3 participants