Class ProjectLogsEvent.Builder
-
- All Implemented Interfaces:
public final class ProjectLogsEvent.BuilderA builder for ProjectLogsEvent.
-
-
Method Summary
Modifier and Type Method Description final ProjectLogsEvent.Builderid(String id)A unique identifier for the project logs event. final ProjectLogsEvent.Builderid(JsonField<String> id)Sets Builder.id to an arbitrary JSON value. final ProjectLogsEvent.Builder_xactId(String _xactId)The transaction id of an event is unique to the network operation that processed the event insertion. final ProjectLogsEvent.Builder_xactId(JsonField<String> _xactId)Sets Builder._xactId to an arbitrary JSON value. final ProjectLogsEvent.Buildercreated(OffsetDateTime created)The timestamp the project logs event was created final ProjectLogsEvent.Buildercreated(JsonField<OffsetDateTime> created)Sets Builder.created to an arbitrary JSON value. final ProjectLogsEvent.BuilderlogId(ProjectLogsEvent.LogId logId)A literal 'g' which identifies the log as a project log final ProjectLogsEvent.BuilderlogId(JsonField<ProjectLogsEvent.LogId> logId)Sets Builder.logId to an arbitrary JSON value. final ProjectLogsEvent.BuilderorgId(String orgId)Unique id for the organization that the project belongs under final ProjectLogsEvent.BuilderorgId(JsonField<String> orgId)Sets Builder.orgId to an arbitrary JSON value. final ProjectLogsEvent.BuilderprojectId(String projectId)Unique identifier for the project final ProjectLogsEvent.BuilderprojectId(JsonField<String> projectId)Sets Builder.projectId to an arbitrary JSON value. final ProjectLogsEvent.BuilderrootSpanId(String rootSpanId)A unique identifier for the trace this project logs event belongs to final ProjectLogsEvent.BuilderrootSpanId(JsonField<String> rootSpanId)Sets Builder.rootSpanId to an arbitrary JSON value. final ProjectLogsEvent.BuilderspanId(String spanId)A unique identifier used to link different project logs events together as part of a full trace. final ProjectLogsEvent.BuilderspanId(JsonField<String> spanId)Sets Builder.spanId to an arbitrary JSON value. final ProjectLogsEvent.Buildercontext(ProjectLogsEvent.Context context)Context is additional information about the code that produced the project logs event. final ProjectLogsEvent.Buildercontext(Optional<ProjectLogsEvent.Context> context)Alias for calling Builder.context with context.orElse(null).final ProjectLogsEvent.Buildercontext(JsonField<ProjectLogsEvent.Context> context)Sets Builder.context to an arbitrary JSON value. final ProjectLogsEvent.Buildererror(JsonValue error)The error that occurred, if any. final ProjectLogsEvent.Builderexpected(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 ProjectLogsEvent.Builderinput(JsonValue input)The arguments that uniquely define a user input (an arbitrary, JSON serializable object). final ProjectLogsEvent.BuilderisRoot(Boolean isRoot)Whether this span is a root span final ProjectLogsEvent.BuilderisRoot(Boolean isRoot)Alias for Builder.isRoot. final ProjectLogsEvent.BuilderisRoot(Optional<Boolean> isRoot)Alias for calling Builder.isRoot with isRoot.orElse(null).final ProjectLogsEvent.BuilderisRoot(JsonField<Boolean> isRoot)Sets Builder.isRoot to an arbitrary JSON value. final ProjectLogsEvent.Buildermetadata(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 ProjectLogsEvent.Buildermetadata(Optional<ProjectLogsEvent.Metadata> metadata)Alias for calling Builder.metadata with metadata.orElse(null).final ProjectLogsEvent.Buildermetadata(JsonField<ProjectLogsEvent.Metadata> metadata)Sets Builder.metadata to an arbitrary JSON value. final ProjectLogsEvent.Buildermetrics(ProjectLogsEvent.Metrics metrics)Metrics are numerical measurements tracking the execution of the code that produced the project logs event. final ProjectLogsEvent.Buildermetrics(Optional<ProjectLogsEvent.Metrics> metrics)Alias for calling Builder.metrics with metrics.orElse(null).final ProjectLogsEvent.Buildermetrics(JsonField<ProjectLogsEvent.Metrics> metrics)Sets Builder.metrics to an arbitrary JSON value. final ProjectLogsEvent.Builderorigin(ObjectReference origin)Indicates the event was copied from another object. final ProjectLogsEvent.Builderorigin(Optional<ObjectReference> origin)Alias for calling Builder.origin with origin.orElse(null).final ProjectLogsEvent.Builderorigin(JsonField<ObjectReference> origin)Sets Builder.origin to an arbitrary JSON value. final ProjectLogsEvent.Builderoutput(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 ProjectLogsEvent.Builderscores(ProjectLogsEvent.Scores scores)A dictionary of numeric values (between 0 and 1) to log. final ProjectLogsEvent.Builderscores(Optional<ProjectLogsEvent.Scores> scores)Alias for calling Builder.scores with scores.orElse(null).final ProjectLogsEvent.Builderscores(JsonField<ProjectLogsEvent.Scores> scores)Sets Builder.scores to an arbitrary JSON value. final ProjectLogsEvent.BuilderspanAttributes(SpanAttributes spanAttributes)Human-identifying attributes of the span, such as name, type, etc. final ProjectLogsEvent.BuilderspanAttributes(Optional<SpanAttributes> spanAttributes)Alias for calling Builder.spanAttributes with spanAttributes.orElse(null).final ProjectLogsEvent.BuilderspanAttributes(JsonField<SpanAttributes> spanAttributes)Sets Builder.spanAttributes to an arbitrary JSON value. final ProjectLogsEvent.BuilderspanParents(List<String> spanParents)An array of the parent span_idsof this project logs event.final ProjectLogsEvent.BuilderspanParents(Optional<List<String>> spanParents)Alias for calling Builder.spanParents with spanParents.orElse(null).final ProjectLogsEvent.BuilderspanParents(JsonField<List<String>> spanParents)Sets Builder.spanParents to an arbitrary JSON value. final ProjectLogsEvent.BuilderaddSpanParent(String spanParent)Adds a single String to spanParents. final ProjectLogsEvent.Buildertags(List<String> tags)A list of tags to log final ProjectLogsEvent.Buildertags(Optional<List<String>> tags)Alias for calling Builder.tags with tags.orElse(null).final ProjectLogsEvent.Buildertags(JsonField<List<String>> tags)Sets Builder.tags to an arbitrary JSON value. final ProjectLogsEvent.BuilderaddTag(String tag)Adds a single String to tags. final ProjectLogsEvent.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final ProjectLogsEvent.BuilderputAdditionalProperty(String key, JsonValue value)final ProjectLogsEvent.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final ProjectLogsEvent.BuilderremoveAdditionalProperty(String key)final ProjectLogsEvent.BuilderremoveAllAdditionalProperties(Set<String> keys)final ProjectLogsEventbuild()Returns an immutable instance of ProjectLogsEvent. -
-
Method Detail
-
id
final ProjectLogsEvent.Builder id(String id)
A unique identifier for the project logs event. If you don't provide one, BrainTrust will generate one for you
-
id
final ProjectLogsEvent.Builder id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value.
You should usually call Builder.id with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
_xactId
final ProjectLogsEvent.Builder _xactId(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)
-
_xactId
final ProjectLogsEvent.Builder _xactId(JsonField<String> _xactId)
Sets Builder._xactId to an arbitrary JSON value.
You should usually call Builder._xactId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
created
final ProjectLogsEvent.Builder created(OffsetDateTime created)
The timestamp the project logs event was created
-
created
final ProjectLogsEvent.Builder created(JsonField<OffsetDateTime> created)
Sets Builder.created to an arbitrary JSON value.
You should usually call Builder.created with a well-typed OffsetDateTime value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
logId
final ProjectLogsEvent.Builder logId(ProjectLogsEvent.LogId logId)
A literal 'g' which identifies the log as a project log
-
logId
final ProjectLogsEvent.Builder logId(JsonField<ProjectLogsEvent.LogId> logId)
Sets Builder.logId to an arbitrary JSON value.
You should usually call Builder.logId with a well-typed LogId value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
orgId
final ProjectLogsEvent.Builder orgId(String orgId)
Unique id for the organization that the project belongs under
-
orgId
final ProjectLogsEvent.Builder orgId(JsonField<String> orgId)
Sets Builder.orgId to an arbitrary JSON value.
You should usually call Builder.orgId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
projectId
final ProjectLogsEvent.Builder projectId(String projectId)
Unique identifier for the project
-
projectId
final ProjectLogsEvent.Builder projectId(JsonField<String> projectId)
Sets Builder.projectId to an arbitrary JSON value.
You should usually call Builder.projectId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
rootSpanId
final ProjectLogsEvent.Builder rootSpanId(String rootSpanId)
A unique identifier for the trace this project logs event belongs to
-
rootSpanId
final ProjectLogsEvent.Builder rootSpanId(JsonField<String> rootSpanId)
Sets Builder.rootSpanId to an arbitrary JSON value.
You should usually call Builder.rootSpanId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
spanId
final ProjectLogsEvent.Builder spanId(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
-
spanId
final ProjectLogsEvent.Builder spanId(JsonField<String> spanId)
Sets Builder.spanId to an arbitrary JSON value.
You should usually call Builder.spanId with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
context
final ProjectLogsEvent.Builder context(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
-
context
final ProjectLogsEvent.Builder context(Optional<ProjectLogsEvent.Context> context)
Alias for calling Builder.context with
context.orElse(null).
-
context
final ProjectLogsEvent.Builder context(JsonField<ProjectLogsEvent.Context> context)
Sets Builder.context to an arbitrary JSON value.
You should usually call Builder.context with a well-typed Context value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
error
final ProjectLogsEvent.Builder error(JsonValue error)
The error that occurred, if any.
-
expected
final ProjectLogsEvent.Builder expected(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 ProjectLogsEvent.Builder input(JsonValue input)
The arguments that uniquely define a user input (an arbitrary, JSON serializable object).
-
isRoot
final ProjectLogsEvent.Builder isRoot(Boolean isRoot)
Whether this span is a root span
-
isRoot
final ProjectLogsEvent.Builder isRoot(Boolean isRoot)
Alias for Builder.isRoot.
This unboxed primitive overload exists for backwards compatibility.
-
isRoot
final ProjectLogsEvent.Builder isRoot(Optional<Boolean> isRoot)
Alias for calling Builder.isRoot with
isRoot.orElse(null).
-
isRoot
final ProjectLogsEvent.Builder isRoot(JsonField<Boolean> isRoot)
Sets Builder.isRoot to an arbitrary JSON value.
You should usually call Builder.isRoot with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
metadata
final ProjectLogsEvent.Builder metadata(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
-
metadata
final ProjectLogsEvent.Builder metadata(Optional<ProjectLogsEvent.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null).
-
metadata
final ProjectLogsEvent.Builder metadata(JsonField<ProjectLogsEvent.Metadata> metadata)
Sets Builder.metadata to an arbitrary JSON value.
You should usually call Builder.metadata with a well-typed Metadata value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
metrics
final ProjectLogsEvent.Builder metrics(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
-
metrics
final ProjectLogsEvent.Builder metrics(Optional<ProjectLogsEvent.Metrics> metrics)
Alias for calling Builder.metrics with
metrics.orElse(null).
-
metrics
final ProjectLogsEvent.Builder metrics(JsonField<ProjectLogsEvent.Metrics> metrics)
Sets Builder.metrics to an arbitrary JSON value.
You should usually call Builder.metrics with a well-typed Metrics value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
origin
final ProjectLogsEvent.Builder origin(ObjectReference origin)
Indicates the event was copied from another object.
-
origin
final ProjectLogsEvent.Builder origin(Optional<ObjectReference> origin)
Alias for calling Builder.origin with
origin.orElse(null).
-
origin
final ProjectLogsEvent.Builder origin(JsonField<ObjectReference> origin)
Sets Builder.origin to an arbitrary JSON value.
You should usually call Builder.origin with a well-typed ObjectReference value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
output
final ProjectLogsEvent.Builder output(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 ProjectLogsEvent.Builder scores(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.
-
scores
final ProjectLogsEvent.Builder scores(Optional<ProjectLogsEvent.Scores> scores)
Alias for calling Builder.scores with
scores.orElse(null).
-
scores
final ProjectLogsEvent.Builder scores(JsonField<ProjectLogsEvent.Scores> scores)
Sets Builder.scores to an arbitrary JSON value.
You should usually call Builder.scores with a well-typed Scores value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
spanAttributes
final ProjectLogsEvent.Builder spanAttributes(SpanAttributes spanAttributes)
Human-identifying attributes of the span, such as name, type, etc.
-
spanAttributes
final ProjectLogsEvent.Builder spanAttributes(Optional<SpanAttributes> spanAttributes)
Alias for calling Builder.spanAttributes with
spanAttributes.orElse(null).
-
spanAttributes
final ProjectLogsEvent.Builder spanAttributes(JsonField<SpanAttributes> spanAttributes)
Sets Builder.spanAttributes to an arbitrary JSON value.
You should usually call Builder.spanAttributes with a well-typed SpanAttributes value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
spanParents
final ProjectLogsEvent.Builder spanParents(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
-
spanParents
final ProjectLogsEvent.Builder spanParents(Optional<List<String>> spanParents)
Alias for calling Builder.spanParents with
spanParents.orElse(null).
-
spanParents
final ProjectLogsEvent.Builder spanParents(JsonField<List<String>> spanParents)
Sets Builder.spanParents to an arbitrary JSON value.
You should usually call Builder.spanParents with a well-typed
List<String>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addSpanParent
final ProjectLogsEvent.Builder addSpanParent(String spanParent)
Adds a single String to spanParents.
-
tags
final ProjectLogsEvent.Builder tags(List<String> tags)
A list of tags to log
-
tags
final ProjectLogsEvent.Builder tags(Optional<List<String>> tags)
Alias for calling Builder.tags with
tags.orElse(null).
-
tags
final ProjectLogsEvent.Builder tags(JsonField<List<String>> tags)
Sets Builder.tags to an arbitrary JSON value.
You should usually call Builder.tags with a well-typed
List<String>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addTag
final ProjectLogsEvent.Builder addTag(String tag)
-
additionalProperties
final ProjectLogsEvent.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ProjectLogsEvent.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ProjectLogsEvent.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ProjectLogsEvent.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ProjectLogsEvent.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ProjectLogsEvent build()
Returns an immutable instance of ProjectLogsEvent.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.id() ._xactId() .created() .logId() .orgId() .projectId() .rootSpanId() .spanId()
-
-
-
-