steep-balloon-41261
08/27/2025, 10:03 PMtall-airline-16756
08/27/2025, 10:03 PMtall-airline-16756
08/27/2025, 10:04 PM@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.tstall-airline-16756
08/27/2025, 10:04 PM