Class representing an agent for the OpenAI chat model in LangChain. It extends the Agent class and provides additional functionality specific to the OpenAIAgent type.

Hierarchy (view full)

Constructors

Properties

ToolType: StructuredToolInterface
llmChain: LLMChain<string, any>
tools: StructuredToolInterface[]

Accessors

Methods

  • Constructs a scratch pad from a list of agent steps.

    Parameters

    • steps: AgentStep[]

      The steps to include in the scratch pad.

    Returns Promise<string | BaseMessage[]>

    A string or a list of BaseMessages representing the constructed scratch pad.

  • Plans the next action or finish state of the agent based on the provided steps, inputs, and optional callback manager.

    Parameters

    • steps: AgentStep[]

      The steps to consider in planning.

    • inputs: ChainValues

      The inputs to consider in planning.

    • OptionalcallbackManager: any

      Optional CallbackManager to use in planning.

    Returns Promise<any>

    A Promise that resolves to an AgentAction or AgentFinish object representing the planned action or finish state.

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

    Parameters

    • earlyStoppingMethod: StoppingMethod
    • steps: AgentStep[]
    • inputs: ChainValues
    • OptionalcallbackManager: any

    Returns Promise<AgentFinish>