Home / Function/ transform() — langchain Function Reference

transform() — langchain Function Reference

Architecture documentation for the transform() function in transform.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  b6fc2542_dbab_dbab_1798_f09e2d369571["transform()"]
  31a97691_3fec_0f65_0661_c4d496bb962f["BaseTransformOutputParser"]
  b6fc2542_dbab_dbab_1798_f09e2d369571 -->|defined in| 31a97691_3fec_0f65_0661_c4d496bb962f
  style b6fc2542_dbab_dbab_1798_f09e2d369571 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/output_parsers/transform.py lines 56–74

    def transform(
        self,
        input: Iterator[str | BaseMessage],
        config: RunnableConfig | None = None,
        **kwargs: Any,
    ) -> Iterator[T]:
        """Transform the input into the output format.

        Args:
            input: The input to transform.
            config: The configuration to use for the transformation.
            **kwargs: Additional keyword arguments.

        Yields:
            The transformed output.
        """
        yield from self._transform_stream_with_config(
            input, self._transform, config, run_type="parser"
        )

Domain

Subdomains

Frequently Asked Questions

What does transform() do?
transform() is a function in the langchain codebase, defined in libs/core/langchain_core/output_parsers/transform.py.
Where is transform() defined?
transform() is defined in libs/core/langchain_core/output_parsers/transform.py at line 56.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free