iampawan / chatgpt-flutter-aichatbot Goto Github PK
View Code? Open in Web Editor NEWA Chatbot chat app built using the Flutter framework and OpenAI's GPT-3 language model.
A Chatbot chat app built using the Flutter framework and OpenAI's GPT-3 language model.
๐๐ป
This Error got by your recently changes please make it correct
Getting this error when tryin to run
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioError [DioErrorType.receiveTimeout]: Receiving data timeout[5000ms]
E/flutter (15032): Source stack:
E/flutter (15032): #0 DioMixin.fetch (package:dio/src/dio_mixin.dart:488:35)
E/flutter (15032): #1 DioMixin.request (package:dio/src/dio_mixin.dart:483:12)
E/flutter (15032): #2 DioMixin.post (package:dio/src/dio_mixin.dart:97:12)
E/flutter (15032): #3 ChatGPT._completeText (package:chat_gpt_sdk/src/chat_gpt_api.dart:94:11)
E/flutter (15032): #4 ChatGPT.onCompleteStream (package:chat_gpt_sdk/src/chat_gpt_api.dart:86:5)
E/flutter (15032): #5 _ChatScreenState._sendmessage (package:change4/pages/chat_screen.dart:47:10)
E/flutter (15032): #6 _ChatScreenState._buildTextComposer. (package:change4/pages/chat_screen.dart:97:19)
E/flutter (15032): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24)
E/flutter (15032): #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:627:11)
E/flutter (15032): #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:306:5)
E/flutter (15032): #10 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:276:7)
E/flutter (15032): #11 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:163:27)
E/flutter (15032): #12 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:464:20)
E/flutter (15032): #13 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22)
E/flutter (15032): #14 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:337:11)
E/flutter (15032): #15 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7)
E/flutter (15032): #16 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5)
E/flutter (15032): #17 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7)
E/flutter (15032): #18 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7)
E/flutter (15032): #19 _invoke1 (dart:ui/hooks.dart:167:13)
E/flutter (15032): #20 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:341:7)
E/flutter (15032): #21 _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
Error: "The int type cannot be assigned to Duration."
I am fixing it.
Hi! Great work with the app! I have been playing with it and loving it. Btw I think there is a small bug, after the first conversation, every other conversation is repeated, and seems like it depends on the order of the conversation. For example, 2nd conversation is repeated twice, 3rd is repeated thrice, etc. Can you kindly look into it? Again great work! Thanks!
======== Exception caught by widgets library =======================================================
The following _CastError was thrown building Builder:
Null check operator used on a null value
Reloaded 2 of 1103 libraries in 1,676ms (compile: 45 ms, reload: 700 ms, reassemble: 754 ms).
W/1.raster( 8265): type=1400 audit(0.0:77353): avc: denied { search } for name="battery" dev="sysfs" ino=6689 scontext=u:r:untrusted_app:s0:c160,c256,c512,c768 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=dir permissive=0
in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.
Error (Xcode): No file or variants found for asset: .env.
Could not build the application for the simulator.
Error launching application on iPhone 14.
https://drive.google.com/file/d/1GJ2StBeFaa7nieRR0NJCME50PnbO68O2/view?usp=share_link
Users want access to as much AI as they can get, they dont want to manage 50 accounts, they want the fastest AI they want the cheapest AI, and you can provide all of that for them with this update.
in addition to or in place of integrating with any aggregators - Please integrate APIpie so devs can access them all from one place/subscription and plus it also provides:
-The most affordable, reliable and fastest AI available
-One API to access ~500 Models and growing
-Language, embedding, voice, image, vision and more
-Global AI load balancing, route queries based on price or latency
-Redundancy for major models providing the greatest up time possible
-Global reporting of AI availability, pricing and performance
Its the same API format as openai, just change the domain name and your API key and enjoy a plethora of models without changing any of your code other than how you handle the models list.
This is a win win for everyone, any new AI's from any providers will be automatically integrated into your stack with this one integration. Not to mention all the other advantages.
This widget is giving an error at this widget:
void _sendMessage() async {
if (_controller.text.isEmpty) return;
ChatMessage message = ChatMessage(
text: _controller.text,
sender: "user",
isImage: false,
);
setState(() {
_messages.insert(0, message);
_isTyping = true;
});
_controller.clear();
if (_isImageSearch) {
final request = GenerateImage(message.text, 1, size: "256x256");
final response = await chatGPT!.generateImage(request);
Vx.log(response!.data!.last!.url!);
insertNewData(response.data!.last!.url!, isImage: true);
} else {
final request =
CompleteText(prompt: message.text, model: kTranslateModelV3);
final response = await chatGPT!.onCompleteText(request: request);
Vx.log(response!.choices[0].text);
insertNewData(response.choices[0].text, isImage: false);
}
}
This is the error:
[{
"resource": "",
"owner": "generated_diagnostic_collection_name#1",
"code": {
"value": "undefined_method",
"target": {
"$mid": 1,
"path": "/diagnostics/undefined_method",
"scheme": "https",
"authority": "dart.dev"
}
},
"severity": 8,
"message": "The method 'onCompleteText' isn't defined for the type 'OpenAI'.\nTry correcting the name to the name of an existing method, or defining a method named 'onCompleteText'.",
"source": "dart",
"startLineNumber": 68,
"startColumn": 39,
"endLineNumber": 68,
"endColumn": 53
}]
I've been trying to troubleshoot this for a couple of hours. I've tried adding different dependencies, but nothing is working. Would appreciate help. It's literally just the onCompleteText that is giving me an error. I would have thought using the most up-to-date dependency would help but nothing is working.
I put .env file in the project root.I run the project from VSCode and then get FileNotFoundError. I checked the .env file location hundred of times, tried to change the file name, change the location to /lib etc - still no luck. Any idea?
Hi @iampawan,
Is it necessary to have a paid account to use the openai_client.
Because, I am getting an error as mentioned below :-
data:{error: {message: You exceeded your current quota, please check your plan and billing details., type: insufficient_quota, param: null, code: null}}
I tried generating new Api Key twice, but I don't think that is the catch.
Am I missing any changes that needs to be done in the code. Or is it anything else?
I need a solution to this, Any help here, would be appreciated..
Thankyou.
When trying to build an apk i am getting the following errors
Building with sound null safety
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version 1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
C:/Users/sumpt/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version 1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
Running Gradle task 'assembleRelease'... 39.1s
โ Built build\app\outputs\flutter-apk\app-release.apk (18.7MB).
PS C:\Users\sumpt\Desktop\App\new> flutter build apk --build-name=What_Would_Jesus_Say --build-number=1
Building with sound null safety
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)
.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)
.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version 1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.5.30/5fd47535cc85f9e24996f939c2de6583991481b0/kotlin-stdlib-jdk8-1.5.30.jar (version 1.5)
.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.6.10/e1c380673654a089c4f0c9f83d0ddfdc1efdb498/kotlin-stdlib-jdk7-1.6.10.jar (version 1.6)
.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.6.10/b8af3fe6f1ca88526914929add63cf5e7c5049af/kotlin-stdlib-1.6.10.jar (version 1.6)
gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.6.10/c118700e3a33c8a0d9adc920e9dec0831171925/kotlin-stdlib-common-1.6.10.jar (version 1.6)
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath
Running Gradle task 'assembleRelease'... 34.3s
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.