Package dev.braintrust.api
Record Class BraintrustOpenApiClient.BtqlQueryResponse
java.lang.Object
java.lang.Record
dev.braintrust.api.BraintrustOpenApiClient.BtqlQueryResponse
- Enclosing class:
- BraintrustOpenApiClient
public static record BraintrustOpenApiClient.BtqlQueryResponse(List<Map<String,Object>> data, BraintrustOpenApiClient.FreshnessState freshnessState, BraintrustOpenApiClient.RealtimeState realtimeState)
extends Record
Response from a
POST /btql query.
Freshness is determined by comparing BraintrustOpenApiClient.FreshnessState.lastProcessedXactId() to
BraintrustOpenApiClient.FreshnessState.lastConsideredXactId(): when both are non-null and equal, the query
has caught up to all ingested data and the result is fresh.
The BraintrustOpenApiClient.RealtimeState.type() field indicates whether realtime indexing is still active
("on") or has timed out ("exhausted_timeout").
-
Constructor Summary
ConstructorsConstructorDescriptionBtqlQueryResponse(List<Map<String, Object>> data, BraintrustOpenApiClient.FreshnessState freshnessState, BraintrustOpenApiClient.RealtimeState realtimeState) Creates an instance of aBtqlQueryResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefreshnessStaterecord component.final inthashCode()Returns a hash code value for this object.booleanisFresh()Returnstruewhen the query result has caught up to all ingested data.Returns the value of therealtimeStaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BtqlQueryResponse
public BtqlQueryResponse(List<Map<String, Object>> data, BraintrustOpenApiClient.FreshnessState freshnessState, BraintrustOpenApiClient.RealtimeState realtimeState) Creates an instance of aBtqlQueryResponserecord class.- Parameters:
data- the value for thedatarecord componentfreshnessState- the value for thefreshnessStaterecord componentrealtimeState- the value for therealtimeStaterecord component
-
-
Method Details
-
isFresh
public boolean isFresh()Returnstruewhen the query result has caught up to all ingested data. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
freshnessState
Returns the value of thefreshnessStaterecord component.- Returns:
- the value of the
freshnessStaterecord component
-
realtimeState
Returns the value of therealtimeStaterecord component.- Returns:
- the value of the
realtimeStaterecord component
-