ace_chat 1.1.0
ace_chat: ^1.1.0 copied to clipboard
A Gemini-powered chatbot UI built with Flutter. Custom knowledge base, bot naming, and theme toggle support.
AceChat #
AceChat is a customizable chatbot UI powered by Gemini AI, built using Flutter. It supports user-provided knowledge bases and dynamic bot names, giving a more personalized and intelligent chat experience—just like talking to a real person!
Features #
- Gemini 1.5 Flash API integration
- Custom knowledge base for responses
- Human-like conversational tone
- Light/Dark theme toggle
- Customizable bot name
- Ready-to-use and easily embeddable
Installation #
Add the package to your pubspec.yaml:
dependencies:
ace_chat: ^1.1.0
Then, fetch the package using:
flutter pub get
Ensure your assets folder contains json data that acts as the source:
flutter:
assets:
- assets/data.json
Usage #
Basic Example #
import 'package:flutter/material.dart';
import 'package:ace_chat/ace.dart';
import 'dart:convert';
import 'package:flutter/services.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Load the JSON knowledge base
final jsonString = await rootBundle.loadString('assets/data.json');
final knowledgeBase = jsonDecode(jsonString);
runApp(MaterialApp(
home: AceChat(
apiKey: 'YOUR_GEMINI_API_KEY',
knowledgeBase: knowledgeBase,
botName: "Helper Bot",
),
));
}
API Documentation #
AceChat #
- Parameters:
apiKey: Gemini API to give natural responses.knowledgeBase: Path to an json data that acts as knowledge.botName: Name of the bot.
License #
MIT License