Record Class MistralOcrApi.OCRRequest
java.lang.Object
java.lang.Record
org.springframework.ai.mistralai.ocr.MistralOcrApi.OCRRequest
- Record Components:
model
- Model to use for OCR. Can be 'mistral-ocr-latest'id
- An optional string identifier.document
- Document to run OCR on. Can be either aMistralOcrApi.OCRRequest.DocumentURLChunk
or anMistralOcrApi.OCRRequest.ImageURLChunk
.pages
- Specific pages to process in various formats: single number, range, or list of both. Starts from 0.includeImageBase64
- Whether to include image URLs in the response.imageLimit
- Maximum number of images to extract.imageMinSize
- Minimum height and width of image to extract.
- Enclosing class:
- MistralOcrApi
public static record MistralOcrApi.OCRRequest(String model, String id, MistralOcrApi.OCRRequest.Document document, List<Integer> pages, Boolean includeImageBase64, Integer imageLimit, Integer imageMinSize)
extends Record
Represents the request for the OCR API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Represents the document to be processed, which can be either a document URL or an image URL.static final record
Represents a document URL chunk.static final record
Represents an image URL chunk. -
Constructor Summary
ConstructorsConstructorDescriptionOCRRequest
(String model, String id, MistralOcrApi.OCRRequest.Document document, List<Integer> pages, Boolean includeImageBase64, Integer imageLimit, Integer imageMinSize) Creates an instance of aOCRRequest
record class.OCRRequest
(String model, MistralOcrApi.OCRRequest.Document document) Create an OCRRequest. -
Method Summary
Modifier and TypeMethodDescriptiondocument()
Returns the value of thedocument
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.id()
Returns the value of theid
record component.Returns the value of theimageLimit
record component.Returns the value of theimageMinSize
record component.Returns the value of theincludeImageBase64
record component.model()
Returns the value of themodel
record component.pages()
Returns the value of thepages
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
OCRRequest
Create an OCRRequest.- Parameters:
model
- The model to use for OCR.document
- Document to run OCR on.
-
OCRRequest
public OCRRequest(String model, String id, MistralOcrApi.OCRRequest.Document document, List<Integer> pages, Boolean includeImageBase64, Integer imageLimit, Integer imageMinSize) Creates an instance of aOCRRequest
record class.- Parameters:
model
- the value for themodel
record componentid
- the value for theid
record componentdocument
- the value for thedocument
record componentpages
- the value for thepages
record componentincludeImageBase64
- the value for theincludeImageBase64
record componentimageLimit
- the value for theimageLimit
record componentimageMinSize
- the value for theimageMinSize
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
model
Returns the value of themodel
record component.- Returns:
- the value of the
model
record component
-
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
document
Returns the value of thedocument
record component.- Returns:
- the value of the
document
record component
-
pages
Returns the value of thepages
record component.- Returns:
- the value of the
pages
record component
-
includeImageBase64
Returns the value of theincludeImageBase64
record component.- Returns:
- the value of the
includeImageBase64
record component
-
imageLimit
Returns the value of theimageLimit
record component.- Returns:
- the value of the
imageLimit
record component
-
imageMinSize
Returns the value of theimageMinSize
record component.- Returns:
- the value of the
imageMinSize
record component
-