Home / Function/ _transform() — langchain Function Reference

_transform() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f2d3a631_3745_7a99_7dfc_8664b6a06b99["_transform()"]
  b51fd3dc_a25e_9ad9_8893_3725f5d436f0["XMLOutputParser"]
  f2d3a631_3745_7a99_7dfc_8664b6a06b99 -->|defined in| b51fd3dc_a25e_9ad9_8893_3725f5d436f0
  f2d3a631_3745_7a99_7dfc_8664b6a06b99["_transform()"]
  f2d3a631_3745_7a99_7dfc_8664b6a06b99 -->|calls| f2d3a631_3745_7a99_7dfc_8664b6a06b99
  f2d3a631_3745_7a99_7dfc_8664b6a06b99["_transform()"]
  f2d3a631_3745_7a99_7dfc_8664b6a06b99 -->|calls| f2d3a631_3745_7a99_7dfc_8664b6a06b99
  6ac405fd_5160_74ca_d2a3_72428bbea335["close()"]
  f2d3a631_3745_7a99_7dfc_8664b6a06b99 -->|calls| 6ac405fd_5160_74ca_d2a3_72428bbea335
  e9426db7_ce58_59db_1f0b_befb5eb1d7ae["parse()"]
  f2d3a631_3745_7a99_7dfc_8664b6a06b99 -->|calls| e9426db7_ce58_59db_1f0b_befb5eb1d7ae
  style f2d3a631_3745_7a99_7dfc_8664b6a06b99 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/output_parsers/xml.py lines 253–257

    def _transform(self, input: Iterator[str | BaseMessage]) -> Iterator[AddableDict]:
        streaming_parser = _StreamingParser(self.parser)
        for chunk in input:
            yield from streaming_parser.parse(chunk)
        streaming_parser.close()

Domain

Subdomains

Called By

Frequently Asked Questions

What does _transform() do?
_transform() is a function in the langchain codebase, defined in libs/core/langchain_core/output_parsers/xml.py.
Where is _transform() defined?
_transform() is defined in libs/core/langchain_core/output_parsers/xml.py at line 253.
What does _transform() call?
_transform() calls 3 function(s): _transform, close, parse.
What calls _transform()?
_transform() is called by 1 function(s): _transform.

Analyze Your Own Codebase

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

Try Supermodel Free