iampawan / ChatGPT-Flutter-AIChatBot

A Chatbot chat app built using the Flutter framework and OpenAI's GPT-3 language model.
245 stars 105 forks source link

env file name #13

Open mridul2620 opened 1 year ago

mridul2620 commented 1 year ago

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

Rahul0714 commented 1 year ago

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

Try adding flutter_dotenv: ^5.0.2 in pubspec.yaml file, it will work

ALIRAZANOMI commented 1 year ago

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

i am facing the same error have you solved it?

SHOAIBAHMED12842 commented 1 year ago

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

Try adding flutter_dotenv: ^5.0.2 in pubspec.yaml file, it will work

It did not solve the error.

SHOAIBAHMED12842 commented 1 year ago

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

Try adding flutter_dotenv: ^5.0.2 in pubspec.yaml file, it will work

Is .env file will be in root folder is it empty or something present in the file?

ji4a commented 1 year ago

Its empty. file is missing. user needs to update his repo

mohitrajsinha commented 1 year ago

.env file is missing

Memie1 commented 1 year ago

You just need to make your own with your own API_KEY

nyck33 commented 1 year ago

@Memie1 can you put some examples or links to urls that show how? https://codewithandrea.com/articles/flutter-api-keys-dart-define-env-files/ It seems more involved than you make it out to be but is there a short cut?

Memie1 commented 1 year ago

@Memie1 can you put some examples or links to urls that show how? https://codewithandrea.com/articles/flutter-api-keys-dart-define-env-files/ It seems more involved than you make it out to be but is there a short cut?

Most of this code already does most of this work. From what I remember.

Basically, it's as simple as creating a file called '.env' alongside your pubspec.yaml and then taking your api key from the open ai website. Then write just this one line in that file:

API_KEY="YOUR_API_KEY"

In terms of links on how to do it, idk if I can find any that would actually be helpful. I'd say it's just a matter of if you've ever worked with .env files before, then it's fairly straightforward because the code from this project itself already does all the work of calling for the .env file for you, you just need to make that .env file.

If you're making the project from scratch, though, I wish you the best of luck because that's a bit beyond me.

nyck33 commented 1 year ago

Thanks! @Memie1 It worked!
I did not see license but am I free to refactor it to get the UI the way I want then to commercialize this if the opportunity comes up?