This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Billy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Here’s a friendly guide to make sure all your functions get called just right when using LLMs in LiveKit: • Define Functions Properly: Make sure to use the right decorators or schemas (like
@ai_callable
in Python or
FunctionContext
in Node.js) and include clear type annotations and descriptions. This helps everything run smoothly. • Execute Functions Explicitly: Remember to call
execute_functions()
(Python) or
executeFunctions()
(Node.js) to actually run your functions—these won’t execute on their own. • Handle Errors: It’s a good idea to add error handling inside your functions and when you run them. Tools like
asyncio.gather()
or
Promise.all()
can help you manage multiple calls without a hitch. • Manage Arguments: Double-check that arguments like enums, arrays, and optional parameters are set up and handled correctly to avoid surprises. • Control Behavior: Use the
tool_choice
parameter to decide which functions should be called or skipped—giving you more control over the process. • Test Thoroughly: Don’t forget to use LiveKit’s testing framework to make sure your functions behave as expected, even in tricky edge cases. Following these tips will help you feel confident that all your important functions are called reliably during execution. If you run into any bumps, we’re here to help! Sources: livekit-agents/livekit/agents/llm/_provider_format/utils.py | plugins/test/src/llm.ts
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!