Class ObservationsView

java.lang.Object
com.langfuse.client.resources.commons.types.ObservationsView
All Implemented Interfaces:
IObservation

public final class ObservationsView extends Object implements IObservation
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface IObservation
      Returns:
      The unique identifier of the observation
    • getTraceId

      public Optional<String> getTraceId()
      Specified by:
      getTraceId in interface IObservation
      Returns:
      The trace ID associated with the observation
    • getType

      public String getType()
      Specified by:
      getType in interface IObservation
      Returns:
      The type of the observation
    • getName

      public Optional<String> getName()
      Specified by:
      getName in interface IObservation
      Returns:
      The name of the observation
    • getStartTime

      public OffsetDateTime getStartTime()
      Specified by:
      getStartTime in interface IObservation
      Returns:
      The start time of the observation
    • getEndTime

      public Optional<OffsetDateTime> getEndTime()
      Specified by:
      getEndTime in interface IObservation
      Returns:
      The end time of the observation.
    • getCompletionStartTime

      public Optional<OffsetDateTime> getCompletionStartTime()
      Specified by:
      getCompletionStartTime in interface IObservation
      Returns:
      The completion start time of the observation
    • getModel

      public Optional<String> getModel()
      Specified by:
      getModel in interface IObservation
      Returns:
      The model used for the observation
    • getModelParameters

      public Object getModelParameters()
      Specified by:
      getModelParameters in interface IObservation
      Returns:
      The parameters of the model used for the observation
    • getInput

      public Object getInput()
      Specified by:
      getInput in interface IObservation
      Returns:
      The input data of the observation
    • getVersion

      public Optional<String> getVersion()
      Specified by:
      getVersion in interface IObservation
      Returns:
      The version of the observation
    • getMetadata

      public Object getMetadata()
      Specified by:
      getMetadata in interface IObservation
      Returns:
      Additional metadata of the observation
    • getOutput

      public Object getOutput()
      Specified by:
      getOutput in interface IObservation
      Returns:
      The output data of the observation
    • getUsage

      public Usage getUsage()
      Specified by:
      getUsage in interface IObservation
      Returns:
      (Deprecated. Use usageDetails and costDetails instead.) The usage data of the observation
    • getLevel

      public ObservationLevel getLevel()
      Specified by:
      getLevel in interface IObservation
      Returns:
      The level of the observation
    • getStatusMessage

      public Optional<String> getStatusMessage()
      Specified by:
      getStatusMessage in interface IObservation
      Returns:
      The status message of the observation
    • getParentObservationId

      public Optional<String> getParentObservationId()
      Specified by:
      getParentObservationId in interface IObservation
      Returns:
      The parent observation ID
    • getPromptId

      public Optional<String> getPromptId()
      Specified by:
      getPromptId in interface IObservation
      Returns:
      The prompt ID associated with the observation
    • getUsageDetails

      public Map<String,Integer> getUsageDetails()
      Specified by:
      getUsageDetails in interface IObservation
      Returns:
      The usage details of the observation. Key is the name of the usage metric, value is the number of units consumed. The total key is the sum of all (non-total) usage metrics or the total value ingested.
    • getCostDetails

      public Map<String,Double> getCostDetails()
      Specified by:
      getCostDetails in interface IObservation
      Returns:
      The cost details of the observation. Key is the name of the cost metric, value is the cost in USD. The total key is the sum of all (non-total) cost metrics or the total value ingested.
    • getEnvironment

      public String getEnvironment()
      Specified by:
      getEnvironment in interface IObservation
      Returns:
      The environment from which this observation originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.
    • getPromptName

      public Optional<String> getPromptName()
      Returns:
      The name of the prompt associated with the observation
    • getPromptVersion

      public Optional<Integer> getPromptVersion()
      Returns:
      The version of the prompt associated with the observation
    • getModelId

      public Optional<String> getModelId()
      Returns:
      The unique identifier of the model
    • getInputPrice

      public Optional<Double> getInputPrice()
      Returns:
      The price of the input in USD
    • getOutputPrice

      public Optional<Double> getOutputPrice()
      Returns:
      The price of the output in USD.
    • getTotalPrice

      public Optional<Double> getTotalPrice()
      Returns:
      The total price in USD.
    • getCalculatedInputCost

      public Optional<Double> getCalculatedInputCost()
      Returns:
      (Deprecated. Use usageDetails and costDetails instead.) The calculated cost of the input in USD
    • getCalculatedOutputCost

      public Optional<Double> getCalculatedOutputCost()
      Returns:
      (Deprecated. Use usageDetails and costDetails instead.) The calculated cost of the output in USD
    • getCalculatedTotalCost

      public Optional<Double> getCalculatedTotalCost()
      Returns:
      (Deprecated. Use usageDetails and costDetails instead.) The calculated total cost in USD
    • getLatency

      public Optional<Double> getLatency()
      Returns:
      The latency in seconds.
    • getTimeToFirstToken

      public Optional<Double> getTimeToFirstToken()
      Returns:
      The time to the first token in seconds
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static ObservationsView.IdStage builder()