-
Notifications
You must be signed in to change notification settings - Fork 478
Open
Description
upload image and ask,then the server log show error like this
Traceback (most recent call last):
File "localpath/lib/python3.12/site-packages/langgraph_api/worker.py", line 142, in wrap_user_errors
await consume(
File "localpath/lib/python3.12/site-packages/langgraph_api/stream.py", line 501, in consume
raise e
File "localpath/lib/python3.12/site-packages/langgraph_api/stream.py", line 484, in consume
async for mode, payload in stream:
File "localpath/lib/python3.12/site-packages/langgraph_api/stream.py", line 369, in astream_state
event = await wait_if_not_done(anext(stream, sentinel), done)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langgraph_api/asyncio.py", line 89, in wait_if_not_done
raise e.exceptions[0] from None
File "localpath/lib/python3.12/site-packages/langgraph/pregel/main.py", line 2956, in astream
async for _ in runner.atick(
File "localpath/lib/python3.12/site-packages/langgraph/pregel/_runner.py", line 410, in atick
_panic_or_proceed(
File "localpath/lib/python3.12/site-packages/langgraph/pregel/_runner.py", line 520, in _panic_or_proceed
raise exc
File "localpath/lib/python3.12/site-packages/langgraph/pregel/_retry.py", line 137, in arun_with_retry
return await task.proc.ainvoke(task.input, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langgraph/_internal/_runnable.py", line 705, in ainvoke
input = await asyncio.create_task(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langgraph/_internal/_runnable.py", line 473, in ainvoke
ret = await self.afunc(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langchain/agents/factory.py", line 1148, in amodel_node
response = await _execute_model_async(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langchain/agents/factory.py", line 1121, in _execute_model_async
output = await model_.ainvoke(messages)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 5547, in ainvoke
return await self.bound.ainvoke(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 408, in ainvoke
llm_result = await self.agenerate_prompt(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 1115, in agenerate_prompt
return await self.agenerate(
^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 1073, in agenerate
raise exceptions[0]
File "localpath/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 1283, in _agenerate_with_cache
async for chunk in self._astream(messages, stop=stop, **kwargs):
File "localpath/lib/python3.12/site-packages/langchain_openai/chat_models/base.py", line 2968, in _astream
async for chunk in super()._astream(*args, **kwargs):
File "localpath/lib/python3.12/site-packages/langchain_openai/chat_models/base.py", line 1491, in _astream
response = await self.async_client.create(**payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 2672, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/openai/_base_client.py", line 1794, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "localpath/lib/python3.12/site-packages/openai/_base_client.py", line 1594, in request
raise self._make_status_error_from_response(err.response) from None
openai.UnprocessableEntityError: Error code: 422 - {'detail': [{'type': 'literal_error', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageGenericParam', 'role'], 'msg': "Input should be 'system', 'assistant' or 'tool'", 'input': 'user', 'ctx': {'expected': "'system', 'assistant' or 'tool'"}}, {'type': 'string_type', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageGenericParam', 'content', 'str'], 'msg': 'Input should be a valid string', 'input': [{'type': 'text', 'text': '?'}, {'type': 'image', 'mimeType': 'image/png', 'data': 'image data base64 format xxx', 'metadata': {'name': 'image.png'}}]}, {'type': 'literal_error', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageGenericParam', 'content', 'list[ChatCompletionMessageContentTextPart]', 1, 'type'], 'msg': "Input should be 'text'", 'input': 'image', 'ctx': {'expected': "'text'"}}, {'type': 'missing', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageGenericParam', 'content', 'list[ChatCompletionMessageContentTextPart]', 1, 'text'], 'msg': 'Field required', 'input': {'type': 'image', 'mimeType': 'image/png', 'data': 'image data base64 format xxx', 'metadata': {'name': 'image.png'}}}, {'type': 'string_type', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageUserParam', 'content', 'str'], 'msg': 'Input should be a valid string', 'input': [{'type': 'text', 'text': '?'}, {'type': 'image', 'mimeType': 'image/png', 'data': 'image data base64 format xxx', 'metadata': {'name': 'image.png'}}]}, {'type': 'literal_error', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageUserParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentAudioPart]]', 1, 'ChatCompletionMessageContentTextPart', 'type'], 'msg': "Input should be 'text'", 'input': 'image', 'ctx': {'expected': "'text'"}}, {'type': 'missing', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageUserParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentAudioPart]]', 1, 'ChatCompletionMessageContentTextPart', 'text'], 'msg': 'Field required', 'input': {'type': 'image', 'mimeType': 'image/png', 'data': 'image data base64 format xxx', 'metadata': {'name': 'image.png'}}}, {'type': 'literal_error', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageUserParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentAudioPart]]', 1, 'ChatCompletionMessageContentImagePart', 'type'], 'msg': "Input should be 'image_url'", 'input': 'image', 'ctx': {'expected': "'image_url'"}}, {'type': 'missing', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageUserParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentAudioPart]]', 1, 'ChatCompletionMessageContentImagePart', 'image_url'], 'msg': 'Field required', 'input': {'type': 'image', 'mimeType': 'image/png', 'data': 'image data base64 format xxx', 'metadata': {'name': 'image.png'}}}, {'type': 'literal_error', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageUserParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentAudioPart]]', 1, 'ChatCompletionMessageContentAudioPart', 'type'], 'msg': "Input should be 'audio_url'", 'input': 'image', 'ctx': {'expected': "'audio_url'"}}, {'type': 'missing', 'loc': ['body', 'messages', 0, 'ChatCompletionMessageUserParam', 'content', 'list[union[ChatCompletionMessageContentTextPart,ChatCompletionMessageContentImagePart,ChatCompletionMessageContentAudioPart]]', 1, 'ChatCompletionMessageContentAudioPart', 'audio_url'], 'msg': 'Field required', 'input': {'type': 'image', 'mimeType': 'image/png', 'data': 'image data base64 format xxx', 'metadata': {'name': 'image.png'}}}]}
During task with name 'model' and id '15fcc8d5-5b84-7fe9-bc7f-c862c860e55b'
pip pkg in server:
langgraph 1.0.3
langgraph-api 0.5.20
langgraph-checkpoint 3.0.1
langgraph-cli 0.4.7
langgraph-prebuilt 1.0.4
langgraph-runtime-inmem 0.18.0
langgraph-sdk 0.2.9
langgraph-supervisor 0.0.31
Metadata
Metadata
Assignees
Labels
No labels