Skip to main content

ObservationV2

Struct ObservationV2 

Source
pub struct ObservationV2 {
Show 38 fields pub id: String, pub trace_id: Option<Option<String>>, pub start_time: DateTime<FixedOffset>, pub end_time: Option<Option<DateTime<FixedOffset>>>, pub project_id: String, pub parent_observation_id: Option<Option<String>>, pub type: String, pub name: Option<Option<String>>, pub level: Option<ObservationLevel>, pub status_message: Option<Option<String>>, pub version: Option<Option<String>>, pub environment: Option<Option<String>>, pub bookmarked: Option<Option<bool>>, pub public: Option<Option<bool>>, pub user_id: Option<Option<String>>, pub session_id: Option<Option<String>>, pub completion_start_time: Option<Option<DateTime<FixedOffset>>>, pub created_at: Option<Option<DateTime<FixedOffset>>>, pub updated_at: Option<Option<DateTime<FixedOffset>>>, pub input: Option<Option<Value>>, pub output: Option<Option<Value>>, pub metadata: Option<Option<Value>>, pub provided_model_name: Option<Option<String>>, pub internal_model_id: Option<Option<String>>, pub model_parameters: Option<Option<Value>>, pub usage_details: Option<Option<HashMap<String, i32>>>, pub cost_details: Option<Option<HashMap<String, f64>>>, pub total_cost: Option<Option<f64>>, pub usage_pricing_tier_name: Option<Option<String>>, pub prompt_id: Option<Option<String>>, pub prompt_name: Option<Option<String>>, pub prompt_version: Option<Option<i32>>, pub latency: Option<Option<f64>>, pub time_to_first_token: Option<Option<f64>>, pub model_id: Option<Option<String>>, pub trace_name: Option<Option<String>>, pub tags: Option<Option<Vec<String>>>, pub release: Option<Option<String>>,
}
Expand description

ObservationV2 : An observation from the v2 API with field-group-based selection. Core fields are always present. Other fields are included only when their field group is requested.

Fields§

§id: String

The unique identifier of the observation

§trace_id: Option<Option<String>>

The trace ID associated with the observation

§start_time: DateTime<FixedOffset>

The start time of the observation

§end_time: Option<Option<DateTime<FixedOffset>>>

The end time of the observation

§project_id: String

The project ID this observation belongs to

§parent_observation_id: Option<Option<String>>

The parent observation ID

§type: String

The type of the observation (e.g. GENERATION, SPAN, EVENT)

§name: Option<Option<String>>

The name of the observation

§level: Option<ObservationLevel>§status_message: Option<Option<String>>

The status message of the observation

§version: Option<Option<String>>

The version of the observation

§environment: Option<Option<String>>

The environment from which this observation originated

§bookmarked: Option<Option<bool>>

Whether the observation is bookmarked

§public: Option<Option<bool>>

Whether the observation is public

§user_id: Option<Option<String>>

The user ID associated with the observation

§session_id: Option<Option<String>>

The session ID associated with the observation

§completion_start_time: Option<Option<DateTime<FixedOffset>>>

The completion start time of the observation

§created_at: Option<Option<DateTime<FixedOffset>>>

The creation timestamp of the observation

§updated_at: Option<Option<DateTime<FixedOffset>>>

The last update timestamp of the observation

§input: Option<Option<Value>>

The input data of the observation

§output: Option<Option<Value>>

The output data of the observation

§metadata: Option<Option<Value>>

Additional metadata of the observation

§provided_model_name: Option<Option<String>>

The model name as provided by the user

§internal_model_id: Option<Option<String>>

The internal model ID matched by Langfuse

§model_parameters: Option<Option<Value>>

The parameters of the model used for the observation

§usage_details: Option<Option<HashMap<String, i32>>>

The usage details of the observation. Key is the usage metric name, value is the number of units consumed.

§cost_details: Option<Option<HashMap<String, f64>>>

The cost details of the observation. Key is the cost metric name, value is the cost in USD.

§total_cost: Option<Option<f64>>

The total cost of the observation in USD

§usage_pricing_tier_name: Option<Option<String>>

The name of the pricing tier applied to this observation’s usage costs

§prompt_id: Option<Option<String>>

The prompt ID associated with the observation

§prompt_name: Option<Option<String>>

The prompt name associated with the observation

§prompt_version: Option<Option<i32>>

The prompt version associated with the observation

§latency: Option<Option<f64>>

The latency in seconds

§time_to_first_token: Option<Option<f64>>

The time to first token in seconds

§model_id: Option<Option<String>>

The matched model ID

§trace_name: Option<Option<String>>

The name of the parent trace

§tags: Option<Option<Vec<String>>>

Tags from the parent trace (denormalized onto the observation)

§release: Option<Option<String>>

The release version of the parent trace

Implementations§

Source§

impl ObservationV2

Source

pub fn builder() -> ObservationV2Builder

Create an instance of ObservationV2 using the builder syntax

Source§

impl ObservationV2

Source

pub fn new( id: String, start_time: DateTime<FixedOffset>, project_id: String, type: String, ) -> ObservationV2

An observation from the v2 API with field-group-based selection. Core fields are always present. Other fields are included only when their field group is requested.

Trait Implementations§

Source§

impl Clone for ObservationV2

Source§

fn clone(&self) -> ObservationV2

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObservationV2

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ObservationV2

Source§

fn default() -> ObservationV2

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ObservationV2

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ObservationV2

Source§

fn eq(&self, other: &ObservationV2) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ObservationV2

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ObservationV2

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more