incalculable-garage-37123
10/02/2025, 5:49 PM2025-10-02 23:16:46,346 - ERROR livekit.agents - Error in _execute_tools_task
Traceback (most recent call last):
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/voice/generation.py", line 425, in _execute_tools_task
fnc_args, fnc_kwargs = llm_utils.prepare_function_arguments(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/llm/utils.py", line 373, in prepare_function_arguments
if param_name in args_dict and args_dict[param_name] is None:
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable {"pid": 2346005, "job_id": "AJ_JxxyZtgChWaR"}
2025-10-02 23:16:47,147 - INFO session.agent - [bb9f3448-e5af-417a-9ba3-ddb2803d3b3e] tts_metrics metrics collected {"pid": 2346005, "job_id": "AJ_JxxyZtgChWaR"}
2025-10-02 23:16:55,113 - INFO session.llm - [bb9f3448-e5af-417a-9ba3-ddb2803d3b3e] LLM genearted Response {"pid": 2346005, "job_id": "AJ_JxxyZtgChWaR"}
2025-10-02 23:16:55,113 - ERROR livekit.agents - Error in _pipeline_reply_task
Traceback (most recent call last):
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/voice/agent_activity.py", line 1823, in _pipeline_reply_task
await exe_task
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/voice/generation.py", line 425, in _execute_tools_task
fnc_args, fnc_kwargs = llm_utils.prepare_function_arguments(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rashi-aidetic/Documents/Fabrichq/automated_call_notifications/venv/lib/python3.12/site-packages/livekit/agents/llm/utils.py", line 373, in prepare_function_arguments
if param_name in args_dict and args_dict[param_name] is None:
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable {"pid": 2346005, "job_id": "AJ_JxxyZtgChWaR"}
2025-10-02 23:16:57,647 - INFO livekit.agents - process exitingtall-airline-16756
10/02/2025, 5:49 PMtall-airline-16756
10/02/2025, 5:50 PMincalculable-garage-37123
10/02/2025, 5:53 PMtall-airline-16756
10/02/2025, 5:54 PMTypeError: argument of type 'NoneType' is not iterable. This usually happens due to a problem with how the API key is being handled for the Groq LLM. Let’s walk through some steps together to help you resolve this:
1. First, please double-check that your api_key parameter or the GROQ_API_KEY environment variable is set properly with a valid, non-empty string. For example:
import os
os.environ["GROQ_API_KEY"] = "your-valid-groq-api-key"
2. Next, make sure the API key isn’t None before you pass it to the Groq LLM initialization. Here’s a quick way to verify:
api_key = "your-key-here"
if not api_key:
raise ValueError("API key is missing or invalid")
llm = groq.LLM(api_key=api_key, model="llama-3.3-70b-versatile")
3. It’s also a good idea to wrap the initialization in a try-except block to catch any errors gracefully:
from livekit.plugins import groq
try:
llm = groq.LLM(api_key="your-api-key", model="llama-3.3-70b-versatile")
except ValueError as e:
print(f"LLM initialization failed: {e}")
llm = None
4. Lastly, please ensure the livekit-plugins-groq package is installed correctly by running:
pip install "livekit-agents[groq]~=1.2"
If you’re still seeing the issue after trying these steps, it might be helpful to check your function tool implementation to make sure no None values are accidentally being passed or used where iterables are expected. Feel free to reach out if you want me to take a closer look or if you have any other questions—I’m here to help!
Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py | Docs::Agentsincalculable-garage-37123
10/02/2025, 5:56 PMtall-airline-16756
10/02/2025, 5:57 PMincalculable-garage-37123
10/02/2025, 5:58 PMtall-airline-16756
10/02/2025, 5:58 PM