Class OCRRequest.OCRRequestBuilder

java.lang.Object
nl.dannyj.mistral.models.ocr.OCRRequest.OCRRequestBuilder
Enclosing class:
OCRRequest

public static class OCRRequest.OCRRequestBuilder extends Object
  • Method Details

    • model

      public OCRRequest.OCRRequestBuilder model(String model)
      ID of the model to use.
      Parameters:
      model - The model's ID. Can't be null.
      Returns:
      this.
    • id

      Optional ID for the request.
      Parameters:
      id - The optional ID for the request.
      Returns:
      this.
    • document

      public OCRRequest.OCRRequestBuilder document(ContentChunk document)
      Document to run OCR on. Can be a DocumentURLChunk or an ImageURLChunk.
      Parameters:
      document - The document to run OCR on. Can be a DocumentURLChunk or an ImageURLChunk. Can't be null.
      Returns:
      this.
    • pages

      public OCRRequest.OCRRequestBuilder pages(List<Integer> pages)
      Specific pages user wants to process in various formats: single number, range, or list of both. Starts from 0.
      Parameters:
      pages - A list of specific page indices to process. Starts from 0. Null to process all pages.
      Returns:
      this.
    • includeImageBase64

      public OCRRequest.OCRRequestBuilder includeImageBase64(Boolean includeImageBase64)
      Include image URLs in response.
      Parameters:
      includeImageBase64 - Whether to include image URLs in the response. Null for default behavior.
      Returns:
      this.
    • imageLimit

      public OCRRequest.OCRRequestBuilder imageLimit(Integer imageLimit)
      Maximum images to extract.
      Parameters:
      imageLimit - The maximum number of images to extract. Null for default behavior.
      Returns:
      this.
    • imageMinSize

      public OCRRequest.OCRRequestBuilder imageMinSize(Integer imageMinSize)
      Minimum height and width of image to extract.
      Parameters:
      imageMinSize - The minimum height and width of images to extract. Null for default behavior.
      Returns:
      this.
    • build

      public OCRRequest build()
    • toString

      public String toString()
      Overrides:
      toString in class Object