Function generate

  • Generates, using OpenAI's API, data according to given output specifications and inputs.

    Type Parameters

    • O extends Specs

      Type of the outputs, extending Specs.

    • I extends Inputs

      Type of the inputs, extending Inputs.

    Parameters

    • outputSpecs: O

      Output specifications for the generation.

    • Optional inputs: I

      Inputs for the generation.

    • Optional options: GenerateOptions<O, I>

      Options for the generation.

    Returns Promise<MatchingOutput<O> | undefined>

    Generated data according to the output specifications, or undefined if the generation failed and options.throwOnFailure is false.

    Throws

    if an error occurred and options.throwOnFailure is true.

Generated using TypeDoc