Home / Function/ on_text() — langchain Function Reference

on_text() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  6c2ae145_cb3b_ae6a_bc0c_183417224ea7["on_text()"]
  52737fd4_dd58_4289_8b70_0131f09b23a5["FileCallbackHandler"]
  6c2ae145_cb3b_ae6a_bc0c_183417224ea7 -->|defined in| 52737fd4_dd58_4289_8b70_0131f09b23a5
  efeb47b6_76c6_8f45_76b9_d26fbc90c538["_write()"]
  6c2ae145_cb3b_ae6a_bc0c_183417224ea7 -->|calls| efeb47b6_76c6_8f45_76b9_d26fbc90c538
  style 6c2ae145_cb3b_ae6a_bc0c_183417224ea7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/file.py lines 237–251

    def on_text(
        self, text: str, color: str | None = None, end: str = "", **kwargs: Any
    ) -> None:
        """Handle text output.

        Args:
            text: The text to write.
            color: Color override for this specific output.

                If `None`, uses `self.color`.
            end: String appended after the text.
            **kwargs: Additional keyword arguments.

        """
        self._write(text, color=color or self.color, end=end)

Domain

Subdomains

Calls

Frequently Asked Questions

What does on_text() do?
on_text() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/file.py.
Where is on_text() defined?
on_text() is defined in libs/core/langchain_core/callbacks/file.py at line 237.
What does on_text() call?
on_text() calls 1 function(s): _write.

Analyze Your Own Codebase

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

Try Supermodel Free