Home / Function/ on_text() — langchain Function Reference

on_text() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  c011477e_678b_fe9a_e5b4_f9b294075a13["on_text()"]
  dcf2a9b2_8ab4_fbe0_5f57_ef548417d10e["StdOutCallbackHandler"]
  c011477e_678b_fe9a_e5b4_f9b294075a13 -->|defined in| dcf2a9b2_8ab4_fbe0_5f57_ef548417d10e
  style c011477e_678b_fe9a_e5b4_f9b294075a13 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/callbacks/stdout.py lines 95–110

    def on_text(
        self,
        text: str,
        color: str | None = None,
        end: str = "",
        **kwargs: Any,
    ) -> None:
        """Run when the agent ends.

        Args:
            text: The text to print.
            color: The color to use for the text.
            end: The end character to use.
            **kwargs: Additional keyword arguments.
        """
        print_text(text, color=color or self.color, end=end)

Domain

Subdomains

Frequently Asked Questions

What does on_text() do?
on_text() is a function in the langchain codebase, defined in libs/core/langchain_core/callbacks/stdout.py.
Where is on_text() defined?
on_text() is defined in libs/core/langchain_core/callbacks/stdout.py at line 95.

Analyze Your Own Codebase

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

Try Supermodel Free