You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@llm.ai_callable(
description="""
"Returns a list of transactions during a specified period and filters...blah blah
"""
)
async def a_tool_call(
self,
start_date: Annotated[
Optional[str],
llm.TypeInfo(
description="""
The start date in the format %Y-%m-%d,
for example, 2020-09-01 for 1st September 2020.
If you don't think this field is relevant for the question then set this parameter to None.
"""
),
] = None,
...more parameters
Expected behaviour
Tool call proceeds as usual with None set as a parameter
Actual behaviour
We receive the following error message and the tool call is now able to proceed
2024-11-29 17:34:13,600 - ERROR livekit.plugins.openai.realtime - failed to handle OpenAI S2S message
Traceback (most recent call last):
File "/Users/paula.muldoon/dev/ai/ai-livekit-agent/.venv/lib/python3.11/site-packages/livekit/plugins/openai/realtime/realtime_model.py", line 1038, in _recv_task
self._handle_response_output_item_done(data)
File "/Users/paula.muldoon/dev/ai/ai-livekit-agent/.venv/lib/python3.11/site-packages/livekit/plugins/openai/realtime/realtime_model.py", line 1341, in _handle_response_output_item_done
fnc_call_info = _oai_api.create_ai_function_info(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/paula.muldoon/dev/ai/ai-livekit-agent/.venv/lib/python3.11/site-packages/livekit/agents/llm/_oai_api.py", line 72, in create_ai_function_info
sanitized_value = _sanitize_primitive(
^^^^^^^^^^^^^^^^^^^^
File "/Users/paula.muldoon/dev/ai/ai-livekit-agent/.venv/lib/python3.11/site-packages/livekit/agents/llm/_oai_api.py", line 148, in _sanitize_primitive
raise ValueError(f"expected str, got {type(value)}")
ValueError: expected str, got <class 'NoneType'>
I've managed to print out these lines from livekit/agents/llm/_oai_api.py
line 50:
How to replicate
Expected behaviour
Tool call proceeds as usual with
None
set as a parameterActual behaviour
We receive the following error message and the tool call is now able to proceed
I've managed to print out these lines from
livekit/agents/llm/_oai_api.py
line 50:
and the result is:
Versions
livekit = "0.18.1"
livekit-agents = "0.11.3"
livekit-plugins-openai = "0.10.7"
livekit-protocol = "0.7.0"
The text was updated successfully, but these errors were encountered: