Investigate bug in Runnable Generator #74

Closed
opened 2026-02-16 00:18:39 -05:00 by yindo · 1 comment
Owner

Originally created by @eyurtsev on GitHub (Dec 21, 2023).

Originally assigned to: @eyurtsev on GitHub.

def _transform(input_stream):
    for chunk in input_stream:
        yield chunk['output']

add_routes(
    app,
    agent_executor | RunnableGenerator(_transform),
    path="/assistant",
)

https://github.com/langchain-ai/langserve/issues/314

Originally created by @eyurtsev on GitHub (Dec 21, 2023). Originally assigned to: @eyurtsev on GitHub. ``` def _transform(input_stream): for chunk in input_stream: yield chunk['output'] add_routes( app, agent_executor | RunnableGenerator(_transform), path="/assistant", ) ``` https://github.com/langchain-ai/langserve/issues/314
yindo closed this issue 2026-02-16 00:18:39 -05:00
Author
Owner

@eyurtsev commented on GitHub (Dec 21, 2023):

Not a bug, just need to provide an async version of the function

    async def gen(input: Iterator[Any]) -> Iterator[int]:
        async for x in input:
            yield x
@eyurtsev commented on GitHub (Dec 21, 2023): Not a bug, just need to provide an async version of the function ``` async def gen(input: Iterator[Any]) -> Iterator[int]: async for x in input: yield x ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langserve#74