zeebee 1.0.3
zeebee: ^1.0.3 copied to clipboard
A flexible SDK for creating powerful AI chat experiences with multiple language models.
Zeebee #
Zeebee is a flexible SDK for creating powerful AI chat experiences with multiple language models.
Features #
- π Ready-to-use and customizable Chat UI
- π Integration with multiple AI Chat APIs (OpenAI, Anthropic, etc.)
- π¬ Support for rich message formats (text, images, markdown)
- π± Responsive across different screen sizes
- π¨ Easy theme and style customization
- π Secure connections and data handling
Installation #
Add zeebee to your pubspec.yaml:
dependencies:
zeebee: ^latest_version
Or run:
flutter pub add zeebee
Quick Start #
import 'package:flutter/material.dart';
import 'package:zeebee/zeebee.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Zeebee().initialize(apiKey: 'your_api_key_here');
runApp(
Sizer(
builder: (context, orientation, deviceType) {
return GetMaterialApp(
debugShowCheckedModeBanner: false,
initialRoute: AppPages.INITIAL,
getPages: AppPages.routes,
themeMode: ThemeMode.system,
builder: EasyLoading.init(),
);
},
),
);
}
Customization #
UI Customization #
ZeebeeChatView(
theme: ZeebeeChatTheme(
primaryColor: Colors.purple,
backgroundColor: Colors.grey[100],
userBubbleColor: Colors.purple[300],
botBubbleColor: Colors.white,
fontFamily: 'Roboto',
// Additional customization properties
),
// Other properties
)
Using Custom AI Provider #
final customProvider = ZeebeeCustomProvider(
baseUrl: 'https://your-custom-ai-api.com',
headers: {'Authorization': 'Bearer YOUR_TOKEN'},
requestBuilder: (message, options) {
// Build custom request
return {...};
},
responseParser: (response) {
// Parse response
return ZeebeeMessage(...);
},
);
ZeebeeChatView(
chatProvider: ChatProvider.custom,
customProvider: customProvider,
// Other properties
)
API Reference #
Main Classes #
ZeebeeChatView: The main widget to display the chat UIZeebeeMessage: Represents a message in the conversationZeebeeChatController: Controls the state and behavior of the conversationZeebeeChatTheme: Defines the appearance of the chat UIChatProvider: Enum defining supported AI providers
Using the Controller #
final controller = ZeebeeChatController();
ZeebeeChatView(
controller: controller,
// Other properties
)
// Programmatically send a message
controller.sendMessage('Hello!');
// Listen for new messages
controller.messageStream.listen((message) {
print('New message: ${message.content}');
});
// Clear the conversation
controller.clearChat();
Error Handling #
ZeebeeChatView(
onError: (error) {
print('AI Chat error: $error');
// Custom error handling
},
// Other properties
)
Advanced Features #
Saving and Loading Conversations #
// Save conversation
final chatHistory = controller.exportChatHistory();
await saveToStorage(chatHistory);
// Load conversation
final savedHistory = await loadFromStorage();
controller.importChatHistory(savedHistory);
File Upload Support #
ZeebeeChatView(
enableFileUpload: true,
supportedFileTypes: ['png', 'jpg', 'pdf'],
maxFileSize: 5, // MB
onFileUpload: (file) async {
// Process uploaded file
final url = await uploadToServer(file);
return url;
},
// Other properties
)
Contributing #
Contributions are welcome! If you'd like to contribute, please:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License #
This package is distributed under the MIT license. See the LICENSE file for more information.
Contact #
If you have any questions or suggestions, please open an issue on GitHub or contact us at [service@ivita.vn].