Skip to content

Conversation

Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Sep 3, 2025

Enhance streaming in RunnableRails to include generation metadata in streamed chunks. Skips END_OF_STREAM markers and updates chunk formatting to support metadata for AIMessageChunk outputs. This improves compatibility with consumers expecting metadata in streaming responses.

@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch from 78d5038 to 2ddc4f3 Compare September 3, 2025 09:25
@Pouyanpi Pouyanpi changed the title feat(langchain): stream metadata in RunnableRails output feat(runnable-rails): stream metadata in RunnableRails output Sep 3, 2025
@Pouyanpi Pouyanpi added enhancement New feature or request runnable labels Sep 3, 2025
@Pouyanpi Pouyanpi added this to the v0.17.0 milestone Sep 3, 2025
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-ai-message branch from 8e1033c to 1c5837e Compare September 3, 2025 10:13
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch from 2ddc4f3 to 22b4d89 Compare September 3, 2025 10:14
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-ai-message branch from 1c5837e to 6a6050b Compare September 3, 2025 10:29
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch from 22b4d89 to 8238039 Compare September 3, 2025 10:31
@Pouyanpi Pouyanpi self-assigned this Sep 3, 2025
@Pouyanpi Pouyanpi marked this pull request as draft September 3, 2025 10:52
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-ai-message branch from 6a6050b to ce4d6c1 Compare September 9, 2025 09:27
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch from 8238039 to eb2d49c Compare September 9, 2025 09:37
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-ai-message branch from ce4d6c1 to 0b114ba Compare September 9, 2025 09:40
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch from eb2d49c to f8004f8 Compare September 9, 2025 09:41
@Pouyanpi Pouyanpi requested a review from Copilot September 9, 2025 09:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the RunnableRails streaming functionality to include generation metadata in streamed chunks and improves compatibility with consumers expecting metadata in streaming responses. The changes focus on filtering out END_OF_STREAM markers and updating chunk formatting to properly support metadata for AIMessageChunk outputs.

  • Updates streaming methods to include generation metadata in chunks
  • Adds logic to skip END_OF_STREAM markers during streaming
  • Enhances chunk formatting to handle metadata alongside text content

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/runnable_rails/test_streaming.py Removes outdated comments and adds new tests for metadata preservation and chunk type validation
tests/runnable_rails/test_metadata.py Adds comprehensive test coverage for streaming metadata preservation in both sync and async scenarios
nemoguardrails/integrations/langchain/runnable_rails.py Updates streaming implementation to handle metadata and filter END_OF_STREAM markers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Pouyanpi Pouyanpi marked this pull request as ready for review September 10, 2025 12:47
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-ai-message branch from 0b114ba to 0e0ea4f Compare September 15, 2025 09:38
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch 3 times, most recently from a50901b to a0c0e24 Compare September 15, 2025 09:53
Enhance streaming in RunnableRails to include generation metadata in
streamed chunks. Skips END_OF_STREAM markers and updates chunk formatting
to support metadata for AIMessageChunk outputs. This improves compatibility
with consumers expecting metadata in streaming responses.

fix

fix
@Pouyanpi Pouyanpi force-pushed the feat/runnable-rails-streaming-metadata branch from a0c0e24 to d256fe3 Compare September 15, 2025 09:53
@Pouyanpi Pouyanpi requested a review from tgasser-nv September 15, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request runnable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant