Skip to content

feat(ai): send context into streamText / generateText onFinish callbacks#11029

Merged
lgrammel merged 8 commits intomainfrom
lg/8VUx03xa
Dec 10, 2025
Merged

feat(ai): send context into streamText / generateText onFinish callbacks#11029
lgrammel merged 8 commits intomainfrom
lg/8VUx03xa

Conversation

@lgrammel
Copy link
Copy Markdown
Collaborator

@lgrammel lgrammel commented Dec 10, 2025

Background

Having context available in onFinish can help with tearing down resources.

Summary

Pass context into the onFinish handlers of streamText and generateText.

Tasks

  • generateText
  • streamText
  • docs: generateText reference
  • docs: streamText reference
  • changeset

@ghost ghost added the ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. label Dec 10, 2025
@lgrammel lgrammel changed the title 1 feat(ai): send context into streamText / generateText onFinish callbacks Dec 10, 2025
@lgrammel lgrammel marked this pull request as ready for review December 10, 2025 10:20
@lgrammel lgrammel enabled auto-merge (squash) December 10, 2025 10:22
@lgrammel lgrammel merged commit b1405bf into main Dec 10, 2025
19 checks passed
@lgrammel lgrammel deleted the lg/8VUx03xa branch December 10, 2025 10:22
lgrammel added a commit that referenced this pull request Dec 10, 2025
## Background

Context needed to be supported in `ToolLoopAgent` `onFinish` as well.

## Summary

Add `experimental_context` to `ToolLoopAgent.onFinish` callback
definition.

## Related Issues

Follow up from #11029
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants