How can we deal with this: livekit.agents._excepti...
# ask-ai
m
How can we deal with this: livekit.agents._exceptions.APIStatusError: Error code: 400 - {'error': {'message': "Invalid schema for function 'post_send': In context=('properties', 'Messages', 'type', '0', 'items'), 'additionalProperties' is required to be supplied and to be false.", 'type': 'invalid_request_error', 'param': 'tools[0].function.parameters', 'code': 'invalid_function_parameters'}} (status_code=400, request_id=req_d475ee4249f94dbeb8e79aec4a856aca, body={'message': "Invalid schema for function 'post_send': In context=('properties', 'Messages', 'type', '0', 'items'), 'additionalProperties' is required to be supplied and to be false.", 'type': 'invalid_request_error', 'param': 'tools[0].function.parameters', 'code': 'invalid_function_parameters'}, retryable=True)
t
Thanks for reaching out, Muaz. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like the error is telling us that the data being sent to the API doesn’t quite match the expected JSON schema for the
post_send
function. Let’s work through this together: • First, double-check the schema definition for
post_send
. Make sure it includes a
name
,
description
, and
parameters
with
type: "object"
,
properties
, and
required
fields. • It’s important to enforce strict schema compliance by setting
additionalProperties: false
for all objects and properly validating any optional fields. • Also, please confirm that the input data exactly matches the schema, including the correct data types and structure. • If you’re working with a raw schema, double-check that it’s correctly defined and registered. • Finally, take a look at the full error response body to spot the exact field or structure causing the trouble. If you’d like, feel free to share the schema definition of
post_send
or the exact error message you’re seeing. I’m here to help you dig in and get this sorted out! Sources: agents/src/inference/utils.ts | livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/utils.py