genkit_firebase_ai 0.0.1-dev.1 copy "genkit_firebase_ai: ^0.0.1-dev.1" to clipboard
genkit_firebase_ai: ^0.0.1-dev.1 copied to clipboard

Firebase AI plugin for Genkit Dart.

Pub

Firebase AI plugin for Genkit Dart.

Usage #

import 'package:genkit/genkit.dart';
import 'package:genkit_firebase_ai/genkit_firebase_ai.dart';

void main() async {
  // Initialize Genkit with the Firebase AI plugin
  final ai = Genkit(plugins: [firebaseAI()]);

  // Generate text
  final response = await ai.generate(
    model: firebaseAI.gemini('gemini-2.5-flash'),
    prompt: 'Tell me a joke about a developer.',
  );

  print(response.text);
}

Tool Calling #

// Define a tool
ai.defineTool(
  name: 'getWeather',
  description: 'Get the weather for a location',
  inputSchema: WeatherToolInput.$schema,
  fn: (input, context) async {
    return 'The weather in ${input.location} is 75 and sunny.';
  },
);

// Generate with tools
final response = await ai.generate(
  model: firebaseAI.gemini('gemini-2.5-flash'),
  prompt: 'What is the weather in Boston?',
  tools: ['getWeather'],
);
0
likes
130
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

Firebase AI plugin for Genkit Dart.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

firebase_ai, firebase_core, genkit, json_annotation, logging, meta, schemantic

More

Packages that depend on genkit_firebase_ai