SwiftstructTextUnderstanding

struct TextUnderstanding.ExtractionRecipe

Members 9

  1. funcstatic guidedExtraction(options: TextUnderstanding.Request.GuidedExtractionOptions, documentKind: TextUnderstanding.Document.Kind) throws(TextUnderstanding.TextProcessingError) -> TextUnderstanding.ExtractionRecipe
  2. fieldlet recipeType: TextUnderstanding.ExtractionRecipe.RecipeType
  3. varvar bindingTable: [String : TextUnderstanding.ExtractionRecipe.BindingVariableValue] { get }
  4. varvar modelBundleIdentifier: String { get }
  5. varvar promptTemplateIdentifier: String { get }
  6. varvar samplingParameters: TokenGeneration.SamplingParameters { get }
  7. varvar schema: GenerativeFunctionsFoundation.Schema { get }
  8. varvar useCaseIdentifier: String { get }
  9. varvar useResponseFormat: Bool { get }
struct ExtractionRecipe {
    enum RecipeType {
        case guidedExtraction(TextUnderstanding.ExtractionRecipe.GuidedExtractionRecipe)
    }
    enum BindingVariableValue {
        case string(Swift.String)
        case image(TextUnderstanding.ExtractionRecipe.ImageOptions)
        case ocr(TextUnderstanding.ExtractionRecipe.OCROptions)
    }
    struct ImageOptions {
        let maxDimension: Swift.Int?

        init(maxDimension: Swift.Int?)
    }
    struct OCROptions {
        init()
    }
    struct GuidedExtractionRecipe {
        let promptTemplateIdentifier: Swift.String
        let schema: GenerativeFunctionsFoundation.Schema
        let samplingParameters: TokenGeneration.SamplingParameters
        let useResponseFormat: Swift.Bool
        let bindingTable: [Swift.String : TextUnderstanding.ExtractionRecipe.BindingVariableValue]
        let modelBundleIdentifier: Swift.String
        let useCaseIdentifier: Swift.String
    }
    let recipeType: TextUnderstanding.ExtractionRecipe.RecipeType

    var bindingTable: [Swift.String : TextUnderstanding.ExtractionRecipe.BindingVariableValue] {
        get
    }
    var modelBundleIdentifier: Swift.String {
        get
    }
    var promptTemplateIdentifier: Swift.String {
        get
    }
    var samplingParameters: TokenGeneration.SamplingParameters {
        get
    }
    var schema: GenerativeFunctionsFoundation.Schema {
        get
    }
    var useCaseIdentifier: Swift.String {
        get
    }
    var useResponseFormat: Swift.Bool {
        get
    }

    static func guidedExtraction(options: TextUnderstanding.Request.GuidedExtractionOptions, documentKind: TextUnderstanding.Document.Kind) throws(TextUnderstanding.TextProcessingError) -> TextUnderstanding.ExtractionRecipe
}