LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corerunnablesbaseRunnableastream_log
    Method●Since v0.1

    astream_log

    Stream all output from a Runnable, as reported to the callback system.

    This includes all inner runs of LLMs, Retrievers, Tools, etc.

    Output is streamed as Log objects, which include a list of Jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run.

    The Jsonpatch ops can be applied in order to construct state.

    Copy
    astream_log(
      self,
      input: Any,
      config: RunnableConfig | None = None,
      *,
      diff: bool = True,
      with_streamed_output_list: bool = True,
      include_names: Sequence[str] | None = None,
      include_types: Sequence[str] | None = None,
      include_tags: Sequence[str] | None = None,
      exclude_names: Sequence[str] | None = None,
      exclude_types: Sequence[str] | None = None,
      exclude_tags: Sequence[str] | None = None,
      **kwargs: Any = {}
    ) -> AsyncIterator[RunLogPatch] | AsyncIterator[RunLog]

    Parameters

    NameTypeDescription
    input*Any

    The input to the Runnable.

    configRunnableConfig | None
    Default:None

    The config to use for the Runnable.

    diffbool
    Default:True

    Whether to yield diffs between each step or the current state.

    with_streamed_output_listbool
    Default:True

    Whether to yield the streamed_output list.

    include_namesSequence[str] | None
    Default:None

    Only include logs with these names.

    include_typesSequence[str] | None
    Default:None

    Only include logs with these types.

    include_tagsSequence[str] | None
    Default:None

    Only include logs with these tags.

    exclude_namesSequence[str] | None
    Default:None

    Exclude logs with these names.

    exclude_typesSequence[str] | None
    Default:None

    Exclude logs with these types.

    exclude_tagsSequence[str] | None
    Default:None

    Exclude logs with these tags.

    **kwargsAny
    Default:{}

    Additional keyword arguments to pass to the Runnable.

    View source on GitHub