Home / Function/ get_colored_text() — langchain Function Reference

get_colored_text() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8ef29dab_0521_d1d7_4d72_cab5880a0309["get_colored_text()"]
  221c6bb5_2ec7_fbe8_1fae_cef08a34f645["input.py"]
  8ef29dab_0521_d1d7_4d72_cab5880a0309 -->|defined in| 221c6bb5_2ec7_fbe8_1fae_cef08a34f645
  2c7e4f6a_c4aa_aa10_b22c_c3c2b035744f["print_text()"]
  2c7e4f6a_c4aa_aa10_b22c_c3c2b035744f -->|calls| 8ef29dab_0521_d1d7_4d72_cab5880a0309
  style 8ef29dab_0521_d1d7_4d72_cab5880a0309 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/utils/input.py lines 38–49

def get_colored_text(text: str, color: str) -> str:
    """Get colored text.

    Args:
        text: The text to color.
        color: The color to use.

    Returns:
        The colored text.
    """
    color_str = _TEXT_COLOR_MAPPING[color]
    return f"\u001b[{color_str}m\033[1;3m{text}\u001b[0m"

Domain

Subdomains

Called By

Frequently Asked Questions

What does get_colored_text() do?
get_colored_text() is a function in the langchain codebase, defined in libs/core/langchain_core/utils/input.py.
Where is get_colored_text() defined?
get_colored_text() is defined in libs/core/langchain_core/utils/input.py at line 38.
What calls get_colored_text()?
get_colored_text() is called by 1 function(s): print_text.

Analyze Your Own Codebase

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

Try Supermodel Free