#[non_exhaustive]pub struct ClassifyDocumentOutput {
pub classes: Option<Vec<DocumentClass>>,
pub labels: Option<Vec<DocumentLabel>>,
pub document_metadata: Option<DocumentMetadata>,
pub document_type: Option<Vec<DocumentTypeListItem>>,
pub errors: Option<Vec<ErrorsListItem>>,
pub warnings: Option<Vec<WarningsListItem>>,
/* private fields */
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.classes: Option<Vec<DocumentClass>>
The classes used by the document being analyzed. These are used for models trained in multi-class mode. Individual classes are mutually exclusive and each document is expected to have only a single class assigned to it. For example, an animal can be a dog or a cat, but not both at the same time.
For prompt safety classification, the response includes only two classes (SAFE_PROMPT and UNSAFE_PROMPT), along with a confidence score for each class. The value range of the score is zero to one, where one is the highest confidence.
labels: Option<Vec<DocumentLabel>>
The labels used in the document being analyzed. These are used for multi-label trained models. Individual labels represent different categories that are related in some manner and are not mutually exclusive. For example, a movie can be just an action movie, or it can be an action movie, a science fiction movie, and a comedy, all at the same time.
document_metadata: Option<DocumentMetadata>
Extraction information about the document. This field is present in the response only if your request includes the Byte
parameter.
document_type: Option<Vec<DocumentTypeListItem>>
The document type for each page in the input document. This field is present in the response only if your request includes the Byte
parameter.
errors: Option<Vec<ErrorsListItem>>
Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.
warnings: Option<Vec<WarningsListItem>>
Warnings detected while processing the input document. The response includes a warning if there is a mismatch between the input document type and the model type associated with the endpoint that you specified. The response can also include warnings for individual pages that have a mismatch.
The field is empty if the system generated no warnings.
Implementations§
source§impl ClassifyDocumentOutput
impl ClassifyDocumentOutput
sourcepub fn classes(&self) -> &[DocumentClass]
pub fn classes(&self) -> &[DocumentClass]
The classes used by the document being analyzed. These are used for models trained in multi-class mode. Individual classes are mutually exclusive and each document is expected to have only a single class assigned to it. For example, an animal can be a dog or a cat, but not both at the same time.
For prompt safety classification, the response includes only two classes (SAFE_PROMPT and UNSAFE_PROMPT), along with a confidence score for each class. The value range of the score is zero to one, where one is the highest confidence.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .classes.is_none()
.
sourcepub fn labels(&self) -> &[DocumentLabel]
pub fn labels(&self) -> &[DocumentLabel]
The labels used in the document being analyzed. These are used for multi-label trained models. Individual labels represent different categories that are related in some manner and are not mutually exclusive. For example, a movie can be just an action movie, or it can be an action movie, a science fiction movie, and a comedy, all at the same time.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .labels.is_none()
.
sourcepub fn document_metadata(&self) -> Option<&DocumentMetadata>
pub fn document_metadata(&self) -> Option<&DocumentMetadata>
Extraction information about the document. This field is present in the response only if your request includes the Byte
parameter.
sourcepub fn document_type(&self) -> &[DocumentTypeListItem]
pub fn document_type(&self) -> &[DocumentTypeListItem]
The document type for each page in the input document. This field is present in the response only if your request includes the Byte
parameter.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .document_type.is_none()
.
sourcepub fn errors(&self) -> &[ErrorsListItem]
pub fn errors(&self) -> &[ErrorsListItem]
Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .errors.is_none()
.
sourcepub fn warnings(&self) -> &[WarningsListItem]
pub fn warnings(&self) -> &[WarningsListItem]
Warnings detected while processing the input document. The response includes a warning if there is a mismatch between the input document type and the model type associated with the endpoint that you specified. The response can also include warnings for individual pages that have a mismatch.
The field is empty if the system generated no warnings.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .warnings.is_none()
.
source§impl ClassifyDocumentOutput
impl ClassifyDocumentOutput
sourcepub fn builder() -> ClassifyDocumentOutputBuilder
pub fn builder() -> ClassifyDocumentOutputBuilder
Creates a new builder-style object to manufacture ClassifyDocumentOutput
.
Trait Implementations§
source§impl Clone for ClassifyDocumentOutput
impl Clone for ClassifyDocumentOutput
source§fn clone(&self) -> ClassifyDocumentOutput
fn clone(&self) -> ClassifyDocumentOutput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ClassifyDocumentOutput
impl Debug for ClassifyDocumentOutput
source§impl PartialEq for ClassifyDocumentOutput
impl PartialEq for ClassifyDocumentOutput
source§fn eq(&self, other: &ClassifyDocumentOutput) -> bool
fn eq(&self, other: &ClassifyDocumentOutput) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl RequestId for ClassifyDocumentOutput
impl RequestId for ClassifyDocumentOutput
source§fn request_id(&self) -> Option<&str>
fn request_id(&self) -> Option<&str>
None
if the service could not be reached.impl StructuralPartialEq for ClassifyDocumentOutput
Auto Trait Implementations§
impl Freeze for ClassifyDocumentOutput
impl RefUnwindSafe for ClassifyDocumentOutput
impl Send for ClassifyDocumentOutput
impl Sync for ClassifyDocumentOutput
impl Unpin for ClassifyDocumentOutput
impl UnwindSafe for ClassifyDocumentOutput
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more