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-classicagentsself_ask_with_searchbase
    Module●Since v1.0

    base

    Chain that does self-ask with search.

    Attributes

    attribute
    PROMPT

    Functions

    function
    format_log_to_str

    Construct the scratchpad that lets the agent continue its thought process.

    function
    validate_tools_single_input

    Validate tools for single input.

    function
    create_self_ask_with_search_agent

    Create an agent that uses self-ask with search prompting.

    Classes

    class
    AgentExecutor

    Agent that is using tools.

    class
    AgentOutputParser

    Base class for parsing agent output into agent action/finish.

    class
    SelfAskOutputParser

    Parses self-ask style LLM calls.

    Expects output to be in one of two formats.

    If the output signals that an action should be taken, should be in the below format. This will result in an AgentAction being returned.

    Thoughts go here...
    Follow up: what is the temperature in SF?
    

    If the output signals that a final answer should be given, should be in the below format. This will result in an AgentFinish being returned.

    Thoughts go here...
    So the final answer is: The temperature is 100 degrees
    
    deprecatedclass
    Agent

    Agent that calls the language model and deciding the action.

    This is driven by a LLMChain. The prompt in the LLMChain MUST include a variable called "agent_scratchpad" where the agent can put its intermediary work.

    deprecatedclass
    AgentType

    An enum for agent types.

    deprecatedclass
    SelfAskWithSearchAgent

    Agent for the self-ask-with-search paper.

    deprecatedclass
    SelfAskWithSearchChain

    [Deprecated] Chain that does self-ask with search.

    View source on GitHub