Skip to main content

ObservationV2Builder

Struct ObservationV2Builder 

Source
pub struct ObservationV2Builder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> ObservationV2Builder<S>

Source

pub fn build(self) -> ObservationV2
where S: IsComplete,

Finish building and return the requested object

Source

pub fn id(self, value: String) -> ObservationV2Builder<SetId<S>>
where S::Id: IsUnset,

Required.

The unique identifier of the observation

Source

pub fn trace_id( self, value: Option<String>, ) -> ObservationV2Builder<SetTraceId<S>>
where S::TraceId: IsUnset,

Optional (Some / Option setters). The trace ID associated with the observation

Source

pub fn maybe_trace_id( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetTraceId<S>>
where S::TraceId: IsUnset,

Optional (Some / Option setters). The trace ID associated with the observation

Source

pub fn start_time( self, value: DateTime<FixedOffset>, ) -> ObservationV2Builder<SetStartTime<S>>
where S::StartTime: IsUnset,

Required.

The start time of the observation

Source

pub fn end_time( self, value: Option<DateTime<FixedOffset>>, ) -> ObservationV2Builder<SetEndTime<S>>
where S::EndTime: IsUnset,

Optional (Some / Option setters). The end time of the observation

Source

pub fn maybe_end_time( self, value: Option<Option<DateTime<FixedOffset>>>, ) -> ObservationV2Builder<SetEndTime<S>>
where S::EndTime: IsUnset,

Optional (Some / Option setters). The end time of the observation

Source

pub fn project_id(self, value: String) -> ObservationV2Builder<SetProjectId<S>>
where S::ProjectId: IsUnset,

Required.

The project ID this observation belongs to

Source

pub fn parent_observation_id( self, value: Option<String>, ) -> ObservationV2Builder<SetParentObservationId<S>>
where S::ParentObservationId: IsUnset,

Optional (Some / Option setters). The parent observation ID

Source

pub fn maybe_parent_observation_id( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetParentObservationId<S>>
where S::ParentObservationId: IsUnset,

Optional (Some / Option setters). The parent observation ID

Source

pub fn type(self, value: String) -> ObservationV2Builder<SetType<S>>
where S::Type: IsUnset,

Required.

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

Source

pub fn name(self, value: Option<String>) -> ObservationV2Builder<SetName<S>>
where S::Name: IsUnset,

Optional (Some / Option setters). The name of the observation

Source

pub fn maybe_name( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetName<S>>
where S::Name: IsUnset,

Optional (Some / Option setters). The name of the observation

Source

pub fn level(self, value: ObservationLevel) -> ObservationV2Builder<SetLevel<S>>
where S::Level: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_level( self, value: Option<ObservationLevel>, ) -> ObservationV2Builder<SetLevel<S>>
where S::Level: IsUnset,

Optional (Some / Option setters).

Source

pub fn status_message( self, value: Option<String>, ) -> ObservationV2Builder<SetStatusMessage<S>>
where S::StatusMessage: IsUnset,

Optional (Some / Option setters). The status message of the observation

Source

pub fn maybe_status_message( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetStatusMessage<S>>
where S::StatusMessage: IsUnset,

Optional (Some / Option setters). The status message of the observation

Source

pub fn version( self, value: Option<String>, ) -> ObservationV2Builder<SetVersion<S>>
where S::Version: IsUnset,

Optional (Some / Option setters). The version of the observation

Source

pub fn maybe_version( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetVersion<S>>
where S::Version: IsUnset,

Optional (Some / Option setters). The version of the observation

Source

pub fn environment( self, value: Option<String>, ) -> ObservationV2Builder<SetEnvironment<S>>
where S::Environment: IsUnset,

Optional (Some / Option setters). The environment from which this observation originated

Source

pub fn maybe_environment( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetEnvironment<S>>
where S::Environment: IsUnset,

Optional (Some / Option setters). The environment from which this observation originated

Source

pub fn bookmarked( self, value: Option<bool>, ) -> ObservationV2Builder<SetBookmarked<S>>
where S::Bookmarked: IsUnset,

Optional (Some / Option setters). Whether the observation is bookmarked

Source

pub fn maybe_bookmarked( self, value: Option<Option<bool>>, ) -> ObservationV2Builder<SetBookmarked<S>>
where S::Bookmarked: IsUnset,

Optional (Some / Option setters). Whether the observation is bookmarked

Source

pub fn public(self, value: Option<bool>) -> ObservationV2Builder<SetPublic<S>>
where S::Public: IsUnset,

Optional (Some / Option setters). Whether the observation is public

Source

pub fn maybe_public( self, value: Option<Option<bool>>, ) -> ObservationV2Builder<SetPublic<S>>
where S::Public: IsUnset,

Optional (Some / Option setters). Whether the observation is public

Source

pub fn user_id( self, value: Option<String>, ) -> ObservationV2Builder<SetUserId<S>>
where S::UserId: IsUnset,

Optional (Some / Option setters). The user ID associated with the observation

Source

pub fn maybe_user_id( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetUserId<S>>
where S::UserId: IsUnset,

Optional (Some / Option setters). The user ID associated with the observation

Source

pub fn session_id( self, value: Option<String>, ) -> ObservationV2Builder<SetSessionId<S>>
where S::SessionId: IsUnset,

Optional (Some / Option setters). The session ID associated with the observation

Source

pub fn maybe_session_id( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetSessionId<S>>
where S::SessionId: IsUnset,

Optional (Some / Option setters). The session ID associated with the observation

Source

pub fn completion_start_time( self, value: Option<DateTime<FixedOffset>>, ) -> ObservationV2Builder<SetCompletionStartTime<S>>
where S::CompletionStartTime: IsUnset,

Optional (Some / Option setters). The completion start time of the observation

Source

pub fn maybe_completion_start_time( self, value: Option<Option<DateTime<FixedOffset>>>, ) -> ObservationV2Builder<SetCompletionStartTime<S>>
where S::CompletionStartTime: IsUnset,

Optional (Some / Option setters). The completion start time of the observation

Source

pub fn created_at( self, value: Option<DateTime<FixedOffset>>, ) -> ObservationV2Builder<SetCreatedAt<S>>
where S::CreatedAt: IsUnset,

Optional (Some / Option setters). The creation timestamp of the observation

Source

pub fn maybe_created_at( self, value: Option<Option<DateTime<FixedOffset>>>, ) -> ObservationV2Builder<SetCreatedAt<S>>
where S::CreatedAt: IsUnset,

Optional (Some / Option setters). The creation timestamp of the observation

Source

pub fn updated_at( self, value: Option<DateTime<FixedOffset>>, ) -> ObservationV2Builder<SetUpdatedAt<S>>
where S::UpdatedAt: IsUnset,

Optional (Some / Option setters). The last update timestamp of the observation

Source

pub fn maybe_updated_at( self, value: Option<Option<DateTime<FixedOffset>>>, ) -> ObservationV2Builder<SetUpdatedAt<S>>
where S::UpdatedAt: IsUnset,

Optional (Some / Option setters). The last update timestamp of the observation

Source

pub fn input(self, value: Option<Value>) -> ObservationV2Builder<SetInput<S>>
where S::Input: IsUnset,

Optional (Some / Option setters). The input data of the observation

Source

pub fn maybe_input( self, value: Option<Option<Value>>, ) -> ObservationV2Builder<SetInput<S>>
where S::Input: IsUnset,

Optional (Some / Option setters). The input data of the observation

Source

pub fn output(self, value: Option<Value>) -> ObservationV2Builder<SetOutput<S>>
where S::Output: IsUnset,

Optional (Some / Option setters). The output data of the observation

Source

pub fn maybe_output( self, value: Option<Option<Value>>, ) -> ObservationV2Builder<SetOutput<S>>
where S::Output: IsUnset,

Optional (Some / Option setters). The output data of the observation

Source

pub fn metadata( self, value: Option<Value>, ) -> ObservationV2Builder<SetMetadata<S>>
where S::Metadata: IsUnset,

Optional (Some / Option setters). Additional metadata of the observation

Source

pub fn maybe_metadata( self, value: Option<Option<Value>>, ) -> ObservationV2Builder<SetMetadata<S>>
where S::Metadata: IsUnset,

Optional (Some / Option setters). Additional metadata of the observation

Source

pub fn provided_model_name( self, value: Option<String>, ) -> ObservationV2Builder<SetProvidedModelName<S>>
where S::ProvidedModelName: IsUnset,

Optional (Some / Option setters). The model name as provided by the user

Source

pub fn maybe_provided_model_name( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetProvidedModelName<S>>
where S::ProvidedModelName: IsUnset,

Optional (Some / Option setters). The model name as provided by the user

Source

pub fn internal_model_id( self, value: Option<String>, ) -> ObservationV2Builder<SetInternalModelId<S>>
where S::InternalModelId: IsUnset,

Optional (Some / Option setters). The internal model ID matched by Langfuse

Source

pub fn maybe_internal_model_id( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetInternalModelId<S>>
where S::InternalModelId: IsUnset,

Optional (Some / Option setters). The internal model ID matched by Langfuse

Source

pub fn model_parameters( self, value: Option<Value>, ) -> ObservationV2Builder<SetModelParameters<S>>
where S::ModelParameters: IsUnset,

Optional (Some / Option setters). The parameters of the model used for the observation

Source

pub fn maybe_model_parameters( self, value: Option<Option<Value>>, ) -> ObservationV2Builder<SetModelParameters<S>>
where S::ModelParameters: IsUnset,

Optional (Some / Option setters). The parameters of the model used for the observation

Source

pub fn usage_details( self, value: Option<HashMap<String, i32>>, ) -> ObservationV2Builder<SetUsageDetails<S>>
where S::UsageDetails: IsUnset,

Optional (Some / Option setters). The usage details of the observation. Key is the usage metric name, value is the number of units consumed.

Source

pub fn maybe_usage_details( self, value: Option<Option<HashMap<String, i32>>>, ) -> ObservationV2Builder<SetUsageDetails<S>>
where S::UsageDetails: IsUnset,

Optional (Some / Option setters). The usage details of the observation. Key is the usage metric name, value is the number of units consumed.

Source

pub fn cost_details( self, value: Option<HashMap<String, f64>>, ) -> ObservationV2Builder<SetCostDetails<S>>
where S::CostDetails: IsUnset,

Optional (Some / Option setters). The cost details of the observation. Key is the cost metric name, value is the cost in USD.

Source

pub fn maybe_cost_details( self, value: Option<Option<HashMap<String, f64>>>, ) -> ObservationV2Builder<SetCostDetails<S>>
where S::CostDetails: IsUnset,

Optional (Some / Option setters). The cost details of the observation. Key is the cost metric name, value is the cost in USD.

Source

pub fn total_cost( self, value: Option<f64>, ) -> ObservationV2Builder<SetTotalCost<S>>
where S::TotalCost: IsUnset,

Optional (Some / Option setters). The total cost of the observation in USD

Source

pub fn maybe_total_cost( self, value: Option<Option<f64>>, ) -> ObservationV2Builder<SetTotalCost<S>>
where S::TotalCost: IsUnset,

Optional (Some / Option setters). The total cost of the observation in USD

Source

pub fn usage_pricing_tier_name( self, value: Option<String>, ) -> ObservationV2Builder<SetUsagePricingTierName<S>>
where S::UsagePricingTierName: IsUnset,

Optional (Some / Option setters). The name of the pricing tier applied to this observation’s usage costs

Source

pub fn maybe_usage_pricing_tier_name( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetUsagePricingTierName<S>>
where S::UsagePricingTierName: IsUnset,

Optional (Some / Option setters). The name of the pricing tier applied to this observation’s usage costs

Source

pub fn prompt_id( self, value: Option<String>, ) -> ObservationV2Builder<SetPromptId<S>>
where S::PromptId: IsUnset,

Optional (Some / Option setters). The prompt ID associated with the observation

Source

pub fn maybe_prompt_id( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetPromptId<S>>
where S::PromptId: IsUnset,

Optional (Some / Option setters). The prompt ID associated with the observation

Source

pub fn prompt_name( self, value: Option<String>, ) -> ObservationV2Builder<SetPromptName<S>>
where S::PromptName: IsUnset,

Optional (Some / Option setters). The prompt name associated with the observation

Source

pub fn maybe_prompt_name( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetPromptName<S>>
where S::PromptName: IsUnset,

Optional (Some / Option setters). The prompt name associated with the observation

Source

pub fn prompt_version( self, value: Option<i32>, ) -> ObservationV2Builder<SetPromptVersion<S>>
where S::PromptVersion: IsUnset,

Optional (Some / Option setters). The prompt version associated with the observation

Source

pub fn maybe_prompt_version( self, value: Option<Option<i32>>, ) -> ObservationV2Builder<SetPromptVersion<S>>
where S::PromptVersion: IsUnset,

Optional (Some / Option setters). The prompt version associated with the observation

Source

pub fn latency(self, value: Option<f64>) -> ObservationV2Builder<SetLatency<S>>
where S::Latency: IsUnset,

Optional (Some / Option setters). The latency in seconds

Source

pub fn maybe_latency( self, value: Option<Option<f64>>, ) -> ObservationV2Builder<SetLatency<S>>
where S::Latency: IsUnset,

Optional (Some / Option setters). The latency in seconds

Source

pub fn time_to_first_token( self, value: Option<f64>, ) -> ObservationV2Builder<SetTimeToFirstToken<S>>
where S::TimeToFirstToken: IsUnset,

Optional (Some / Option setters). The time to first token in seconds

Source

pub fn maybe_time_to_first_token( self, value: Option<Option<f64>>, ) -> ObservationV2Builder<SetTimeToFirstToken<S>>
where S::TimeToFirstToken: IsUnset,

Optional (Some / Option setters). The time to first token in seconds

Source

pub fn model_id( self, value: Option<String>, ) -> ObservationV2Builder<SetModelId<S>>
where S::ModelId: IsUnset,

Optional (Some / Option setters). The matched model ID

Source

pub fn maybe_model_id( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetModelId<S>>
where S::ModelId: IsUnset,

Optional (Some / Option setters). The matched model ID

Source

pub fn trace_name( self, value: Option<String>, ) -> ObservationV2Builder<SetTraceName<S>>
where S::TraceName: IsUnset,

Optional (Some / Option setters). The name of the parent trace

Source

pub fn maybe_trace_name( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetTraceName<S>>
where S::TraceName: IsUnset,

Optional (Some / Option setters). The name of the parent trace

Source

pub fn tags( self, value: Option<Vec<String>>, ) -> ObservationV2Builder<SetTags<S>>
where S::Tags: IsUnset,

Optional (Some / Option setters). Tags from the parent trace (denormalized onto the observation)

Source

pub fn maybe_tags( self, value: Option<Option<Vec<String>>>, ) -> ObservationV2Builder<SetTags<S>>
where S::Tags: IsUnset,

Optional (Some / Option setters). Tags from the parent trace (denormalized onto the observation)

Source

pub fn release( self, value: Option<String>, ) -> ObservationV2Builder<SetRelease<S>>
where S::Release: IsUnset,

Optional (Some / Option setters). The release version of the parent trace

Source

pub fn maybe_release( self, value: Option<Option<String>>, ) -> ObservationV2Builder<SetRelease<S>>
where S::Release: IsUnset,

Optional (Some / Option setters). The release version of the parent trace

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> 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, 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