Type Alias CreateOpenAIFnRunnableConfig<RunInput, RunOutput>

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

Configuration params for the createOpenAIFnRunnable method.

Type Parameters

  • RunInput extends Record<string, any>
  • RunOutput

Type declaration

  • OptionalenforceSingleFunctionUsage?: 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.

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

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

  • OptionaloutputParser?: BaseOutputParser<RunOutput>

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

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

    BasePromptTemplate to pass to the model.