Skip to main content
Ctrl+K
🦜🔗 LangChain  documentation - Home
  • Reference
  • Legacy reference
Ctrl+K
Docs
  • GitHub
  • X / Twitter
Ctrl+K
  • Reference
  • Legacy 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
    • graph_vectorstores
    • indexing
    • language_models
    • load
    • memory
    • 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_openai_function
      • convert_to_openai_tool
      • tool_example_to_messages
      • extract_sub_links
      • find_all_links
      • encode_image
      • image_to_data_url
      • 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
      • 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
  • Airbyte
  • Anthropic
  • AstraDB
  • AWS
  • Azure Dynamic Sessions
  • Box
  • Chroma
  • Cohere
  • Couchbase
  • Elasticsearch
  • Exa
  • Fireworks
  • Google Community
  • Google GenAI
  • Google VertexAI
  • Groq
  • Huggingface
  • Milvus
  • MistralAI
  • MongoDB
  • Nomic
  • Nvidia Ai Endpoints
  • Ollama
  • OpenAI
  • Pinecone
  • Postgres
  • Prompty
  • Qdrant
  • Robocorp
  • Together
  • Unstructured
  • VoyageAI
  • Weaviate
  • LangChain Python API Reference
  • 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 2023, LangChain Inc.