
6/27/2024 · Harley Turan, Dhravya Shah, Michelle Chen
What this post added
Introduces embedded function calling in Workers AI, allowing LLM inference and function execution within the same environment to reduce latency and complexity. This is facilitated by the new `@cloudflare/ai-utils` npm package, which includes the `runWithTools` function for executing LLM inference and provided function code in a single step, and `createToolsFromOpenAPISpec` for dynamically generating tools from OpenAPI specifications. The `autoTrimTools` helper function is also introduced to optimize token usage by pre-selecting relevant tools.