Skip to main content
Ctrl+K
🦜🔗 LangChain  documentation - Home 🦜🔗 LangChain  documentation - Home
  • Reference
Ctrl+K
Docs
  • GitHub
  • X / Twitter
Ctrl+K
  • Reference
Docs
  • GitHub
  • X / Twitter

Section Navigation

Base packages

  • Core
    • agents
    • beta
    • caches
    • callbacks
    • chat_history
    • chat_loaders
    • chat_sessions
    • document_loaders
    • documents
    • embeddings
    • example_selectors
    • exceptions
    • globals
    • indexing
    • language_models
    • load
    • messages
    • output_parsers
    • outputs
    • prompt_values
    • prompts
    • rate_limiters
    • retrievers
    • runnables
    • stores
    • structured_query
    • sys_info
    • tools
    • tracers
    • utils
      • NoLock
      • Tee
      • aclosing
      • atee
      • StrictFormatter
      • FunctionDescription
      • ToolDescription
      • NoLock
      • Tee
      • safetee
      • ChevronError
      • abatch_iterate
      • py_anext
      • tee_peer
      • env_var_is_set
      • get_from_dict_or_env
      • get_from_env
      • convert_to_json_schema
      • convert_to_openai_function
      • convert_to_openai_tool
      • tool_example_to_messages
      • extract_sub_links
      • find_all_links
      • get_bolded_text
      • get_color_mapping
      • get_colored_text
      • print_text
      • is_interactive_env
      • batch_iterate
      • tee_peer
      • parse_and_check_json_markdown
      • parse_json_markdown
      • parse_partial_json
      • dereference_refs
      • grab_literal
      • l_sa_check
      • parse_tag
      • r_sa_check
      • render
      • tokenize
      • create_model
      • create_model_v2
      • get_fields
      • get_pydantic_major_version
      • is_basemodel_instance
      • is_basemodel_subclass
      • is_pydantic_v1_subclass
      • is_pydantic_v2_subclass
      • pre_init
      • comma_list
      • stringify_dict
      • stringify_value
      • build_extra_kwargs
      • check_package_version
      • convert_to_secret_str
      • from_env
      • get_pydantic_field_names
      • guard_import
      • mock_now
      • raise_for_status_with_text
      • secret_from_env
      • xor_args
      • convert_pydantic_to_openai_function
      • convert_pydantic_to_openai_tool
      • convert_python_function_to_openai_function
      • format_tool_to_openai_function
      • format_tool_to_openai_tool
      • try_load_from_hub
    • vectorstores
  • Langchain
  • Text Splitters
  • Community
  • Experimental

Integrations

  • AI21
  • Anthropic
  • AstraDB
  • AWS
  • Azure Ai
  • Azure Dynamic Sessions
  • Cerebras
  • Chroma
  • Cohere
  • Deepseek
  • Elasticsearch
  • Exa
  • Fireworks
  • Google Community
  • Google GenAI
  • Google VertexAI
  • Groq
  • Huggingface
  • IBM
  • Milvus
  • MistralAI
  • MongoDB
  • Neo4J
  • Nomic
  • Nvidia Ai Endpoints
  • Ollama
  • OpenAI
  • Perplexity
  • Pinecone
  • Postgres
  • Prompty
  • Qdrant
  • Redis
  • Sema4
  • Snowflake
  • Sqlserver
  • Standard Tests
  • Tavily
  • Together
  • Unstructured
  • Upstage
  • Weaviate
  • XAI
  • LangChain Python API Reference
  • langchain-core: 0.3.64
  • utils
  • print_text

print_text#

langchain_core.utils.input.print_text(
text: str,
color: str | None = None,
end: str = '',
file: TextIO | None = None,
) → None[source]#

Print text with highlighting and no end characters.

If a color is provided, the text will be printed in that color. If a file is provided, the text will be written to that file.

Parameters:
  • text (str) – The text to print.

  • color (str | None) – The color to use. Defaults to None.

  • end (str) – The end character to use. Defaults to “”.

  • file (TextIO | None) – The file to write to. Defaults to None.

Return type:

None

On this page
  • print_text()

© Copyright 2025, LangChain Inc.