LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicagentschatbaseChatAgentcreate_prompt
    Method●Since v1.0

    create_prompt

    Create a prompt from a list of tools.

    Copy
    create_prompt(
      cls,
      tools: Sequence[BaseTool],
      system_message_prefix: str = SYSTEM_MESSAGE_PREFIX,
      system_message_suffix: str = SYSTEM_MESSAGE_SUFFIX,
      human_message: str = HUMAN_MESSAGE,
      format_instructions: str = FORMAT_INSTRUCTIONS,
      input_variables: list[str] | None = None
    ) -> BasePromptTemplate

    Parameters

    NameTypeDescription
    tools*Sequence[BaseTool]

    A list of tools.

    system_message_prefixstr
    Default:SYSTEM_MESSAGE_PREFIX

    The system message prefix.

    system_message_suffixstr
    Default:SYSTEM_MESSAGE_SUFFIX

    The system message suffix.

    human_messagestr
    Default:HUMAN_MESSAGE

    The HumanMessage.

    format_instructionsstr
    Default:FORMAT_INSTRUCTIONS

    The format instructions.

    input_variableslist[str] | None
    Default:None

    The input variables.

    View source on GitHub