pub struct EmbeddingBatch { /* private fields */ }Expand description
The result of one successful call: count vectors of dimensions floats,
row-major, labeled with the embedding-space identity.
Implementations§
Source§impl EmbeddingBatch
impl EmbeddingBatch
Sourcepub fn new(
vectors: Vec<f32>,
count: usize,
dimensions: usize,
identity: impl Into<String>,
model: impl Into<String>,
) -> Result<Self, EmbeddingShapeError>
pub fn new( vectors: Vec<f32>, count: usize, dimensions: usize, identity: impl Into<String>, model: impl Into<String>, ) -> Result<Self, EmbeddingShapeError>
Validates vectors.len() == count * dimensions (checked multiply).
Sourcepub fn with_input_tokens(self, input_tokens: Option<u64>) -> Self
pub fn with_input_tokens(self, input_tokens: Option<u64>) -> Self
Provider-reported total input tokens, when it reported any.
Sourcepub fn with_settlements(self, settlements: Vec<SubBatchSettlement>) -> Self
pub fn with_settlements(self, settlements: Vec<SubBatchSettlement>) -> Self
The settlements of every sub-batch this call sent, for
EmbeddingTokenBudget::settle.
pub fn count(&self) -> usize
pub fn dimensions(&self) -> usize
pub fn identity(&self) -> &str
pub fn model(&self) -> &str
pub fn input_tokens(&self) -> Option<u64>
pub fn settlements(&self) -> &[SubBatchSettlement]
Trait Implementations§
Source§impl Clone for EmbeddingBatch
impl Clone for EmbeddingBatch
Source§impl Debug for EmbeddingBatch
impl Debug for EmbeddingBatch
Source§impl PartialEq for EmbeddingBatch
impl PartialEq for EmbeddingBatch
impl StructuralPartialEq for EmbeddingBatch
Auto Trait Implementations§
impl Freeze for EmbeddingBatch
impl RefUnwindSafe for EmbeddingBatch
impl Send for EmbeddingBatch
impl Sync for EmbeddingBatch
impl Unpin for EmbeddingBatch
impl UnsafeUnpin for EmbeddingBatch
impl UnwindSafe for EmbeddingBatch
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
Mutably borrows from an owned value. Read more