Class ProjectLogsEvent
-
- All Implemented Interfaces:
public final class ProjectLogsEvent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classProjectLogsEvent.BuilderA builder for ProjectLogsEvent.
public final classProjectLogsEvent.LogIdA literal 'g' which identifies the log as a project log
public final classProjectLogsEvent.ContextContext is additional information about the code that produced the project logs event. It is essentially the textual counterpart to
metrics. Use thecaller_*attributes to track the location in code which produced the project logs eventpublic final classProjectLogsEvent.MetadataA dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the
prompt, example'sid, or anything else that would be useful to slice/dice later. The values inmetadatacan be any JSON-serializable type, but its keys must be stringspublic final classProjectLogsEvent.MetricsMetrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
public final classProjectLogsEvent.ScoresA dictionary of numeric values (between 0 and 1) to log. The scores should give you a variety of signals that help you determine how accurate the outputs are compared to what you expect and diagnose failures. For example, a summarization app might have one score that tells you how accurate the summary is, and another that measures the word similarity between the generated and grouth truth summary. The word similarity score could help you determine whether the summarization was covering similar concepts or not. You can use these scores to help you sort, filter, and compare logs.
-
Method Summary
Modifier and Type Method Description final Stringid()A unique identifier for the project logs event. final String_xactId()The transaction id of an event is unique to the network operation that processed the event insertion. final OffsetDateTimecreated()The timestamp the project logs event was created final ProjectLogsEvent.LogIdlogId()A literal 'g' which identifies the log as a project log final StringorgId()Unique id for the organization that the project belongs under final StringprojectId()Unique identifier for the project final StringrootSpanId()A unique identifier for the trace this project logs event belongs to final StringspanId()A unique identifier used to link different project logs events together as part of a full trace. final Optional<ProjectLogsEvent.Context>context()Context is additional information about the code that produced the project logs event. final JsonValue_error()The error that occurred, if any. final JsonValue_expected()The ground truth value (an arbitrary, JSON serializable object) that you'd compare to outputto determine if youroutputvalue is correct or not.final JsonValue_input()The arguments that uniquely define a user input (an arbitrary, JSON serializable object). final Optional<Boolean>isRoot()Whether this span is a root span final Optional<ProjectLogsEvent.Metadata>metadata()A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. final Optional<ProjectLogsEvent.Metrics>metrics()Metrics are numerical measurements tracking the execution of the code that produced the project logs event. final Optional<ObjectReference>origin()Indicates the event was copied from another object. final JsonValue_output()The output of your application, including post-processing (an arbitrary, JSON serializable object), that allows you to determine whether the result is correct or not. final Optional<ProjectLogsEvent.Scores>scores()A dictionary of numeric values (between 0 and 1) to log. final Optional<SpanAttributes>spanAttributes()Human-identifying attributes of the span, such as name, type, etc. final Optional<List<String>>spanParents()An array of the parent span_idsof this project logs event.final Optional<List<String>>tags()A list of tags to log final JsonField<String>_id()Returns the raw JSON value of id. final JsonField<String>__xactId()Returns the raw JSON value of _xactId. final JsonField<OffsetDateTime>_created()Returns the raw JSON value of created. final JsonField<ProjectLogsEvent.LogId>_logId()Returns the raw JSON value of logId. final JsonField<String>_orgId()Returns the raw JSON value of orgId. final JsonField<String>_projectId()Returns the raw JSON value of projectId. final JsonField<String>_rootSpanId()Returns the raw JSON value of rootSpanId. final JsonField<String>_spanId()Returns the raw JSON value of spanId. final JsonField<ProjectLogsEvent.Context>_context()Returns the raw JSON value of context. final JsonField<Boolean>_isRoot()Returns the raw JSON value of isRoot. final JsonField<ProjectLogsEvent.Metadata>_metadata()Returns the raw JSON value of metadata. final JsonField<ProjectLogsEvent.Metrics>_metrics()Returns the raw JSON value of metrics. final JsonField<ObjectReference>_origin()Returns the raw JSON value of origin. final JsonField<ProjectLogsEvent.Scores>_scores()Returns the raw JSON value of scores. final JsonField<SpanAttributes>_spanAttributes()Returns the raw JSON value of spanAttributes. final JsonField<List<String>>_spanParents()Returns the raw JSON value of spanParents. final JsonField<List<String>>_tags()Returns the raw JSON value of tags. final Map<String, JsonValue>_additionalProperties()final ProjectLogsEvent.BuildertoBuilder()final ProjectLogsEventvalidate()final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ProjectLogsEvent.Builderbuilder()Returns a mutable builder for constructing an instance of ProjectLogsEvent. -
-
Method Detail
-
id
final String id()
A unique identifier for the project logs event. If you don't provide one, BrainTrust will generate one for you
-
_xactId
final String _xactId()
The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the project logs (see the
versionparameter)
-
created
final OffsetDateTime created()
The timestamp the project logs event was created
-
logId
final ProjectLogsEvent.LogId logId()
A literal 'g' which identifies the log as a project log
-
rootSpanId
final String rootSpanId()
A unique identifier for the trace this project logs event belongs to
-
spanId
final String spanId()
A unique identifier used to link different project logs events together as part of a full trace. See the tracing guide for full details on tracing
-
context
final Optional<ProjectLogsEvent.Context> context()
Context is additional information about the code that produced the project logs event. It is essentially the textual counterpart to
metrics. Use thecaller_*attributes to track the location in code which produced the project logs event
-
_expected
final JsonValue _expected()
The ground truth value (an arbitrary, JSON serializable object) that you'd compare to
outputto determine if youroutputvalue is correct or not. Braintrust currently does not compareoutputtoexpectedfor you, since there are so many different ways to do that correctly. Instead, these values are just used to help you navigate while digging into analyses. However, we may later use these values to re-score outputs or fine-tune your models.
-
_input
final JsonValue _input()
The arguments that uniquely define a user input (an arbitrary, JSON serializable object).
-
metadata
final Optional<ProjectLogsEvent.Metadata> metadata()
A dictionary with additional data about the test example, model outputs, or just about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the
prompt, example'sid, or anything else that would be useful to slice/dice later. The values inmetadatacan be any JSON-serializable type, but its keys must be strings
-
metrics
final Optional<ProjectLogsEvent.Metrics> metrics()
Metrics are numerical measurements tracking the execution of the code that produced the project logs event. Use "start" and "end" to track the time span over which the project logs event was produced
-
origin
final Optional<ObjectReference> origin()
Indicates the event was copied from another object.
-
_output
final JsonValue _output()
The output of your application, including post-processing (an arbitrary, JSON serializable object), that allows you to determine whether the result is correct or not. For example, in an app that generates SQL queries, the
outputshould be the result of the SQL query generated by the model, not the query itself, because there may be multiple valid queries that answer a single question.
-
scores
final Optional<ProjectLogsEvent.Scores> scores()
A dictionary of numeric values (between 0 and 1) to log. The scores should give you a variety of signals that help you determine how accurate the outputs are compared to what you expect and diagnose failures. For example, a summarization app might have one score that tells you how accurate the summary is, and another that measures the word similarity between the generated and grouth truth summary. The word similarity score could help you determine whether the summarization was covering similar concepts or not. You can use these scores to help you sort, filter, and compare logs.
-
spanAttributes
final Optional<SpanAttributes> spanAttributes()
Human-identifying attributes of the span, such as name, type, etc.
-
spanParents
final Optional<List<String>> spanParents()
An array of the parent
span_idsof this project logs event. This should be empty for the root span of a trace, and should most often contain just one parent element for subspans
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
__xactId
final JsonField<String> __xactId()
Returns the raw JSON value of _xactId.
Unlike _xactId, this method doesn't throw if the JSON field has an unexpected type.
-
_created
final JsonField<OffsetDateTime> _created()
Returns the raw JSON value of created.
Unlike created, this method doesn't throw if the JSON field has an unexpected type.
-
_logId
final JsonField<ProjectLogsEvent.LogId> _logId()
Returns the raw JSON value of logId.
Unlike logId, this method doesn't throw if the JSON field has an unexpected type.
-
_orgId
final JsonField<String> _orgId()
Returns the raw JSON value of orgId.
Unlike orgId, this method doesn't throw if the JSON field has an unexpected type.
-
_projectId
final JsonField<String> _projectId()
Returns the raw JSON value of projectId.
Unlike projectId, this method doesn't throw if the JSON field has an unexpected type.
-
_rootSpanId
final JsonField<String> _rootSpanId()
Returns the raw JSON value of rootSpanId.
Unlike rootSpanId, this method doesn't throw if the JSON field has an unexpected type.
-
_spanId
final JsonField<String> _spanId()
Returns the raw JSON value of spanId.
Unlike spanId, this method doesn't throw if the JSON field has an unexpected type.
-
_context
final JsonField<ProjectLogsEvent.Context> _context()
Returns the raw JSON value of context.
Unlike context, this method doesn't throw if the JSON field has an unexpected type.
-
_isRoot
final JsonField<Boolean> _isRoot()
Returns the raw JSON value of isRoot.
Unlike isRoot, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<ProjectLogsEvent.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_metrics
final JsonField<ProjectLogsEvent.Metrics> _metrics()
Returns the raw JSON value of metrics.
Unlike metrics, this method doesn't throw if the JSON field has an unexpected type.
-
_origin
final JsonField<ObjectReference> _origin()
Returns the raw JSON value of origin.
Unlike origin, this method doesn't throw if the JSON field has an unexpected type.
-
_scores
final JsonField<ProjectLogsEvent.Scores> _scores()
Returns the raw JSON value of scores.
Unlike scores, this method doesn't throw if the JSON field has an unexpected type.
-
_spanAttributes
final JsonField<SpanAttributes> _spanAttributes()
Returns the raw JSON value of spanAttributes.
Unlike spanAttributes, this method doesn't throw if the JSON field has an unexpected type.
-
_spanParents
final JsonField<List<String>> _spanParents()
Returns the raw JSON value of spanParents.
Unlike spanParents, this method doesn't throw if the JSON field has an unexpected type.
-
_tags
final JsonField<List<String>> _tags()
Returns the raw JSON value of tags.
Unlike tags, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final ProjectLogsEvent.Builder toBuilder()
-
validate
final ProjectLogsEvent validate()
-
builder
final static ProjectLogsEvent.Builder builder()
Returns a mutable builder for constructing an instance of ProjectLogsEvent.
The following fields are required:
.id() ._xactId() .created() .logId() .orgId() .projectId() .rootSpanId() .spanId()
-
-
-
-