atomicbi_flutter_ai 0.9.4
atomicbi_flutter_ai: ^0.9.4 copied to clipboard
A set of AI chat-related widgets for Flutter apps targeting mobile, desktop, and web.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:atomicbi_flutter_ai/atomicbi_flutter_ai.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(const App());
}
final theme = ThemeData(
brightness: Brightness.dark,
primaryColor: const Color(0xff54346b),
colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xff54346b), brightness: Brightness.dark),
textTheme: const TextTheme(
bodyMedium: TextStyle(color: Color(0xffeeeeee), fontSize: 14)
),
tooltipTheme: TooltipThemeData(
textStyle: TextStyle(color: const Color(0xffe9eef8)),
decoration: BoxDecoration(
color: const Color(0xff121721),
border: Border.all(
color: const Color(0xff04070f),
style: BorderStyle.solid,
width: 1
),
borderRadius: BorderRadius.all(Radius.circular(4))
)
),
);
class App extends StatelessWidget {
const App({ super.key });
@override
Widget build(BuildContext context) => MaterialApp(
title: 'Atomic BI AI',
home: const ChatPage(),
theme: theme,
debugShowCheckedModeBanner: false
);
}
final text = '''
<think>
Okay, the user asked, "Who are you?" I need to answer based on the provided knowledge base. Let me check the documents.
Looking at the KnowledgeBase with total 29 documents, but the user hasn't specified which ones. Wait, the user mentioned Document 1 and Document 2 in their example response. Let me refer to those.
Document 1: "Pibo_Assistant_Introduction" explains that I'm Pibo, an AI assistant created to help with research and strategy. My role includes data analysis, generating insights, and collaborating with humans.
Document 2: "Pibo_Capabilities" lists my functions like NLP, data processing, strategic recommendations, and continuous learning. It also mentions integration with tools and adaptability.
I should structure the answer by introducing myself, mentioning my purpose, capabilities, and how I assist. Include references to both documents with the proper tags. Make sure to use markdown without the code block syntax. Check for any other relevant docs, but since the total is 29 but only two are referenced in the example, maybe those are the main ones here. Alright, ready to draft the response.
</think>
I am **Pibo**, an AI-powered assistant designed to support research and strategic decision-making. My primary role is to assist users by analyzing data, generating insights, and providing recommendations to optimize strategies. Here's a brief overview of my capabilities:
1. **Purpose**:
- I help users explore complex problems, identify opportunities, and refine strategies through data-driven analysis.
- I collaborate with humans to enhance decision-making processes.
<ref document-id="1" document-name="Pibo_Assistant_Introduction" fragment-id="1.1" />
2. **Capabilities**:
- **Natural Language Processing (NLP)**: Understand and respond to queries in conversational language.
- **Data Analysis**: Process structured and unstructured data to identify trends and patterns.
- **Strategic Recommendations**: Generate actionable insights for business, technology, or operational strategies.
- **Adaptability**: Continuously learn from interactions to improve accuracy and relevance.
<ref document-id="2" document-name="Pibo_Capabilities" fragment-id="2.3" />
Let me know how I can assist with your research!''';
class ChatPage extends StatelessWidget {
const ChatPage({super.key});
@override
Widget build(BuildContext context) => Scaffold(
body: Container(
constraints: BoxConstraints(minHeight: double.infinity),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [Color(0xff1F122F), Color(0xff121B21)]
)
),
child: LlmChatView(
style: getAtomicBITheme(theme),
onReportCallback: (context, message, text) {
print('report: $text');
},
provider: EchoProvider(
history: [
ChatMessage.llm()..text = 'Hi there',
ChatMessage.user('What is 2 + 2?', []),
ChatMessage.llm()..text = text
]
)
)
)
);
}