From b8d9b3343e2f18f58ea1ce6340de29cf42d53371 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 7 May 2026 11:52:30 +0300 Subject: [PATCH] Update: 2026-05-07 11:52:29 --- app/modules_app/voice/grok_intent.php | 2 +- .../controllers/dashboard_controller.dart | 14 ++++- musadaq-app/pubspec.lock | 56 ------------------- musadaq-app/pubspec.yaml | 1 - 4 files changed, 12 insertions(+), 61 deletions(-) diff --git a/app/modules_app/voice/grok_intent.php b/app/modules_app/voice/grok_intent.php index 63337ea..714a6c4 100644 --- a/app/modules_app/voice/grok_intent.php +++ b/app/modules_app/voice/grok_intent.php @@ -54,7 +54,7 @@ $systemPrompt = << 'grok-beta', // Update to current xAI model name + 'model' => 'grok-2-1212', // Updated to current xAI model name 'messages' => [ ['role' => 'system', 'content' => $systemPrompt], ['role' => 'user', 'content' => $text] diff --git a/musadaq-app/lib/features/dashboard/controllers/dashboard_controller.dart b/musadaq-app/lib/features/dashboard/controllers/dashboard_controller.dart index 2773c29..a6f213f 100644 --- a/musadaq-app/lib/features/dashboard/controllers/dashboard_controller.dart +++ b/musadaq-app/lib/features/dashboard/controllers/dashboard_controller.dart @@ -87,7 +87,7 @@ class DashboardController extends GetxController { Container( width: 40, height: 4, - margin: const EdgeInsets.bottom(20), + margin: const EdgeInsets.only(bottom: 20), decoration: BoxDecoration( color: Colors.grey.withOpacity(0.3), borderRadius: BorderRadius.circular(2)), @@ -171,10 +171,18 @@ class DashboardController extends GetxController { AppSnackbar.showError( 'خطأ', response.data['message'] ?? 'فشل تحليل الطلب'); } + } on DioException catch (e) { + AppLogger.error('Voice Assistant Error', e); + String errorMsg = 'حدث خطأ أثناء التواصل مع خادم الذكاء الاصطناعي'; + if (e.response != null && e.response?.data != null) { + if (e.response?.data is Map && e.response?.data['message'] != null) { + errorMsg = e.response?.data['message']; + } + } + AppSnackbar.showError('خطأ', errorMsg); } catch (e) { AppLogger.error('Voice Assistant Error', e); - AppSnackbar.showError( - 'خطأ', 'حدث خطأ أثناء التواصل مع خادم الذكاء الاصطناعي'); + AppSnackbar.showError('خطأ', 'حدث خطأ غير متوقع'); } } diff --git a/musadaq-app/pubspec.lock b/musadaq-app/pubspec.lock index c91d2cc..1ba59f6 100644 --- a/musadaq-app/pubspec.lock +++ b/musadaq-app/pubspec.lock @@ -1136,62 +1136,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" - record: - dependency: "direct main" - description: - name: record - sha256: "2e3d56d196abcd69f1046339b75e5f3855b2406fc087e5991f6703f188aa03a6" - url: "https://pub.dev" - source: hosted - version: "5.2.1" - record_android: - dependency: transitive - description: - name: record_android - sha256: "94783f08403aed33ffb68797bf0715b0812eb852f3c7985644c945faea462ba1" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - record_darwin: - dependency: transitive - description: - name: record_darwin - sha256: e487eccb19d82a9a39cd0126945cfc47b9986e0df211734e2788c95e3f63c82c - url: "https://pub.dev" - source: hosted - version: "1.2.2" - record_linux: - dependency: transitive - description: - name: record_linux - sha256: "74d41a9ebb1eb498a38e9a813dd524e8f0b4fdd627270bda9756f437b110a3e3" - url: "https://pub.dev" - source: hosted - version: "0.7.2" - record_platform_interface: - dependency: transitive - description: - name: record_platform_interface - sha256: "8a81dbc4e14e1272a285bbfef6c9136d070a47d9b0d1f40aa6193516253ee2f6" - url: "https://pub.dev" - source: hosted - version: "1.5.0" - record_web: - dependency: transitive - description: - name: record_web - sha256: "7e9846981c1f2d111d86f0ae3309071f5bba8b624d1c977316706f08fc31d16d" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - record_windows: - dependency: transitive - description: - name: record_windows - sha256: "223258060a1d25c62bae18282c16783f28581ec19401d17e56b5205b9f039d78" - url: "https://pub.dev" - source: hosted - version: "1.0.7" rxdart: dependency: transitive description: diff --git a/musadaq-app/pubspec.yaml b/musadaq-app/pubspec.yaml index 23315a2..61a9407 100644 --- a/musadaq-app/pubspec.yaml +++ b/musadaq-app/pubspec.yaml @@ -41,7 +41,6 @@ dependencies: printing: ^5.12.0 # ─── Voice & Audio ────────────────────────────────── - record: ^5.1.0 speech_to_text: ^7.3.0 permission_handler: ^11.3.0