Merge pull request #46 from yaso-meth/Feature-Mzansi-AI-Ollama

Feature-Mzansi-AI-Ollama-Docker
This commit is contained in:
yaso-meth
2025-01-23 14:35:29 +02:00
committed by GitHub
7 changed files with 114 additions and 49 deletions

View File

@@ -3,6 +3,7 @@ enum Enviroment { dev, prod }
// //
abstract class AppEnviroment { abstract class AppEnviroment {
static late String baseApiUrl; static late String baseApiUrl;
static late String baseAiUrl;
static late String baseFileUrl; static late String baseFileUrl;
static late String whatsappAccessToken; static late String whatsappAccessToken;
static late String fingerPrintPluginKey; static late String fingerPrintPluginKey;
@@ -13,9 +14,14 @@ abstract class AppEnviroment {
switch (env) { switch (env) {
case Enviroment.dev: case Enviroment.dev:
{ {
baseApiUrl = "http://10.0.2.2:8080"; //Android //================= Android Dev Urls =================
// baseApiUrl = "http://localhost:8080"; //Web baseApiUrl = "http://10.0.2.2:8080";
baseFileUrl = "http://10.0.2.2:9000"; //"http://localhost:9000"; baseFileUrl = "http://10.0.2.2:9000";
baseAiUrl = "http://10.0.2.2:11434";
//================= Web Dev Urls =================
// baseApiUrl = "http://localhost:8080";
// baseFileUrl = "http://localhost:9000";
// baseAiUrl = "http://localhost:11434";
whatsappAccessToken = whatsappAccessToken =
"EAAPINXuNFdYBOzBjTcvZA2iPXEHbHRF9uNXyP3ihkPRUcBqKNru5g9NKRRKkFaiaITEzO3BMo6CjdUmlDH4qYTW2mzDrZB4Q21ZCEZBgECZCu27vfaOXJZCYQLNxwoXkrZBRYv8ZAP37f69r3z9JxLQxdxn9gwqA3oNZAlBBRapJQzxOr6pZBTdI3bbjbu17ZBIwRcF4JCqPDCNLEZCI3bmHwEd2i2niNMYZD"; "EAAPINXuNFdYBOzBjTcvZA2iPXEHbHRF9uNXyP3ihkPRUcBqKNru5g9NKRRKkFaiaITEzO3BMo6CjdUmlDH4qYTW2mzDrZB4Q21ZCEZBgECZCu27vfaOXJZCYQLNxwoXkrZBRYv8ZAP37f69r3z9JxLQxdxn9gwqA3oNZAlBBRapJQzxOr6pZBTdI3bbjbu17ZBIwRcF4JCqPDCNLEZCI3bmHwEd2i2niNMYZD";
//fingerPrintPluginKey = 'h5X7a5j14iUZCobI1ZeX'; //fingerPrintPluginKey = 'h5X7a5j14iUZCobI1ZeX';

View File

@@ -223,29 +223,29 @@ class _MIHHomeState extends State<MIHHome> {
s: getSec(), s: getSec(),
)); ));
} }
// tileList.add(MIHTile( tileList.add(MIHTile(
// videoID: "NUDdoWrbXNc", videoID: "",
// onTap: () { onTap: () {
// Navigator.of(context).pushNamed('/patient-profile', Navigator.of(context).pushNamed(
// arguments: PatientViewArguments( '/mzansi-ai',
// widget.signedInUser, null, null, null, "personal")); );
// }, },
// tileName: "Patient Profile", tileName: "Mzansi AI",
// tileIcon: Center( tileIcon: Center(
// child: FaIcon( child: FaIcon(
// FontAwesomeIcons.bookMedical, FontAwesomeIcons.robot,
// color: getSec(), color: getSec(),
// size: 200, size: 180,
// ), ),
// ), ),
// // Icon( // Icon(
// // Icons.medication, // Icons.medication,
// // color: getSec(), // color: getSec(),
// // size: 200, // size: 200,
// // ), // ),
// p: getPrim(), p: getPrim(),
// s: getSec(), s: getSec(),
// )); ));
tileList.add(MIHTile( tileList.add(MIHTile(
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@@ -269,29 +269,6 @@ class _MIHHomeState extends State<MIHHome> {
p: getPrim(), p: getPrim(),
s: getSec(), s: getSec(),
)); ));
tileList.add(MIHTile(
onTap: () {
Navigator.of(context).pushNamed(
'/access-review',
arguments: widget.signedInUser,
);
},
tileName: "Access",
tileIcon: Center(
child: FaIcon(
FontAwesomeIcons.userCheck,
color: getSec(),
size: 170,
),
),
// Icon(
// Icons.check_box_outlined,
// color: getSec(),
// size: 200,
// ),
p: getPrim(),
s: getSec(),
));
tileList.add(MIHTile( tileList.add(MIHTile(
videoID: "", videoID: "",
@@ -318,6 +295,30 @@ class _MIHHomeState extends State<MIHHome> {
s: getSec(), s: getSec(),
)); ));
tileList.add(MIHTile(
onTap: () {
Navigator.of(context).pushNamed(
'/access-review',
arguments: widget.signedInUser,
);
},
tileName: "Access",
tileIcon: Center(
child: FaIcon(
FontAwesomeIcons.userCheck,
color: getSec(),
size: 170,
),
),
// Icon(
// Icons.check_box_outlined,
// color: getSec(),
// size: 200,
// ),
p: getPrim(),
s: getSec(),
));
tileList.add(MIHTile( tileList.add(MIHTile(
videoID: "hbKhlmY_56U", videoID: "hbKhlmY_56U",
onTap: () { onTap: () {

View File

@@ -294,6 +294,13 @@ class RouteGenerator {
//=============================================================== //===============================================================
//Calculator //Calculator
// case '/mzansi-ai':
// return MaterialPageRoute(
// settings: settings,
// builder: (_) => const MzansiAi(),
// );
case '/package-dev': case '/package-dev':
return MaterialPageRoute( return MaterialPageRoute(
settings: settings, settings: settings,

View File

@@ -321,6 +321,22 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.3.1"
fetch_api:
dependency: transitive
description:
name: fetch_api
sha256: "97f46c25b480aad74f7cc2ad7ccba2c5c6f08d008e68f95c1077286ce243d0e6"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
fetch_client:
dependency: transitive
description:
name: fetch_client
sha256: "9666ee14536778474072245ed5cba07db81ae8eb5de3b7bf4a2d1e2c49696092"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
@@ -448,6 +464,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.8.0" version: "10.8.0"
freezed_annotation:
dependency: transitive
description:
name: freezed_annotation
sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2
url: "https://pub.dev"
source: hosted
version: "2.4.4"
frontend_server_client: frontend_server_client:
dependency: transitive dependency: transitive
description: description:
@@ -760,6 +784,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.3.1" version: "0.3.1"
ollama_dart:
dependency: "direct main"
description:
name: ollama_dart
sha256: "4e40bc499b6fe46ba54a004d2da601c40bd73d66e3f18cf7b03225ccf3d481a6"
url: "https://pub.dev"
source: hosted
version: "0.2.2+1"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:

View File

@@ -69,6 +69,7 @@ dependencies:
fl_downloader: ^2.0.2 fl_downloader: ^2.0.2
local_auth: ^2.3.0 local_auth: ^2.3.0
math_expressions: ^2.6.0 math_expressions: ^2.6.0
ollama_dart: ^0.2.2+1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

1
Mzansi_AI/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
ollama/ollama

View File

@@ -147,6 +147,23 @@ services:
restart: unless-stopped restart: unless-stopped
networks: networks:
- MIH-network - MIH-network
#============== Minio File Storage ====================================================================
ollama:
container_name: MIH-AI
image: ollama/ollama:latest
ports:
- 11434:11434
volumes:
# - ./Mzansi_AI:/code
- ./Mzansi_AI/ollama/ollama:/root/.ollama
pull_policy: always
tty: true
restart: always
environment:
- OLLAMA_KEEP_ALIVE=24h
- OLLAMA_HOST=0.0.0.0
networks:
- MIH-network
#============== Firebaase ==================================================================== #============== Firebaase ====================================================================
# firebase: # firebase:
# container_name: MIH-firebase-emulator # container_name: MIH-firebase-emulator