When I user Qwen3-max to prarallel use tools. Errors occurs [[Error: get_weatherget_weatherget_weather is not a valid tool, try one of [get_weather, think_note, get_location].']].
But when I changed to ChatOpenAI class, there was no error occurs
error description:
model : Qwen3-max
return ChatTongyi(
model_name="qwen3-max",
dashscope_api_key="sk",
temperature=0.3,
max_tokens=2048000,
streaming=True,
tags=["supervisor"],
model_kwargs={
"incremental_output": True
}
)
langgragh stream mode, messages mode
here comes the chunks logs
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 0, 'id': 'call_42f7f7eb6a054fdeae8f3377', 'type': 'function', 'function': {'name': 'get_weather', 'arguments': ''}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', tool_calls=[{'name': 'get_weather', 'args': {}, 'id': 'call_42f7f7eb6a054fdeae8f3377', 'type': 'tool_call'}], tool_call_chunks=[{'name': 'get_weather', 'args': '', 'id': 'call_42f7f7eb6a054fdeae8f3377', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 0, 'id': '', 'type': 'function', 'function': {'arguments': '{"city": "'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', tool_calls=[{'name': '', 'args': {'city': ''}, 'id': '', 'type': 'tool_call'}], tool_call_chunks=[{'name': None, 'args': '{"city": "', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 0, 'id': '', 'type': 'function', 'function': {'arguments': '上海"'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', invalid_tool_calls=[{'name': None, 'args': '上海"', 'id': '', 'error': None, 'type': 'invalid_tool_call'}], tool_call_chunks=[{'name': None, 'args': '上海"', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 0, 'id': '', 'type': 'function', 'function': {'arguments': '}'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', invalid_tool_calls=[{'name': None, 'args': '}', 'id': '', 'error': None, 'type': 'invalid_tool_call'}], tool_call_chunks=[{'name': None, 'args': '}', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 1, 'id': 'call_05eca8742be34a0ba558ccc2', 'type': 'function', 'function': {'name': 'get_weather', 'arguments': ''}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', tool_calls=[{'name': 'get_weather', 'args': {}, 'id': 'call_05eca8742be34a0ba558ccc2', 'type': 'tool_call'}], tool_call_chunks=[{'name': 'get_weather', 'args': '', 'id': 'call_05eca8742be34a0ba558ccc2', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 1, 'id': '', 'type': 'function', 'function': {'arguments': '{"city": "北京'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', tool_calls=[{'name': '', 'args': {'city': '北京'}, 'id': '', 'type': 'tool_call'}], tool_call_chunks=[{'name': None, 'args': '{"city": "北京', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 1, 'id': '', 'type': 'function', 'function': {'arguments': '"'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', invalid_tool_calls=[{'name': None, 'args': '"', 'id': '', 'error': None, 'type': 'invalid_tool_call'}], tool_call_chunks=[{'name': None, 'args': '"', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 1, 'id': '', 'type': 'function', 'function': {'arguments': '}'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', invalid_tool_calls=[{'name': None, 'args': '}', 'id': '', 'error': None, 'type': 'invalid_tool_call'}], tool_call_chunks=[{'name': None, 'args': '}', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 2, 'id': 'call_1569fdf32184461fad087986', 'type': 'function', 'function': {'name': 'get_weather', 'arguments': ''}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', tool_calls=[{'name': 'get_weather', 'args': {}, 'id': 'call_1569fdf32184461fad087986', 'type': 'tool_call'}], tool_call_chunks=[{'name': 'get_weather', 'args': '', 'id': 'call_1569fdf32184461fad087986', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 2, 'id': '', 'type': 'function', 'function': {'arguments': '{"city": "重庆'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', tool_calls=[{'name': '', 'args': {'city': '重庆'}, 'id': '', 'type': 'tool_call'}], tool_call_chunks=[{'name': None, 'args': '{"city": "重庆', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 2, 'id': '', 'type': 'function', 'function': {'arguments': '"}'}}]}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', invalid_tool_calls=[{'name': None, 'args': '"}', 'id': '', 'error': None, 'type': 'invalid_tool_call'}], tool_call_chunks=[{'name': None, 'args': '"}', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={'tool_calls': [{'index': 2, 'id': '', 'type': 'function', 'function': {'arguments': ''}}]}, response_metadata={'finish_reason': 'tool_calls', 'request_id': '3fd2bd4e-4cbc-467b-b416-63708142ed39', 'token_usage': {'input_tokens': 587, 'output_tokens': 65, 'total_tokens': 652, 'prompt_tokens_details': {'cached_tokens': 0}}}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', tool_calls=[{'name': '', 'args': {}, 'id': '', 'type': 'tool_call'}], tool_call_chunks=[{'name': None, 'args': '', 'id': '', 'index': 0, 'type': 'tool_call_chunk'}])
--------------------
AIMessageChunk(content='', additional_kwargs={}, response_metadata={}, id='lc_run--0993ad69-e718-4a31-96e0-bcca7c402c4f', chunk_position='last')
--------------------
ToolMessage(content='Error: get_weatherget_weatherget_weather is not a valid tool, try one of [get_weather, think_note, get_location].', name='get_weatherget_weatherget_weather', id='053cc7b1-7b0b-4cc7-a60d-03f1d1fb60b3', tool_call_id='call_42f7f7eb6a054fdeae8f3377call_05eca8742be34a0ba558ccc2call_1569fdf32184461fad087986', status='error')
--------------------