plain-petabyte-31153
04/22/2025, 12:51 PMTraceback (most recent call last):
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/llm/llm.py", line 137, in _main_task
return await self._run()
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/plugins/openai/llm.py", line 599, in _run
raise APIStatusError(
livekit.agents._exceptions.APIStatusError: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}} (status_code=400, request_id=req_db5c813223892e3954d7f5ea6945c491, body={'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}) {"llm": "livekit.plugins.openai.llm.LLM", "attempt": 1, "pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
2025-04-22 17:51:02,151 - WARNING livekit.agents - failed to generate LLM completion, retrying in 2.0s
Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/llm/llm.py", line 137, in _main_task
return await self._run()
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/plugins/openai/llm.py", line 599, in _run
raise APIStatusError(
livekit.agents._exceptions.APIStatusError: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}} (status_code=400, request_id=req_2e385837027cf75c27e72ece4a73d5ce, body={'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}) {"llm": "livekit.plugins.openai.llm.LLM", "attempt": 2, "pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
2025-04-22 17:51:31,514 - DEBUG livekit.agents - received user transcript {"user_transcript": "Hello?", "language": "en", "pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
2025-04-22 17:51:32,152 - WARNING livekit.agents - failed to generate LLM completion, retrying in 2.0s
Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/llm/llm.py", line 137, in _main_task
return await self._run()
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/plugins/openai/llm.py", line 599, in _run
raise APIStatusError(
livekit.agents._exceptions.APIStatusError: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}} (status_code=400, request_id=req_d9385c1c2d9a4a2d87a9813c10f48ab6, body={'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}) {"llm": "livekit.plugins.openai.llm.LLM", "attempt": 1, "pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
2025-04-22 17:51:34,474 - WARNING livekit.agents - failed to generate LLM completion, retrying in 2.0s
Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/llm/llm.py", line 137, in _main_task
return await self._run()
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/plugins/openai/llm.py", line 599, in _run
raise APIStatusError(
livekit.agents._exceptions.APIStatusError: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}} (status_code=400, request_id=req_109bc18a204d13156805b705fd007968, body={'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}) {"llm": "livekit.plugins.openai.llm.LLM", "attempt": 2, "pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
2025-04-22 17:51:36,846 - WARNING livekit.agents - failed to generate LLM completion, retrying in 2.0s
Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/llm/llm.py", line 137, in _main_task
return await self._run()
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/plugins/openai/llm.py", line 599, in _run
raise APIStatusError(
livekit.agents._exceptions.APIStatusError: Error code: 400 - {'error': {'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}} (status_code=400, request_id=req_1a85e4725f3096885b33bc606f5c1ad2, body={'message': "An assistant message with 'tool_calls' must be followed by tool messages responding to each 'tool_call_id'. The following tool_call_ids did not have response messages: call_rPkIMnbefpnIRoXnjWRhBG8x", 'type': 'invalid_request_error', 'param': 'messages.[7].role', 'code': None}) {"llm": "livekit.plugins.openai.llm.LLM", "attempt": 3, "pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
2025-04-22 17:51:39,152 - ERROR livekit.agents - Error in _inference_task
Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs
return await fn(*args, **kwargs)
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/voice/generation.py", line 80, in _inference_task
async for chunk in llm_node:
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/voice/agent.py", line 445, in llm_node
async for chunk in stream:
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/llm/llm.py", line 226, in _anext_
raise exc from None
File "/home/ubuntu/.virtualenvs/Livekit10Env/lib/python3.10/site-packages/livekit/agents/llm/llm.py", line 144, in _main_task
raise APIConnectionError(
livekit.agents._exceptions.APIConnectionError: failed to generate LLM completion after 4 attempts {"pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
2025-04-22 17:51:39,160 - DEBUG livekit.agents - stream closed {"participant": "IX7OHT656YEYLECN", "source": "SOURCE_MICROPHONE", "pid": 1605072, "job_id": "AJ_XfZGoBuk7LMy"}
When agent is running live on my UI in middle of conversation openai plugin api fails which delays the conversation
suggest a way to tackle this thing to make my agent's conversation to avoid delayrefined-appointment-81829
04/22/2025, 4:53 PMpip freeze |grep livekit