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-classicagentsconversationalbaseConversationalAgentcreate_prompt
    Method●Since v1.0

    create_prompt

    Create prompt in the style of the zero-shot agent.

    Copy
    create_prompt(
      cls,
      tools: Sequence[BaseTool],
      prefix: str = PREFIX,
      suffix: str = SUFFIX,
      format_instructions: str = FORMAT_INSTRUCTIONS,
      ai_prefix: str = 'AI',
      human_prefix: str = 'Human',
      input_variables: list[str] | None = None
    ) -> PromptTemplate

    Parameters

    NameTypeDescription
    tools*Sequence[BaseTool]

    List of tools the agent will have access to, used to format the prompt.

    prefixstr
    Default:PREFIX

    String to put before the list of tools.

    suffixstr
    Default:SUFFIX

    String to put after the list of tools.

    format_instructionsstr
    Default:FORMAT_INSTRUCTIONS

    Instructions on how to use the tools.

    ai_prefixstr
    Default:'AI'

    String to use before AI output.

    human_prefixstr
    Default:'Human'

    String to use before human output.

    input_variableslist[str] | None
    Default:None

    List of input variables the final prompt will expect. Defaults to ["input", "chat_history", "agent_scratchpad"].

    View source on GitHub