You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The system encountered a 400 error (BadRequestError) when processing a chat completion request. This error appears to be linked to an issue with the request format.
To Reproduce
Steps to reproduce the behavior:
Start the TaskWeaver service.
Input the user query: "I need to bring my plant in to a local nursery called in ."
The system attempts to process this request.
The system encounters a BadRequestError with a message indicating a validation error for the request body, specifically mentioning "extra fields not permitted."
Expected behavior
The expected behavior was for the system to process the query successfully and provide an appropriate response or action plan.
Screenshots
Not applicable.
Environment Information
OS: macos 14.2.1 (23C71)
Python Version: 3.10
LLM used: GPT-4 Vision Preview
Additional context
The error suggests there may be an issue with the format or parameters of the request being sent to the OpenAI API. It may involve unexpected or extra fields in the request body that are not permitted. This could be due to changes in API specifications or incorrect request structuring.
** Terminal Dump
|_ _|_ _ ___| | _ | | / /__ ____ __ _____ _____
| |/ _` / __| |/ /| | /| / / _ \/ __ `/ | / / _ \/ ___/
| | (_| \__ \ < | |/ |/ / __/ /_/ /| |/ / __/ /
|_|\__,_|___/_|\_\|__/|__/\___/\__,_/ |___/\___/_/
=========================================================
TaskWeaver ▶ I am TaskWeaver, an AI assistant. To get started, could you please enter your request?
Human ▶ I need to bring my plant in to a local nursery called <redacted> in <redacted>
╭───< Planner >
Exception in thread Thread-3 (base_stream_puller): <=💡=>
Traceback (most recent call last):
File "/Users/aorlando/Development/TaskWeaver/taskweaver/llm/openai.py", line 163, in chat_completion
res: Any = self.client.chat.completions.create(
File "/opt/homebrew/Caskroom/miniconda/base/envs/taskweaver/lib/python3.10/site-packages/openai/_utils/_utils.py", line 271, in wrapper
return func(*args, **kwargs)
File "/opt/homebrew/Caskroom/miniconda/base/envs/taskweaver/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 648, in create
return self._post(
File "/opt/homebrew/Caskroom/miniconda/base/envs/taskweaver/lib/python3.10/site-packages/openai/_base_client.py", line 1179, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/opt/homebrew/Caskroom/miniconda/base/envs/taskweaver/lib/python3.10/site-packages/openai/_base_client.py", line 868, in request
return self._request(
File "/opt/homebrew/Caskroom/miniconda/base/envs/taskweaver/lib/python3.10/site-packages/openai/_base_client.py", line 959, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': '1 validation error for Request\nbody -> response_format\n extra fields not permitted (type=value_error.extra)', 'type': 'invalid_request_error', 'param': None, 'code': None}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniconda/base/envs/taskweaver/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/opt/homebrew/Caskroom/miniconda/base/envs/taskweaver/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/Users/aorlando/Development/TaskWeaver/taskweaver/llm/__init__.py", line 162, in base_stream_puller
for msg in stream:
File "/Users/aorlando/Development/TaskWeaver/taskweaver/llm/openai.py", line 218, in chat_completion
raise Exception(f"OpenAI API request was invalid: {e}")
Exception: OpenAI API request was invalid: Error code: 400 - {'error': {'message': '1 validation error for Request\nbody -> response_format\n extra fields not permitted (type=value_error.extra)', 'type': 'invalid_request_error', 'param': None, 'code': None}}
The text was updated successfully, but these errors were encountered:
albeorla
changed the title
BadRequestError on Chat Completion Request: Invalid Request Format with Extra Fields
BadRequest Error on OpenAI Completion Request: "extra fields not permitted (type=value_error.extra)" in taskweaver/llm/openai.py:163Jan 22, 2024
albeorla
changed the title
BadRequest Error on OpenAI Completion Request: "extra fields not permitted (type=value_error.extra)" in taskweaver/llm/openai.py:163
OpenAI Completion 400 Error: "extra fields not permitted (type=value_error.extra)" in taskweaver/llm/openai.py:163Jan 22, 2024
Describe the bug
The system encountered a 400 error (BadRequestError) when processing a chat completion request. This error appears to be linked to an issue with the request format.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The expected behavior was for the system to process the query successfully and provide an appropriate response or action plan.
Screenshots
Not applicable.
Environment Information
Additional context
The error suggests there may be an issue with the format or parameters of the request being sent to the OpenAI API. It may involve unexpected or extra fields in the request body that are not permitted. This could be due to changes in API specifications or incorrect request structuring.
** Terminal Dump
The text was updated successfully, but these errors were encountered: