I receive these messages:
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
File "/data/MisDocumentos/programas/rag/langchain/lib/python3.12/site-packages/openai/api_resources/chat_completion.py", line 25, in create
return super().create(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/MisDocumentos/programas/rag/langchain/lib/python3.12/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
^^^^^^^^^^^^^^^^^^
File "/data/MisDocumentos/programas/rag/langchain/lib/python3.12/site-packages/openai/api_requestor.py", line 298, in request
resp, got_stream = self._interpret_response(result, stream)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/MisDocumentos/programas/rag/langchain/lib/python3.12/site-packages/openai/api_requestor.py", line 700, in _interpret_response
self._interpret_response_line(
File "/data/MisDocumentos/programas/rag/langchain/lib/python3.12/site-packages/openai/api_requestor.py", line 765, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.
The code:
import openai # v1.35.7
import os, sys
openai.api_key=os.getenv("OPENAI_API_KEY")
messages = [
{"role": "system", "content": "Eres un asistente Ăştil."},
{"role": "user", "content": "Give me two reasons to learn Open AI API with Python"}
]
response = openai.ChatCompletion.create(
model='gpt-3.5-turbo',
messages=messages,
max_tokens=300
)
print(response.choices[0].message['content'])
I’m trying to do the practices of a langchain course, in udemy.