Skip to main content

ObservationIngest

Struct ObservationIngest 

Source
pub struct ObservationIngest {
Show 34 fields pub id: Uuid, pub trace_id: Uuid, pub type: Option<String>, pub name: Option<String>, pub start_time: Option<DateTime<Utc>>, pub end_time: Option<DateTime<Utc>>, pub completion_start_time: Option<DateTime<Utc>>, pub model: Option<String>, pub model_parameters: Option<Value>, pub input: Option<Value>, pub output: Option<Value>, pub usage: Option<Value>, pub level: Option<String>, pub status_message: Option<String>, pub parent_observation_id: Option<Uuid>, pub prompt_id: Option<String>, pub prompt_name: Option<String>, pub prompt_version: Option<String>, pub model_id: Option<String>, pub input_price: Option<f64>, pub output_price: Option<f64>, pub total_price: Option<f64>, pub calculated_input_cost: Option<f64>, pub calculated_output_cost: Option<f64>, pub calculated_total_cost: Option<f64>, pub latency: Option<f64>, pub time_to_first_token: Option<f64>, pub completion_tokens: Option<i64>, pub prompt_tokens: Option<i64>, pub total_tokens: Option<i64>, pub unit: Option<String>, pub metadata: Option<Value>, pub environment: Option<String>, pub project_id: Option<String>,
}

Fields§

§id: Uuid§trace_id: Uuid§type: Option<String>§name: Option<String>§start_time: Option<DateTime<Utc>>§end_time: Option<DateTime<Utc>>§completion_start_time: Option<DateTime<Utc>>§model: Option<String>§model_parameters: Option<Value>§input: Option<Value>§output: Option<Value>§usage: Option<Value>§level: Option<String>§status_message: Option<String>§parent_observation_id: Option<Uuid>§prompt_id: Option<String>§prompt_name: Option<String>§prompt_version: Option<String>§model_id: Option<String>§input_price: Option<f64>§output_price: Option<f64>§total_price: Option<f64>§calculated_input_cost: Option<f64>§calculated_output_cost: Option<f64>§calculated_total_cost: Option<f64>§latency: Option<f64>§time_to_first_token: Option<f64>§completion_tokens: Option<i64>§prompt_tokens: Option<i64>§total_tokens: Option<i64>§unit: Option<String>§metadata: Option<Value>§environment: Option<String>§project_id: Option<String>

Implementations§

Source§

impl ObservationIngest

Source

pub fn new(id: Uuid, trace_id: Uuid) -> Self

Source

pub fn with_metadata_field(self, key: &str, value: impl Serialize) -> Self

Source

pub fn with_step_id(self, step_id: impl Into<String>) -> Self

Source

pub fn with_parent_step_id(self, parent_step_id: impl Into<String>) -> Self

Source

pub fn with_step_type(self, step_type: impl Into<String>) -> Self

Trait Implementations§

Source§

impl Debug for ObservationIngest

Source§

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

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

impl<'de> Deserialize<'de> for ObservationIngest

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 Serialize for ObservationIngest

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

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: 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: 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
Source§

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