KeyError: 'content' in analyze task (AzureOpenAI endpoint) #1238
Unanswered
Clara-breado
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
AzureEndpoint: True
Model name: gpt-35-turbo-16k
Model version: 0613
Azure open api version: 2023-07-01-preview
in analyze_tasks in analyze_task_agent => openai_error_handler:
| 2023-08-16 14:03:12.198 | ERROR | reworkd_platform.web.api.error_handling:platformatic_exception_handler:13 - 'content'
2023-08-16 22:03:12 platform | Traceback (most recent call last):
2023-08-16 22:03:12 platform |
2023-08-16 22:03:12 platform | File "/app/src/reworkd_platform/web/api/agent/helpers.py", line 36, in openai_error_handler
2023-08-16 22:03:12 platform | return await func(*args, **kwargs)
2023-08-16 22:03:12 platform | │ │ └ {'messages': [HumanMessage(content='\n High level objective: "Plan a detailed trip to Hawaii."\n Current task: "Researc...
2023-08-16 22:03:12 platform | │ └ ()
2023-08-16 22:03:12 platform | └ <bound method BaseChatModel.predict_messages of WrappedAzureChatOpenAI(cache=None, verbose=False, callbacks=None, callback_ma...
2023-08-16 22:03:12 platform |
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/base.py", line 392, in predict_messages
2023-08-16 22:03:12 platform | return self(messages, stop=_stop, **kwargs)
2023-08-16 22:03:12 platform | │ │ │ └ {'functions': [{'name': 'image', 'description': 'Used to sketch, draw, or generate an image.', 'parameters': {'type': 'object...
2023-08-16 22:03:12 platform | │ │ └ None
2023-08-16 22:03:12 platform | │ └ [HumanMessage(content='\n High level objective: "Plan a detailed trip to Hawaii."\n Current task: "Research popular att...
2023-08-16 22:03:12 platform | └ WrappedAzureChatOpenAI(cache=None, verbose=False, callbacks=None, callback_manager=None, tags=None, client=<class 'openai.api...
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/base.py", line 342, in call
2023-08-16 22:03:12 platform | generation = self.generate(
2023-08-16 22:03:12 platform | │ └ <function BaseChatModel.generate at 0x7f34a29b7420>
2023-08-16 22:03:12 platform | └ WrappedAzureChatOpenAI(cache=None, verbose=False, callbacks=None, callback_manager=None, tags=None, client=<class 'openai.api...
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/base.py", line 121, in generate
2023-08-16 22:03:12 platform | raise e
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/base.py", line 111, in generate
2023-08-16 22:03:12 platform | self._generate_with_cache(
2023-08-16 22:03:12 platform | │ └ <function BaseChatModel._generate_with_cache at 0x7f34a29b76a0>
2023-08-16 22:03:12 platform | └ WrappedAzureChatOpenAI(cache=None, verbose=False, callbacks=None, callback_manager=None, tags=None, client=<class 'openai.api...
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/base.py", line 255, in _generate_with_cache
2023-08-16 22:03:12 platform | return self._generate(
2023-08-16 22:03:12 platform | │ └ <function ChatOpenAI._generate at 0x7f34a2a056c0>
2023-08-16 22:03:12 platform | └ WrappedAzureChatOpenAI(cache=None, verbose=False, callbacks=None, callback_manager=None, tags=None, client=<class 'openai.api...
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/openai.py", line 370, in _generate
2023-08-16 22:03:12 platform | return self._create_chat_result(response)
2023-08-16 22:03:12 platform | │ │ └ <OpenAIObject chat.completion id=chatcmpl-7oBP4uYfwY2Dtm9JWKBUIN193wift at 0x7f3495c6aab0> JSON: {
2023-08-16 22:03:12 platform | │ │ "id": "chatcmpl-7oBP4uYf...
2023-08-16 22:03:12 platform | │ └ <function AzureChatOpenAI._create_chat_result at 0x7f34a2a06020>
2023-08-16 22:03:12 platform | └ WrappedAzureChatOpenAI(cache=None, verbose=False, callbacks=None, callback_manager=None, tags=None, client=<class 'openai.api...
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/azure_openai.py", line 142, in _create_chat_result
2023-08-16 22:03:12 platform | return super()._create_chat_result(response)
2023-08-16 22:03:12 platform | └ <OpenAIObject chat.completion id=chatcmpl-7oBP4uYfwY2Dtm9JWKBUIN193wift at 0x7f3495c6aab0> JSON: {
2023-08-16 22:03:12 platform | "id": "chatcmpl-7oBP4uYf...
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/openai.py", line 386, in _create_chat_result
2023-08-16 22:03:12 platform | message = _convert_dict_to_message(res["message"])
2023-08-16 22:03:12 platform | │ └ <OpenAIObject at 0x7f3495c44f50> JSON: {
2023-08-16 22:03:12 platform | │ "index": 0,
2023-08-16 22:03:12 platform | │ "finish_reason": "function_call",
2023-08-16 22:03:12 platform | │ "message": {
2023-08-16 22:03:12 platform | │ "role": "assist...
2023-08-16 22:03:12 platform | └ <function _convert_dict_to_message at 0x7f34a2a04fe0>
2023-08-16 22:03:12 platform | File "/usr/local/lib/python3.11/site-packages/langchain/chat_models/openai.py", line 101, in _convert_dict_to_message
2023-08-16 22:03:12 platform | content = _dict["content"] or "" # OpenAI returns None for tool invocations
2023-08-16 22:03:12 platform | └ <OpenAIObject at 0x7f3495c47890> JSON: {
2023-08-16 22:03:12 platform | "role": "assistant",
2023-08-16 22:03:12 platform | "function_call": {
2023-08-16 22:03:12 platform | "name": "reason",
2023-08-16 22:03:12 platform | "arguments": "...
2023-08-16 22:03:12 platform |
2023-08-16 22:03:12 platform | KeyError: 'content'
2023-08-16 22:03:12 platform |
2023-08-16 22:03:12 platform |
2023-08-16 22:03:12 platform | During handling of the above exception, another exception occurred:
Beta Was this translation helpful? Give feedback.
All reactions