pub struct GenerationResult {
pub text: String,
pub model_id: String,
pub tokens_used: Option<u32>,
pub quality_score: Option<f32>,
pub request_id: Option<String>,
}Expand description
Result of a text generation request
Fields§
§text: StringGenerated text content
model_id: StringModel ID used for generation
tokens_used: Option<u32>Number of tokens used (if available)
quality_score: Option<f32>Quality score (if calculated)
request_id: Option<String>Request ID for tracking
Implementations§
Source§impl GenerationResult
impl GenerationResult
Sourcepub fn with_tokens_used(self, tokens: u32) -> Self
pub fn with_tokens_used(self, tokens: u32) -> Self
Set the tokens used
Sourcepub fn with_quality_score(self, score: f32) -> Self
pub fn with_quality_score(self, score: f32) -> Self
Set the quality score
Sourcepub fn with_request_id(self, request_id: String) -> Self
pub fn with_request_id(self, request_id: String) -> Self
Set the request ID
Trait Implementations§
Source§impl Clone for GenerationResult
impl Clone for GenerationResult
Source§fn clone(&self) -> GenerationResult
fn clone(&self) -> GenerationResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenerationResult
impl Debug for GenerationResult
Source§impl<'de> Deserialize<'de> for GenerationResult
impl<'de> Deserialize<'de> for GenerationResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GenerationResult
impl RefUnwindSafe for GenerationResult
impl Send for GenerationResult
impl Sync for GenerationResult
impl Unpin for GenerationResult
impl UnwindSafe for GenerationResult
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