Skip to content

docs: add ToolLoopAgent testing example#12656

Open
sleitor wants to merge 1 commit intovercel:mainfrom
sleitor:docs/testing-tool-loop-agent
Open

docs: add ToolLoopAgent testing example#12656
sleitor wants to merge 1 commit intovercel:mainfrom
sleitor:docs/testing-tool-loop-agent

Conversation

@sleitor
Copy link
Copy Markdown
Contributor

@sleitor sleitor commented Feb 17, 2026

What?

Add a testing example for ToolLoopAgent to the Testing docs.

Why?

The testing page covers generateText, streamText, generateObject, and streamObject, but has no example for ToolLoopAgent. This was reported in #12616.

How?

Added a section showing how to use MockLanguageModelV3 with mockValues to simulate a multi-step tool loop:

  1. Step 1: Mock model returns a tool-call (weather tool)
  2. Tool executes: Returns mock weather data
  3. Step 2: Mock model returns final text response

The example demonstrates the key pattern for testing agents: providing multiple mock responses via mockValues to simulate the tool loop.

Fixes #12616

Add a testing example for ToolLoopAgent that demonstrates how to use
MockLanguageModelV3 with mockValues to simulate a multi-step tool loop:
first step returns a tool call, tool executes, second step returns
final text.

Fixes vercel#12616
@tigent tigent Bot added ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. documentation Improvements or additions to documentation labels Feb 17, 2026
@sleitor
Copy link
Copy Markdown
Contributor Author

sleitor commented Apr 7, 2026

👋 Gentle ping — just checking if this is still on the radar for review. Happy to address any feedback or rebase if needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide an example for ToolLoopAgent in testing.

1 participant