langchain.js
    Preparing search index...

    Type Alias CreateOpenAIFnRunnableConfig<RunInput, RunOutput>

    Configuration params for the createOpenAIFnRunnable method.

    type CreateOpenAIFnRunnableConfig<
        RunInput extends Record<string, any>,
        RunOutput,
    > = {
        enforceSingleFunctionUsage?: boolean;
        functions: BaseMessage[];
        llm: BaseMessage<BaseMessage, BaseMessage, BaseMessage>;
        outputParser?: BaseMessage<RunOutput>;
        prompt: BaseMessage<BaseMessage<Extract<keyof RunInput, string>>>;
    }

    Type Parameters

    • RunInput extends Record<string, any>
    • RunOutput
    Index

    Properties

    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.

    functions: BaseMessage[]

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

    outputParser?: BaseMessage<RunOutput>

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

    prompt: BaseMessage<BaseMessage<Extract<keyof RunInput, string>>>

    BasePromptTemplate to pass to the model.