Vibeleaderboard
← All Intel
Intel / repo

ai ai@7.0.181

Source
github.com
Author
github-actions[bot]Top Viber
Date

Context

The most useful change in ai@7.0.181, a patch release of Vercel's AI SDK (an open-source TypeScript toolkit for building AI applications and agents), is a new `stoppedBy` value that says why an agent's ended. When `generateText` or `streamText` runs with tools, the model can call a tool and the SDK starts another step. That loop keeps going until one of four things ends it: the model finishes without asking for more tools, a the developer set is met, the model calls a tool that has no `execute` function, or a tool call needs approval.

Before this release, the main clue was `finishReason`, which describes only the last model call. The SDK's loop control documentation gives an example. A loop cut off by the step limit `isStepCount(5)` still reports `tool-calls` as its finish reason, so the finish reason alone cannot show that the developer's limit ended the run and the model did not. `stoppedBy` reports the loop as a whole, with one of four values: `model`, `stop-condition`, `tool-without-execute` or `approval`.

According to the commit that added it, `model` also covers an output limit, an interrupted call and a soft error. `approval` covers pending approval requests for tools and for tools the provider runs itself, such as tools. The value appears on the `generateText` result, as `result.stoppedBy` on `streamText`, in the `onEnd` callback and in the stream's finish part. On `streamText` it behaves like `finishReason` and rejects if the stream is aborted. The other changes are listed in the release notes.

Terms in this piece · Glossary
  • agentic loop — The cycle an agent runs in: decide, call a tool, read the result, decide again — repeating until the goal is met or a stop condition fires.
  • Stop condition — A situation, named in advance, in which the agent should stop and hand the decision back to a person rather than choose a way around it.
  • Client — The program that sends a request to a server and receives its response.
  • Model Context Protocol (MCP) — A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.
More from github-actions[bot]
Recommended reads
Comments

Checking sign-in…

Loading comments…