#[non_exhaustive]pub struct ClassifyDocumentOutputBuilder { /* private fields */ }
Expand description
A builder for ClassifyDocumentOutput
.
Implementations§
Source§impl ClassifyDocumentOutputBuilder
impl ClassifyDocumentOutputBuilder
Sourcepub fn classes(self, input: DocumentClass) -> Self
pub fn classes(self, input: DocumentClass) -> Self
Appends an item to classes
.
To override the contents of this collection use set_classes
.
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.
Sourcepub fn set_classes(self, input: Option<Vec<DocumentClass>>) -> Self
pub fn set_classes(self, input: Option<Vec<DocumentClass>>) -> Self
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.
Sourcepub fn get_classes(&self) -> &Option<Vec<DocumentClass>>
pub fn get_classes(&self) -> &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.
Sourcepub fn labels(self, input: DocumentLabel) -> Self
pub fn labels(self, input: DocumentLabel) -> Self
Appends an item to labels
.
To override the contents of this collection use set_labels
.
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.
Sourcepub fn set_labels(self, input: Option<Vec<DocumentLabel>>) -> Self
pub fn set_labels(self, input: Option<Vec<DocumentLabel>>) -> Self
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.
Sourcepub fn get_labels(&self) -> &Option<Vec<DocumentLabel>>
pub fn get_labels(&self) -> &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.
Sourcepub fn document_metadata(self, input: DocumentMetadata) -> Self
pub fn document_metadata(self, input: DocumentMetadata) -> Self
Extraction information about the document. This field is present in the response only if your request includes the Byte
parameter.
Sourcepub fn set_document_metadata(self, input: Option<DocumentMetadata>) -> Self
pub fn set_document_metadata(self, input: Option<DocumentMetadata>) -> Self
Extraction information about the document. This field is present in the response only if your request includes the Byte
parameter.
Sourcepub fn get_document_metadata(&self) -> &Option<DocumentMetadata>
pub fn get_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, input: DocumentTypeListItem) -> Self
pub fn document_type(self, input: DocumentTypeListItem) -> Self
Appends an item to document_type
.
To override the contents of this collection use set_document_type
.
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.
Sourcepub fn set_document_type(self, input: Option<Vec<DocumentTypeListItem>>) -> Self
pub fn set_document_type(self, input: Option<Vec<DocumentTypeListItem>>) -> Self
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.
Sourcepub fn get_document_type(&self) -> &Option<Vec<DocumentTypeListItem>>
pub fn get_document_type(&self) -> &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.
Sourcepub fn errors(self, input: ErrorsListItem) -> Self
pub fn errors(self, input: ErrorsListItem) -> Self
Appends an item to errors
.
To override the contents of this collection use set_errors
.
Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.
Sourcepub fn set_errors(self, input: Option<Vec<ErrorsListItem>>) -> Self
pub fn set_errors(self, input: Option<Vec<ErrorsListItem>>) -> Self
Page-level errors that the system detected while processing the input document. The field is empty if the system encountered no errors.
Sourcepub fn get_errors(&self) -> &Option<Vec<ErrorsListItem>>
pub fn get_errors(&self) -> &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.
Sourcepub fn warnings(self, input: WarningsListItem) -> Self
pub fn warnings(self, input: WarningsListItem) -> Self
Appends an item to warnings
.
To override the contents of this collection use set_warnings
.
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.
Sourcepub fn set_warnings(self, input: Option<Vec<WarningsListItem>>) -> Self
pub fn set_warnings(self, input: Option<Vec<WarningsListItem>>) -> Self
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.
Sourcepub fn get_warnings(&self) -> &Option<Vec<WarningsListItem>>
pub fn get_warnings(&self) -> &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.
Sourcepub fn build(self) -> ClassifyDocumentOutput
pub fn build(self) -> ClassifyDocumentOutput
Consumes the builder and constructs a ClassifyDocumentOutput
.
Trait Implementations§
Source§impl Clone for ClassifyDocumentOutputBuilder
impl Clone for ClassifyDocumentOutputBuilder
Source§fn clone(&self) -> ClassifyDocumentOutputBuilder
fn clone(&self) -> ClassifyDocumentOutputBuilder
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for ClassifyDocumentOutputBuilder
impl Default for ClassifyDocumentOutputBuilder
Source§fn default() -> ClassifyDocumentOutputBuilder
fn default() -> ClassifyDocumentOutputBuilder
Source§impl PartialEq for ClassifyDocumentOutputBuilder
impl PartialEq for ClassifyDocumentOutputBuilder
Source§fn eq(&self, other: &ClassifyDocumentOutputBuilder) -> bool
fn eq(&self, other: &ClassifyDocumentOutputBuilder) -> bool
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for ClassifyDocumentOutputBuilder
Auto Trait Implementations§
impl Freeze for ClassifyDocumentOutputBuilder
impl RefUnwindSafe for ClassifyDocumentOutputBuilder
impl Send for ClassifyDocumentOutputBuilder
impl Sync for ClassifyDocumentOutputBuilder
impl Unpin for ClassifyDocumentOutputBuilder
impl UnwindSafe for ClassifyDocumentOutputBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);