Fellows, I’m not sure if I’m the only one, but I keep getting:
“You exceeded your current quota, please check your plan and billing details. For more information on this error.”
My app is extremely basic:
from langchain_openai import OpenAI
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
from langchain.chains import SequentialChain
import os
os.environ['OPENAI_API_KEY'] = 'MY_KEY'
try:
llm = OpenAI(model="gpt-3.5-turbo", temperature=0.7)
# Rest of your code
except Exception as e:
print(f"Error: {e}")
def generate_restaurant_name_and_items(cuisine):
prompt_template_name = PromptTemplate(
input_variables = ['cuisine'],
template = "I want to pen a restaurant for {cuisine} food. Suggest a fancy name for this."
)
name_chain = LLMChain(llm = llm, prompt = prompt_template_name, output_key = "restaurant_name")
prompt_template_items = PromptTemplate(
input_variables = ['restaurant_name'],
template = """Suggest some menu items for {restaurant_name}. Return them in a comma separated format only."""
)
food_items_chain = LLMChain(llm = llm, prompt = prompt_template_items, output_key = "menu_items")
chain = SequentialChain(
chains = [name_chain, food_items_chain],
input_variables = ['cuisine'],
output_variables = ['restaurant_name', 'menu_items']
)
response = chain.invoke({'cuisine': cuisine})
return response
if __name__ == "__main__":
print(generate_restaurant_name_and_items("Russian"))
Am I new to use the OpenAI API? No, I have my own account since Apr 2023. However, this is my first time using Python. I have mainly worked with JS, but for this case, I must use Python. I have also created 3 keys with exactly the same results. Any idea if there is something wrong with the OpenAI API today? Thanks.