Type alias CreateOpenAIFnRunnableConfig<RunInput, RunOutput>

CreateOpenAIFnRunnableConfig<RunInput, RunOutput>: {
    functions: FunctionDefinition[];
    llm: RunnableInterface<BaseLanguageModelInput, BaseMessage, BaseFunctionCallOptions>;
    prompt: BasePromptTemplate<InputValues<Extract<keyof RunInput, string>>>;
    enforceSingleFunctionUsage?: boolean;
    outputParser?: BaseOutputParser<RunOutput>;
}

Configuration params for the createOpenAIFnRunnable method.

Type Parameters

  • RunInput extends Record<string, any>

  • RunOutput

Type declaration

  • functions: FunctionDefinition[]
  • llm: RunnableInterface<BaseLanguageModelInput, BaseMessage, BaseFunctionCallOptions>

    Language model to use, assumed to support the OpenAI function-calling API.

  • prompt: BasePromptTemplate<InputValues<Extract<keyof RunInput, string>>>

    BasePromptTemplate to pass to the model.

  • Optional enforceSingleFunctionUsage?: boolean

    Only used if a single function is passed in. If true, then the model will be forced to use the given function. If false, then the model will be given the option to use the given function or not.

  • Optional outputParser?: BaseOutputParser<RunOutput>

    BaseLLMOutputParser to use for parsing model outputs. By default will be inferred from the function types.

Generated using TypeDoc