Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Input validation error while using "Chat" function of embedchain #1338

Open
mdevs7 opened this issue Apr 13, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@mdevs7
Copy link

mdevs7 commented Apr 13, 2024

馃悰 Describe the bug

Here is my code which is producing the error.

import os
from embedchain import App

# Replace this with your OpenAI key
os.environ["OPENAI_API_KEY"] = "sk-AFj3XbMaBfuTjzAsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

app = App()
app.add("https://www.forbes.com/profile/elon-musk")
app.add("https://en.wikipedia.org/wiki/Elon_Musk")
app.query("What is the net worth of Elon Musk today?")

answer, sources = app.chat("What is the net worth of Elon?", citations=True)
print(answer)
print(sources)

When I am using the chat() method to query from data source then throwing an error of rate limit as here :
'Request too large for gpt-3.5-turbo in organization org-PzDzUDWjyxxxxxxxxxxxxxxxx on tokens per min (TPM): Limit 40000, Requested 55065. The input or output tokens must be reduced in order to run successfully.

This same error is not produced while using search() or query() function for query from data source.

Here is full log:
File "C:\Users\admin\AppData\Roaming\Python\Python312\site-packages\openai_base_client.py", line 1013, in _request
raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {'error': {'message': 'Request too large for gpt-3.5-turbo in organization org-PzDzUDWjyxxxxxxxxxxxxx on tokens per min (TPM): Limit 40000, Requested 55065. The input or output tokens must be
reduced in order to run successfully. Visit https://platform.openai.com/account/rate-limits to learn more. You can increase your rate limit by adding a payment method to your account at https://platform.openai.com/account/billing.', 'type': 'tokens', 'param': None, 'code': 'rate_limit_exceeded'}}

@LeonieFreisinger
Copy link
Contributor

@mdevs7 Have you solved the error yet?
I ran your code but did not run into an error.
In case it still occurs, have you updated to the latest embedchain and openai version?

@Dev-Khant Dev-Khant added the bug Something isn't working label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants