pub struct Generation {
pub model: String,
pub provider: String,
pub model_parameters: HashMap<String, Value>,
pub usage: TokenUsage,
pub cost: Option<CostDetails>,
pub completion_start_time: Option<SystemTime>,
pub finish_reason: Option<String>,
pub prompt_name: Option<String>,
pub prompt_version: Option<u32>,
}Expand description
LLM-specific data carried on a Generation span.
Fields§
§model: StringConcrete model id (e.g. “gpt-4o-2024-08-06”).
provider: StringProvider tag (e.g. “openai”, “anthropic”).
model_parameters: HashMap<String, Value>Provider-supplied request parameters (temperature, max_tokens, …).
usage: TokenUsageToken usage broken out by category.
cost: Option<CostDetails>USD cost, structured. None when the model is not in the price table.
completion_start_time: Option<SystemTime>Time-to-first-token, when the provider reports it.
finish_reason: Option<String>Provider’s stop reason (“stop”, “length”, “tool_calls”, …).
prompt_name: Option<String>Set when the prompt came from a PromptStore.
prompt_version: Option<u32>Set when the prompt came from a PromptStore.
Trait Implementations§
Source§impl Clone for Generation
impl Clone for Generation
Source§fn clone(&self) -> Generation
fn clone(&self) -> Generation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Generation
impl Debug for Generation
Source§impl Default for Generation
impl Default for Generation
Source§fn default() -> Generation
fn default() -> Generation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Generation
impl<'de> Deserialize<'de> for Generation
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 Generation
impl RefUnwindSafe for Generation
impl Send for Generation
impl Sync for Generation
impl Unpin for Generation
impl UnsafeUnpin for Generation
impl UnwindSafe for Generation
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