Skip to content

Conversation

@Pederzh
Copy link
Contributor

@Pederzh Pederzh commented Jul 16, 2025

Description

🔄 Streaming Methods

  • Added stream() method for step-by-step agent execution visibility
  • Added streamEvents() method for token-level streaming with fine-grained
    event tracking

🚀 AI SDK Integration

  • Added utilities for seamless integration with Vercel AI SDK (ai package)
  • New utility functions: streamEventsToAISDK(),
    streamEventsToAISDKWithTools(), and createReadableStreamFromGenerator()
  • Full compatibility with React hooks like useCompletion and useChat

📚 Enhanced Documentation

  • Comprehensive API documentation for all streaming methods
  • Detailed examples showing differences between run(), stream(), and
    streamEvents()
  • Complete AI SDK integration guide with Next.js examples

🧪 Examples & Tests

  • Added stream_example.ts demonstrating both streaming methods
  • Added stream_events_example.ts with comprehensive streamEvents usage

Technical Details:

The implementation provides three complementary methods:

  • run(): Simple execution with final result only
  • stream(): Step-by-step execution with intermediate tool usage
  • streamEvents(): Token-level streaming with full LangChain event tracking

The AI SDK integration enables developers to build streaming UIs that can
display:

  • Real-time token-by-token responses
  • Tool usage notifications
  • Progress indicators
  • Error handling

This makes the library suitable for production chat applications, debugging
tools, and any scenario requiring real-time agent execution visibility.

@Pederzh Pederzh merged commit 7f7784b into main Jul 16, 2025
1 check passed
@Pederzh Pederzh deleted the feat/stream-event-for-ai-sdk branch July 16, 2025 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants