diff --git a/.metadata b/.metadata index 8e6bd3b..9c042f2 100644 --- a/.metadata +++ b/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled. version: - revision: 135454af32477f815a7525073027a3ff9eff1bfd + revision: 2ad6cd72c040113b47ee9055e722606a490ef0da channel: stable project_type: app @@ -13,17 +13,11 @@ project_type: app migration: platforms: - platform: root - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd - - platform: android - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da + base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da - platform: linux - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd - - platform: web - create_revision: 135454af32477f815a7525073027a3ff9eff1bfd - base_revision: 135454af32477f815a7525073027a3ff9eff1bfd + create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da + base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da # User provided section diff --git a/lib/riverpods/openai.dart b/lib/riverpods/openai.dart index 8a59614..6ae8eee 100644 --- a/lib/riverpods/openai.dart +++ b/lib/riverpods/openai.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:bogui/global.dart'; import 'package:bogui/load_env.dart'; import 'package:flutter/foundation.dart'; @@ -38,9 +40,9 @@ class OpenAI { } catch (e) { log.d(e); ref.read(prompt).text += - "\nJe n'ai pas la bonne clé API secret pour OpenAI, connard."; + "\nJe n'ai pas la bonne clé API secret pour OpenAI, connard.\n$e"; ref.read(isLoading.notifier).state = false; - return "\nJe n'ai pas la bonne clé API secret pour OpenAI, connard."; + return "\nJe n'ai pas la bonne clé API secret pour OpenAI, connard.\n$e"; } String anwserString = ''; @@ -48,7 +50,7 @@ class OpenAI { anwserString += choice.text; } - ref.read(prompt).text += anwserString; + ref.read(prompt).text += utf8.decode(anwserString.codeUnits); ref.read(isLoading.notifier).state = false; ref.read(prompt).selection = TextSelection.fromPosition( TextPosition(offset: ref.read(prompt).text.length)); diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 0daaab2..6cc4df0 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -109,11 +109,21 @@ class _BoguiState extends ConsumerState { child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ Spacer(flex: screenWidth > 800 ? 3 : 2), + Column( + children: [ + IconButton( + onPressed: () => ref.read(gpt.prompt).text = '', + icon: const Icon(Icons.close), + color: Colors.redAccent, + ), + const SizedBox(height: 120) + ], + ), Column(children: [ const SizedBox(height: 40), Container( constraints: - const BoxConstraints(minWidth: 500, maxWidth: 700), + const BoxConstraints(minWidth: 300, maxWidth: 700), width: screenWidth - 600, child: CallbackShortcuts( bindings: { diff --git a/pubspec.lock b/pubspec.lock index 6eee0f2..52811f1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: @@ -37,18 +37,18 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.6" fake_async: dependency: transitive description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: ffi - sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.0" flutter: dependency: "direct main" description: flutter @@ -74,26 +74,26 @@ packages: dependency: "direct main" description: name: flutter_hooks - sha256: "2b202559a4ed3656bbb7aae9d8b335fb0037b23acc7ae3f377d1ba0b95c21aec" + sha256: "6a126f703b89499818d73305e4ce1e3de33b4ae1c5512e3b8eab4b986f46774c" url: "https://pub.dev" source: hosted - version: "0.18.5+1" + version: "0.18.6" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3" flutter_riverpod: dependency: "direct main" description: name: flutter_riverpod - sha256: "46a27b7a11dc13738054093076f2dc65692ddcd463979b15092accf5681aea20" + sha256: "49b55e8a467229eedb801bd0864baa7f891c39cc00f790189ba8479e9ad0fa06" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.6" flutter_test: dependency: "direct dev" description: flutter @@ -108,10 +108,10 @@ packages: dependency: transitive description: name: http - sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "0.13.6" http_parser: dependency: transitive description: @@ -120,79 +120,71 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - js: - dependency: transitive - description: - name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" - url: "https://pub.dev" - source: hosted - version: "0.6.5" json_annotation: dependency: transitive description: name: json_annotation - sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.8.1" lints: dependency: transitive description: name: lints - sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.1" logger: dependency: "direct main" description: name: logger - sha256: "5076f09225f91dc49289a4ccb92df2eeea9ea01cf7c26d49b3a1f04c6a49eec1" + sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.4.0" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" openai_gpt3_api: dependency: "direct main" description: path: "." ref: main - resolved-ref: "0b07e51d541375213b8232542f0911cbbe9e4ac4" - url: "https://github.com/morriskurz/openai_gpt3_dart_api.git" + resolved-ref: "0145d03a2367547bbb6811634f931d65105bfdb0" + url: "https://github.com/Aditya-Khadilkar/openai_gpt3_dart_api" source: git version: "0.1.3" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: "8df5ab0a481d7dc20c0e63809e90a588e496d276ba53358afc4c4443d0a00697" + sha256: "10259b111176fba5c505b102e3a5b022b51dd97e30522e906d6922c745584745" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.1.2" package_info_plus_platform_interface: dependency: transitive description: @@ -205,26 +197,26 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.7" riverpod: dependency: transitive description: name: riverpod - sha256: "59a48de9c757aa61aa28e9fd625ffb360d43b6b54606f12536622c55be9e8c4b" + sha256: "01fa385aa5d6db42fd602d8c400c28ae1c83d1fd6fbae1cbf0f4c78bac58d4b2" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.6" sky_engine: dependency: transitive description: flutter @@ -234,10 +226,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -250,10 +242,10 @@ packages: dependency: transitive description: name: state_notifier - sha256: "8fe42610f179b843b12371e40db58c9444f8757f8b69d181c97e50787caed289" + sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb url: "https://pub.dev" source: hosted - version: "0.7.2+1" + version: "1.0.0" stream_channel: dependency: transitive description: @@ -282,82 +274,82 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.6.0" typed_data: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: e8f2efc804810c0f2f5b485f49e7942179f56eabcfe81dce3387fec4bb55876b + sha256: b1c9e98774adf8820c96fbc7ae3601231d324a7d5ebd8babe27b6dfac91357ba url: "https://pub.dev" source: hosted - version: "6.1.9" + version: "6.2.1" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1" + sha256: "31222ffb0063171b526d3e569079cf1f8b294075ba323443fdc690842bfd4def" url: "https://pub.dev" source: hosted - version: "6.0.23" + version: "6.2.0" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "0a5af0aefdd8cf820dd739886efb1637f1f24489900204f50984634c07a54815" + sha256: bba3373219b7abb6b5e0d071b0fe66dfbe005d07517a68e38d4fc3638f35c6d3 url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.2.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc" + sha256: "9f2d390e096fdbe1e6e6256f97851e51afc2d9c423d3432f1d6a02a8a9a8b9fd" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" + sha256: "980e8d9af422f477be6948bdfb68df8433be71f5743a188968b0c1b887807e50" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.2.0" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0" + sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2" url: "https://pub.dev" source: hosted - version: "2.0.14" + version: "2.2.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: b6217370f8eb1fd85c8890c539f5a639a01ab209a36db82c921ebeacefc7a615 + sha256: "7754a1ad30ee896b265f8d14078b0513a4dba28d358eabb9d5f339886f4a1adc" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.1.0" vector_math: dependency: transitive description: @@ -366,14 +358,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" win32: dependency: transitive description: name: win32 - sha256: "5cdbe09a75b5f4517adf213c68aaf53ffa162fadf54ba16f663f94f3d2664a56" + sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.1.4" sdks: - dart: ">=2.18.6 <3.0.0" - flutter: ">=3.3.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" diff --git a/pubspec.yaml b/pubspec.yaml index 13958d7..c6cc876 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,12 +3,12 @@ description: Qu'ils aillent tous se faire enculer. # The following line prevents the package from being accidentally published to # pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev -version: 0.0.2+3 +version: 0.0.2+4 environment: - sdk: '>=2.18.6 <3.0.0' + sdk: ">=2.18.6 <3.0.0" dependencies: flutter: @@ -16,20 +16,19 @@ dependencies: cupertino_icons: ^1.0.2 openai_gpt3_api: # ^0.1.3 git: - url: https://github.com/morriskurz/openai_gpt3_dart_api.git + url: https://github.com/Aditya-Khadilkar/openai_gpt3_dart_api ref: main flutter_hooks: ^0.18.0 flutter_riverpod: ^2.1.3 logger: ^1.1.0 - url_launcher: + url_launcher: package_info_plus: ^3.0.2 dev_dependencies: flutter_test: sdk: flutter - - flutter_lints: ^2.0.0 + flutter_lints: ^2.0.0 flutter: uses-material-design: true diff --git a/scripts/publish.sh b/scripts/publish.sh index 147e9e1..3bbd1b8 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -9,10 +9,10 @@ flutter clean && flutter pub get if [[ $2 == "html" ]]; then rm -rf /home/poka/dev/bogui/build/web && flutter build web --web-renderer html --dart-define=OPENAPI_SECRET_KEY=${OPENAI_SECRET_KEY} - ssh -p 10322 poka@p2p.legal 'rm -rf /home/poka/bogui-html && mkdir /home/poka/bogui-html' - rs /home/poka/dev/bogui/build/web poka@p2p.legal:/home/poka/bogui-html/ 10322 + ssh -p 10422 poka@192.168.1.69 'rm -rf /home/poka/bogui-html && mkdir /home/poka/bogui-html' + rs /home/poka/dev/bogui/build/web poka@192.168.1.69:/home/poka/bogui-html/ 10422 else rm -rf /home/poka/dev/bogui/build/web && flutter build web --web-renderer canvaskit --dart-define=OPENAPI_SECRET_KEY=${OPENAI_SECRET_KEY} - ssh -p 10322 poka@p2p.legal 'rm -rf /home/poka/bogui && mkdir /home/poka/bogui' - rs /home/poka/dev/bogui/build/web poka@p2p.legal:/home/poka/bogui/ 10322 + ssh -p 10422 poka@192.168.1.69 'rm -rf /home/poka/bogui && mkdir /home/poka/bogui' + rs /home/poka/dev/bogui/build/web poka@192.168.1.69:/home/poka/bogui/ 10422 fi