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.

Use the method instead.

Hierarchy (view full)

Constructors

Properties

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

Accessors

Methods

  • 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: CallbackManager

      Optional CallbackManager to use in planning.

    Returns Promise<AgentAction | AgentFinish>

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

  • Creates a prompt for the OpenAIAgent using the provided tools and fields.

    Parameters

    • _tools: StructuredToolInterface<ZodObjectAny>[]

      The tools to be used in the prompt.

    • Optionalfields: OpenAIAgentCreatePromptArgs

      Optional fields for creating the prompt.

    Returns BasePromptTemplate<any, BasePromptValueInterface, any>

    A BasePromptTemplate object representing the created prompt.