tandem_firebase_ai 0.2.0
tandem_firebase_ai: ^0.2.0 copied to clipboard
Add an AI agent to Flutter screens with Tandem and Firebase AI Logic, without an agent backend. Gemini reads what a screen lists and proposes calls of its methods.
The Firebase order example
uses an existing Tandem screen. Configure Firebase and App Check, then create
one connection outside build:
final connection = FirebaseConnection(
firebase: FirebaseAI.googleAI(),
model: model,
instructions:
'Help the user prepare their order. '
'Describe the result after each change. '
'Only place an order when the user asks you to.',
);
Pass it to TandemScope.connected. The scope still reads the same surface and
uses the same approval UI:
child: TandemScope.connected(
surface: (context) => context.read<OrderCubit>(),
connection: connection,
approvals: const .fromState(),
The screen's methods are the model's tools. Tandem sends their results back to
the model after execution or a user decision. The app supplies the chat through
the scope's child.