[GH-ISSUE #7596] Bug when using tool calling #85550

Closed
opened 2026-05-15 10:10:17 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @kim-gtek on GitHub (Dec 4, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7596

Latest version 0.4.7
Only one tool in database
Error does not appear with a fresh database - only appears with migrated database used since 0.3.0 !!

ERROR [open_webui.apps.openai.main] 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions'
ERROR [open_webui.main] Error: 400: Unrecognized request argument supplied: chat_id

INFO  [open_webui.main] tools={'get_current_weather': {'toolkit_id': 'keyless_weather', 'callable': <function Tools.get_current_weather at 0x701b0de29440>, 'spec': {'name': 'get_current_weather', 'description': 'Get the current weather for a given city.', 'parameters': {'properties': {'city': {'description': 'The name of the city to get the weather for.', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}, 'pydantic_model': <class 'open_webui.utils.tools.get_current_weather'>, 'file_handler': False, 'citation': True}, 'get_future_weather_week': {'toolkit_id': 'keyless_weather', 'callable': <function Tools.get_future_weather_week at 0x701b0a7fe160>, 'spec': {'name': 'get_future_weather_week', 'description': ':description: Get the weather for the next week for a given city.', 'parameters': {'properties': {'city': {'description': 'The name of the city to get the weather for.', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}, 'pydantic_model': <class 'open_webui.utils.tools.get_future_weather_week'>, 'file_handler': False, 'citation': True}}
INFO  [open_webui.main] tools_function_calling_prompt='Available Tools: [{"name": "get_current_weather", "description": "Get the current weather for a given city.", "parameters": {"properties": {"city": {"description": "The name of the city to get the weather for.", "type": "string"}}, "required": ["city"], "type": "object"}}, {"name": "get_future_weather_week", "description": ":description: Get the weather for the next week for a given city.", "parameters": {"properties": {"city": {"description": "The name of the city to get the weather for.", "type": "string"}}, "required": ["city"], "type": "object"}}]\nReturn an empty string if no tools match the query. If a function tool matches, construct and return a JSON object in the format {"name": "functionName", "parameters": {"requiredFunctionParamKey": "requiredFunctionParamValue"}} using the appropriate tool and its parameters. Only return the object and limit the response to the JSON object without additional text.'
INFO  [open_webui.apps.openai.main] get_all_models()
INFO:     172.20.0.1:38268 - "GET /api/v1/chats/b6d392d6-2316-459f-bbf7-05d43be92682 HTTP/1.1" 200 OK
ERROR [open_webui.apps.openai.main] 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions'
Traceback (most recent call last):
  File "/app/backend/open_webui/apps/openai/main.py", line 645, in generate_chat_completion
    r.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions'

ERROR [open_webui.main] Error: 400: Unrecognized request argument supplied: chat_id
Traceback (most recent call last):
  File "/app/backend/open_webui/apps/openai/main.py", line 645, in generate_chat_completion
    r.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/backend/open_webui/main.py", line 410, in chat_completion_tools_handler
    response = await generate_chat_completions(form_data=payload, user=user)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/main.py", line 1326, in generate_chat_completions
    return await generate_openai_chat_completion(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/backend/open_webui/apps/openai/main.py", line 656, in generate_chat_completion
    raise HTTPException(status_code=r.status if r else 500, detail=error_detail)
fastapi.exceptions.HTTPException: 400: Unrecognized request argument supplied: chat_id

Originally created by @kim-gtek on GitHub (Dec 4, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/7596 Latest version 0.4.7 Only one tool in database Error does not appear with a fresh database - only appears with migrated database used since 0.3.0 !! ERROR [open_webui.apps.openai.main] 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions' ERROR [open_webui.main] Error: 400: Unrecognized request argument supplied: chat_id ``` INFO [open_webui.main] tools={'get_current_weather': {'toolkit_id': 'keyless_weather', 'callable': <function Tools.get_current_weather at 0x701b0de29440>, 'spec': {'name': 'get_current_weather', 'description': 'Get the current weather for a given city.', 'parameters': {'properties': {'city': {'description': 'The name of the city to get the weather for.', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}, 'pydantic_model': <class 'open_webui.utils.tools.get_current_weather'>, 'file_handler': False, 'citation': True}, 'get_future_weather_week': {'toolkit_id': 'keyless_weather', 'callable': <function Tools.get_future_weather_week at 0x701b0a7fe160>, 'spec': {'name': 'get_future_weather_week', 'description': ':description: Get the weather for the next week for a given city.', 'parameters': {'properties': {'city': {'description': 'The name of the city to get the weather for.', 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}, 'pydantic_model': <class 'open_webui.utils.tools.get_future_weather_week'>, 'file_handler': False, 'citation': True}} INFO [open_webui.main] tools_function_calling_prompt='Available Tools: [{"name": "get_current_weather", "description": "Get the current weather for a given city.", "parameters": {"properties": {"city": {"description": "The name of the city to get the weather for.", "type": "string"}}, "required": ["city"], "type": "object"}}, {"name": "get_future_weather_week", "description": ":description: Get the weather for the next week for a given city.", "parameters": {"properties": {"city": {"description": "The name of the city to get the weather for.", "type": "string"}}, "required": ["city"], "type": "object"}}]\nReturn an empty string if no tools match the query. If a function tool matches, construct and return a JSON object in the format {"name": "functionName", "parameters": {"requiredFunctionParamKey": "requiredFunctionParamValue"}} using the appropriate tool and its parameters. Only return the object and limit the response to the JSON object without additional text.' INFO [open_webui.apps.openai.main] get_all_models() ``` ``` INFO: 172.20.0.1:38268 - "GET /api/v1/chats/b6d392d6-2316-459f-bbf7-05d43be92682 HTTP/1.1" 200 OK ERROR [open_webui.apps.openai.main] 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions' Traceback (most recent call last): File "/app/backend/open_webui/apps/openai/main.py", line 645, in generate_chat_completion r.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions' ``` ``` ERROR [open_webui.main] Error: 400: Unrecognized request argument supplied: chat_id Traceback (most recent call last): File "/app/backend/open_webui/apps/openai/main.py", line 645, in generate_chat_completion r.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://api.openai.com/v1/chat/completions' ``` ``` During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/backend/open_webui/main.py", line 410, in chat_completion_tools_handler response = await generate_chat_completions(form_data=payload, user=user) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/main.py", line 1326, in generate_chat_completions return await generate_openai_chat_completion( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/open_webui/apps/openai/main.py", line 656, in generate_chat_completion raise HTTPException(status_code=r.status if r else 500, detail=error_detail) fastapi.exceptions.HTTPException: 400: Unrecognized request argument supplied: chat_id ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#85550