Find answers from the community

Updated last year

Tutorial

I am doing the tutorial
W
S
33 comments
Have you passed your OPENAI key somewhere?
You need to pass openai key like this

Plain Text
import os
os.environ["OPENAI_API_KEY"]="openai API key here"

#Or something like this
import openai
openai.api_key="paste your key here"
Thank you for your help, do I need to pip install something?
Sorry I am new at this
I think openai gets installed along with llamaindex. You just need to set the key.

If you get import error just do pip install openai
I have llamaindex already installed
So I should be fine then
Let me try running this
It says openai could not be resolved
So I think I have to download the library
Just do pip freeze in your python environment and check
If it is installed or you need to install
I have it installed
Ran it again and same error
How have you set your API key? Hide the API key and show the implementation
Try setting the first way once
And share the entire error once
Also wait, do you have a data folder?
Where your documents are present?
Aha! Your quota is exceeded
You need to create new openai account
Or buy some credits
Quick question
Do you know how many tokens this will use
Thank you so much for your help
It depends on two things

First if you are going to create embeddings then how much files are being converted to embeddings. You will be charged there.

Second for each question there will be one query to openai for response generation so there also tokens will be used
Alright thanks
Add a reply
Sign up and join the conversation on Discord