Skip to content

Factor out integration code from example to library, so that client apps can use it and it is test covered here.#435

Merged
polina-c merged 16 commits into
flutter:mainfrom
polina-c:integration-tools
Oct 23, 2025
Merged

Factor out integration code from example to library, so that client apps can use it and it is test covered here.#435
polina-c merged 16 commits into
flutter:mainfrom
polina-c:integration-tools

Conversation

@polina-c

@polina-c polina-c commented Oct 23, 2025

Copy link
Copy Markdown
Collaborator

Contributes to #31

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

Copy link
Copy Markdown
Contributor

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 does a great job of refactoring the backend integration logic out of the example application and into the flutter_genui library. This significantly improves modularity, reusability, and testability. The new helper functions and data models are well-designed. My review focuses on a critical issue of an accidentally committed log file with sensitive data, along with several suggestions to improve code robustness, consistency, and testing practices.

Comment thread examples/simple_chat/firebase-debug.log Outdated
Comment thread packages/flutter_genui/lib/src/facade/direct_call_integration/utils.dart Outdated
Comment thread examples/custom_backend/lib/main.dart Outdated
Comment thread examples/custom_backend/lib/protocol.dart Outdated
Comment thread examples/custom_backend/test/backend_api_test.dart Outdated
polina-c and others added 3 commits October 22, 2025 19:18
…utils.dart

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
}) async {
final techPrompt = genUiTechPrompt([_toolName]);

final toolCall = await Backend.sendRequest(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't the backend be initiating these tool calls? Shouldn't it be something like:

  1. On startup, flutter sends tool declarations and system prompt fragment to the backend
  2. Backend does inferences whenever it wants and sends Gen UI messages back to Flutter

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, it will be closer to what we want

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

updated, thank you for the great suggestion!

Comment thread examples/simple_chat/firebase-debug.log Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's remove this and .gitignore it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

: 'the UI generation tool "${toolNames.first}"';

return '''
To show generated UI to user, use $toolDescription.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Keep in mind that this is being used with a confidential product, so this content is fine, but we won't be able to put product-specific stuff in here e.g. references to the specific catalog items etc.

@polina-c polina-c Oct 23, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure!

The goal here is to construct a prompt that can be used in any app.

@polina-c polina-c merged commit 5c94d89 into flutter:main Oct 23, 2025
14 checks passed
@polina-c polina-c deleted the integration-tools branch October 23, 2025 03:09
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