BEG
Nov 25

Preliminary Tool Results

Return preliminary tool results using async iterables. Stream status updates during tool execution before the final result is available.

View Full Pattern on Desktop
Preliminary Tool Results preview

Problems Solved

  • Stream preliminary tool results during execution
  • Provide status updates before final result
  • Use async iterables for progressive tool results
  • Display intermediate states during tool execution

Use Cases

  • Streaming tool execution status
  • Progressive tool result updates
  • Long-running tool operations
  • Understanding async generator tool patterns

AI SDK APIs

streamTextconvertToModelMessagestool(useChatasync-generator

Tags

aitoolspreliminary-resultsasync-iterablesgenerator-functionsstreamingai-sdktool-api

Requirements

Node.js
18+
Memory
512MB
Other
  • OpenAI API key

Environment Variables

External Services

openai

Ready to use?

View the full interactive pattern with live preview and copy the source code.

View Pattern on Desktop
End of Pattern