Type Alias CreateStructuredOutputRunnableConfig<RunInput, RunOutput>

CreateStructuredOutputRunnableConfig<RunInput, RunOutput>: {
    llm: RunnableInterface<BaseLanguageModelInput, BaseMessage, BaseFunctionCallOptions>;
    outputParser?: BaseOutputParser<RunOutput>;
    outputSchema: z.AnyZodObject | JsonSchema7Type;
    prompt: BasePromptTemplate<InputValues<Extract<keyof RunInput, string>>>;
}

Configuration params for the createStructuredOutputRunnable method.

Type Parameters

  • RunInput extends Record<string, any>
  • RunOutput

Type declaration

  • 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.

  • outputSchema: z.AnyZodObject | JsonSchema7Type

    Schema to output. Must be either valid JSONSchema or a Zod schema.

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

    BasePromptTemplate to pass to the model.