Vercel AI adapter: yield BaseChunk from ToolReturnPart.metadata

Merged
0X
10mo ago
+651-7

Mirror the AG-UI adapter's behavior (added in #2922) for the Vercel AI adapter: check ToolReturnPart.metadata for BaseChunk objects (e.g. DataChunk) and yield them into the stream, so tool authors can send custom data chunks to the frontend.

Pre-Review Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • No breaking changes in accordance with the version policy.
  • Linting and type checking pass per make format and make typecheck.
  • PR title is fit for the release changelog.

Pre-Merge Checklist

  • New tests for any fix or new behavior, maintaining 100% coverage.
  • Updated documentation for new features and behaviors, including docstrings for API docs.