-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throwing exception #4
Comments
I just found this package and now I came across this same issue, it happens because there is a little mistake in the flutter_chatgpt_api.dart file (the defaultUserAgent variable is used instead of the user agent the user specified). To fix it replace the contents of that file with the following code:
|
Don't forget that instead of using the package from pub.dev you should download the code and place it in the packages folder (in Linux is /home/youruser/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/ if you installed flutter with snap, if not don't worry the route is very similar, look it up online), edit the file I told you, add the dependency to your |
Then in your code initialize the api like this:
The user agent must match with the one used in the session from where the sessionToken and clearanceToken where extracted. |
same issue |
Hi @itsalfredakku @csc7545 @Gabriel11101 , first of all, thank you for using the package, I haven't had time to solve the problem due to my busy schedule. I will fix it asap. pull requests are welcome :) |
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)]
Unhandled Exception: Exception: ChatGPT failed to refresh auth token: Exception: Failed to refresh access token
#0 ChatGPTApi._refreshAccessToken (package:flutter_chatgpt_api/flutter_chatgpt_api.dart:152:7)
#1 ChatGPTApi.sendMessage (package:flutter_chatgpt_api/flutter_chatgpt_api.dart:50:25)
#2 _ChatScreenState._buildSubmit. (package:neural_ai/screens/chat.screen.dart:110:30)
The text was updated successfully, but these errors were encountered: