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
{{ message }}
Repository navigation
function tool arg default value cannot be None #2186
Issue 1: the default value of the arg of function tool cannot be None
@function_tool()asyncdefupdate_caller_status(
context: RunContext_T,
caller_name: Optional[str] =None,
) ->str:
logger.info(f"Updating caller status to {caller_name}")
return"ok"
for example this one raises
livekit.agents._exceptions.APIStatusError: Error code: 400 - {'error': {'message': "Invalid schema for function 'update_caller_status': In context=('properties', 'caller_name'), 'default' is not permitted.", 'type': 'invalid_request_error', 'param': 'tools[0].function.parameters', 'code': 'invalid_function_parameters'}} (status_code=400, request_id=req_69d97bdefaaaa6f45cf652fbe439f4b1, body={'message': "Invalid schema for function 'update_caller_status': In context=('properties', 'caller_name'), 'default' is not permitted.", 'type': 'invalid_request_error', 'param': 'tools[0].function.parameters', 'code': 'invalid_function_parameters'})
the schema generated by build_strict_openai_schema is
Activity