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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error making request to Open AI completions endpoint #109

Open
arjunm3 opened this issue Apr 2, 2024 · 0 comments
Open

Error making request to Open AI completions endpoint #109

arjunm3 opened this issue Apr 2, 2024 · 0 comments

Comments

@arjunm3
Copy link

arjunm3 commented Apr 2, 2024

Please provide us with the following information:

This issue is for a: Error making request to Open AI completions endpoint when deploying and testing AOAI_Virtual_Assistant

All the apps are individually up and running but when chatting with the bot webapp the orchestrator is not able to access the open ai completion endpoint and below error is displayed in the command prompt. If anyone resolved this, please provide info.

Any log messages given by the failure

400 Client Error: Bad Request for url: https://casggpt-4.openai.azure.com/openai/deployments/GPT4/completions?api-version=2024-02-15-preview
400 Client Error: Bad Request for url: https://casggpt-4.openai.azure.com/openai/deployments/GPT4/completions?api-version=2024-02-15-preview
400 Client Error: Bad Request for url: https://casggpt-4.openai.azure.com/openai/deployments/GPT4/completions?api-version=2024-02-15-preview
400 Client Error: Bad Request for url: https://casggpt-4.openai.azure.com/openai/deployments/GPT4/completions?api-version=2024-02-15-preview
400 Client Error: Bad Request for url: https://casggpt-4.openai.azure.com/openai/deployments/GPT4/completions?api-version=2024-02-15-preview
400 Client Error: Bad Request for url: https://casggpt-4.openai.azure.com/openai/deployments/GPT4/completions?api-version=2024-02-15-preview
[2024-04-02 10:26:07,000] ERROR in app: Exception on /query [POST]
Traceback (most recent call last):
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\openai\End_to_end_Solutions\AOAIVirtualAssistant\src\botapp\cognition\openai\api\client.py", line 32, in completions
response.raise_for_status()
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://casggpt-4.openai.azure.com/openai/deployments/GPT4/completions?api-version=2024-02-15-preview

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\flask\app.py", line 1463, in wsgi_app
response = self.full_dispatch_request()
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\flask\app.py", line 872, in full_dispatch_request
rv = self.handle_user_exception(e)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\flask\app.py", line 870, in full_dispatch_request
rv = self.dispatch_request()
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\flask\app.py", line 855, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\openai\End_to_end_Solutions\AOAIVirtualAssistant\src\botapp\main.py", line 24, in run_flow
agent_response = orchestrator.run_query(conversation, user_id, conversation_id, query)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\openai\End_to_end_Solutions\AOAIVirtualAssistant\src\botapp\orchestrator.py", line 50, in run_query
classification = self.topic_classifier.run(query)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\openai\End_to_end_Solutions\AOAIVirtualAssistant\src\botapp\tasks\topic_classifier.py", line 24, in run
response = topic_classifier.generate_dialog(classifier_payload)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\openai\End_to_end_Solutions\AOAIVirtualAssistant\src\botapp\cognition\openai\model_manager.py", line 58, in generate_dialog
response_choice = self.client.completions(text_prompt, self.model_params)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\tenacity_init_.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\tenacity_init_.py", line 379, in call
do = self.iter(retry_state=retry_state)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\tenacity_init_.py", line 325, in iter
raise retry_exc.reraise()
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\tenacity_init_.py", line 158, in reraise
raise self.last_attempt.result()
File "C:\Users\ArjunM\AppData\Local\Programs\Python\Python39\lib\concurrent\futures_base.py", line 433, in result
return self.__get_result()
File "C:\Users\ArjunM\AppData\Local\Programs\Python\Python39\lib\concurrent\futures_base.py", line 389, in __get_result
raise self.exception
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\myenv\lib\site-packages\tenacity_init
.py", line 382, in call
result = fn(*args, **kwargs)
File "F:\Arjun\Open_AI_Practice\AOAI_Virtual_Assistant\openai\End_to_end_Solutions\AOAIVirtualAssistant\src\botapp\cognition\openai\api\client.py", line 40, in completions
raise Exception("Error making request to Open AI completions endpoint.")
Exception: Error making request to Open AI completions endpoint.

Expected/desired behavior

OS and Version?

Windows

Versions

10

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant