MCPcopy
hub / github.com/langchain-ai/langchain / astream

Method astream

libs/core/langchain_core/runnables/base.py:818–828  ·  view source on GitHub ↗

Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output.

(
        self,
        input: Input,
        config: Optional[RunnableConfig] = None,
        **kwargs: Optional[Any],
    )

Source from the content-addressed store, hash-verified

816 yield self.invoke(input, config, **kwargs)
817
818 async def astream(
819 self,
820 input: Input,
821 config: Optional[RunnableConfig] = None,
822 **kwargs: Optional[Any],
823 ) -> AsyncIterator[Output]:
824 """
825 Default implementation of astream, which calls ainvoke.
826 Subclasses should override this method if they support streaming output.
827 """
828 yield await self.ainvoke(input, config, **kwargs)
829
830 @overload
831 def astream_log(

Callers 15

atransformMethod · 0.95
test_astreamFunction · 0.45
test_astreamFunction · 0.45
test_astreamFunction · 0.45
test_astreamFunction · 0.45
test_astreamFunction · 0.45
test_async_tool_useFunction · 0.45
test_openai_astreamFunction · 0.45
test_astreamFunction · 0.45
test_openai_astreamFunction · 0.45

Calls 1

ainvokeMethod · 0.95

Tested by 15

test_astreamFunction · 0.36
test_astreamFunction · 0.36
test_astreamFunction · 0.36
test_astreamFunction · 0.36
test_astreamFunction · 0.36
test_async_tool_useFunction · 0.36
test_openai_astreamFunction · 0.36
test_astreamFunction · 0.36
test_openai_astreamFunction · 0.36
test_openai_astreamFunction · 0.36