ai@7.0.128 Introduces Durable WorkflowAgent.generate, API Renames, and Middleware Enhancements
The ai@7.0.128 release updates core APIs, adds a durable non-streaming workflow method, and enhances middleware flexibility. These changes improve workflow durability, standardize function naming, and expand middleware customization options.
What changed?
The ai@7.0.128 release introduces several API and behavior updates: - The 'evaluate' function is now renamed to 'decide'. - A new durable, non-streaming 'WorkflowAgent.generate()' function has been added. It features a shared tool loop, a 20-step default iteration limit, typed output, and core generation result semantics. - Custom reasoning delimiters are now supported in 'extractReasoningMiddleware', increasing customization for how middleware parses agent output. - Tool approval state is now preserved when resuming streams.
Why does it matter to an everyday developer?
The function rename from 'evaluate' to 'decide' clarifies API intent and aligns with expected naming standards, reducing confusion for both new and existing users. The new durable 'WorkflowAgent.generate()' method provides a non-streaming option for workflow generation. It is more resilient, can be integrated with retry logic or transactional operations, and uses typed outputs to catch errors at development time. The core generation result semantics unify workflow results, making downstream processing more consistent. Support for custom reasoning delimiters in middleware enables developers to adapt parsing strategies to specific requirements or varied agent output formats.
What can the developer do now?
Developers should update their code to use 'decide' instead of the deprecated 'evaluate' function to maintain compatibility. To benefit from more robust workflows, developers can implement the new 'WorkflowAgent.generate()' in scenarios where reliable, step-limited, non-streaming agent execution is required. Middleware authors or advanced integrators can leverage custom reasoning delimiters to tailor 'extractReasoningMiddleware' to their application's agent output conventions.
