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-classicagentsagentRunnableAgent
    Class●Since v1.0

    RunnableAgent

    Agent powered by Runnables.

    Copy
    RunnableAgent()

    Bases

    BaseSingleActionAgent

    Attributes

    attribute
    runnable: Runnable[dict, AgentAction | AgentFinish]

    Runnable to call to get agent action.

    attribute
    input_keys_arg: list[str]
    attribute
    return_keys_arg: list[str]
    attribute
    stream_runnable: bool

    Whether to stream from the runnable or not.

    If True then underlying LLM is invoked in a streaming fashion to make it possible to get access to the individual LLM tokens when using stream_log with the AgentExecutor. If False then LLM is invoked in a non-streaming fashion and individual LLM tokens will not be available in stream_log.

    attribute
    model_config
    attribute
    return_values: list[str]

    Return values of the agent.

    attribute
    input_keys: list[str]

    Return the input keys.

    Methods

    method
    plan

    Based on past history and current inputs, decide what to do.

    method
    aplan

    Async based on past history and current inputs, decide what to do.

    Inherited fromBaseSingleActionAgent

    Methods

    Mget_allowed_tools
    —

    Get allowed tools.

    Mreturn_stopped_response
    —

    Return response when agent has been stopped due to max iterations.

    Mfrom_llm_and_tools
    —

    Construct an agent from an LLM and tools.

    Mdict
    —

    Return dictionary representation of agent.

    Msave
    —

    Save the agent.

    Mtool_run_logging_kwargs
    —

    Return logging kwargs for tool run.

    View source on GitHub