Open kavyagl2 opened 4 months ago
BadRequestError: Error code: 400 - {'error': {'message': "Missing required parameter: 'tools[0].function'.", 'type': 'invalid_request_error', 'param': 'tools[0].function', 'code': 'missing_required_parameter'}} Traceback: File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 589, in _run_script exec(code, module.dict) File "D:\Amikus\AI Agent\poem_json1.py", line 270, in main() File "D:\Amikus\AI Agent\poem_json1.py", line 184, in main st.session_state.intents = determine_intent(user_query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Amikus\AI Agent\poem_json1.py", line 150, in determine_intent response = openai.chat.completions.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_utils_utils.py", line 277, in wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai\resources\chat\completions.py", line 606, in create return self._post( ^^^^^^^^^^^ File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_base_client.py", line 1240, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_base_client.py", line 921, in request return self._request( ^^^^^^^^^^^^^^ File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_base_client.py", line 1020, in _request raise self._make_status_error_from_response(err.response) from None
Issue is resolved. I recommend you close this issue.
BadRequestError: Error code: 400 - {'error': {'message': "Missing required parameter: 'tools[0].function'.", 'type': 'invalid_request_error', 'param': 'tools[0].function', 'code': 'missing_required_parameter'}} Traceback: File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 589, in _run_script exec(code, module.dict) File "D:\Amikus\AI Agent\poem_json1.py", line 270, in
main()
File "D:\Amikus\AI Agent\poem_json1.py", line 184, in main
st.session_state.intents = determine_intent(user_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Amikus\AI Agent\poem_json1.py", line 150, in determine_intent
response = openai.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_utils_utils.py", line 277, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai\resources\chat\completions.py", line 606, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_base_client.py", line 1240, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_base_client.py", line 921, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\Kavya Agrawal\AppData\Local\pypoetry\Cache\virtualenvs\ai_agent-aBhPFy3e-py3.11\Lib\site-packages\openai_base_client.py", line 1020, in _request
raise self._make_status_error_from_response(err.response) from None