Embedded function calling in Workers AI: easier, smarter, faster
Jun 27, 2024Harley Turan, Dhravya Shah, Michelle Chen

Summary
Introduces embedded function calling in Workers AI, where LLM inference and function execution occur in the same runtime, eliminating network round-trips. This is facilitated by the new `ai-utils` npm package, which includes the `runWithTools` method for executing functions and handling complex agentic chains, and `createToolsFromOpenAPISpec` for dynamically generating tools from OpenAPI specifications. The `autoTrimTools` helper function is also introduced to optimize token usage by intelligently selecting relevant tools.
More from the Artificial Intelligence Integration & Impact trail
- Introducing Clef-omni with full multimodality, plus a faster Clef and a cheaper Clef-flash
- Introducing Web Search API via AI Gateway
- Introducing Clef: our open-source decision models, and new RL fine-tuning platform
- One year later: Sovereign AI and the fight for choice
- AI Search is now generally available