Class InsertDatasetEvent.Builder
-
- All Implemented Interfaces:
public final class InsertDatasetEvent.BuilderA builder for InsertDatasetEvent.
-
-
Method Summary
Modifier and Type Method Description final InsertDatasetEvent.Builderid(String id)A unique identifier for the dataset event. final InsertDatasetEvent.Builderid(Optional<String> id)Alias for calling Builder.id with id.orElse(null).final InsertDatasetEvent.Builderid(JsonField<String> id)Sets Builder.id to an arbitrary JSON value. final InsertDatasetEvent.Builder_isMerge(Boolean _isMerge)The _is_mergefield controls how the row is merged with any existing row with the same id in the DB.final InsertDatasetEvent.Builder_isMerge(Boolean _isMerge)Alias for Builder._isMerge. final InsertDatasetEvent.Builder_isMerge(Optional<Boolean> _isMerge)Alias for calling Builder._isMerge with _isMerge.orElse(null).final InsertDatasetEvent.Builder_isMerge(JsonField<Boolean> _isMerge)Sets Builder._isMerge to an arbitrary JSON value. final InsertDatasetEvent.Builder_mergePaths(List<List<String>> _mergePaths)The _merge_pathsfield allows controlling the depth of the merge, when_is_merge=true.final InsertDatasetEvent.Builder_mergePaths(Optional<List<List<String>>> _mergePaths)Alias for calling Builder._mergePaths with _mergePaths.orElse(null).final InsertDatasetEvent.Builder_mergePaths(JsonField<List<List<String>>> _mergePaths)Sets Builder._mergePaths to an arbitrary JSON value. final InsertDatasetEvent.BuilderaddMergePath(List<String> mergePath)Adds a single List<String> to _mergePaths. final InsertDatasetEvent.Builder_objectDelete(Boolean _objectDelete)Pass _object_delete=trueto mark the dataset event deleted.final InsertDatasetEvent.Builder_objectDelete(Boolean _objectDelete)Alias for Builder._objectDelete. final InsertDatasetEvent.Builder_objectDelete(Optional<Boolean> _objectDelete)Alias for calling Builder._objectDelete with _objectDelete.orElse(null).final InsertDatasetEvent.Builder_objectDelete(JsonField<Boolean> _objectDelete)Sets Builder._objectDelete to an arbitrary JSON value. final InsertDatasetEvent.Builder_parentId(String _parentId)DEPRECATED: The _parent_idfield is deprecated and should not be used.final InsertDatasetEvent.Builder_parentId(Optional<String> _parentId)Alias for calling Builder._parentId with _parentId.orElse(null).final InsertDatasetEvent.Builder_parentId(JsonField<String> _parentId)Sets Builder._parentId to an arbitrary JSON value. final InsertDatasetEvent.Buildercreated(OffsetDateTime created)The timestamp the dataset event was created final InsertDatasetEvent.Buildercreated(Optional<OffsetDateTime> created)Alias for calling Builder.created with created.orElse(null).final InsertDatasetEvent.Buildercreated(JsonField<OffsetDateTime> created)Sets Builder.created to an arbitrary JSON value. final InsertDatasetEvent.Builderexpected(JsonValue expected)The output of your application, including post-processing (an arbitrary, JSON serializable object) final InsertDatasetEvent.Builderinput(JsonValue input)The argument that uniquely define an input case (an arbitrary, JSON serializable object) final InsertDatasetEvent.Buildermetadata(InsertDatasetEvent.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 InsertDatasetEvent.Buildermetadata(Optional<InsertDatasetEvent.Metadata> metadata)Alias for calling Builder.metadata with metadata.orElse(null).final InsertDatasetEvent.Buildermetadata(JsonField<InsertDatasetEvent.Metadata> metadata)Sets Builder.metadata to an arbitrary JSON value. final InsertDatasetEvent.Builderorigin(ObjectReference origin)Indicates the event was copied from another object. final InsertDatasetEvent.Builderorigin(Optional<ObjectReference> origin)Alias for calling Builder.origin with origin.orElse(null).final InsertDatasetEvent.Builderorigin(JsonField<ObjectReference> origin)Sets Builder.origin to an arbitrary JSON value. final InsertDatasetEvent.BuilderrootSpanId(String rootSpanId)Use span_id,root_span_id, andspan_parentsinstead of_parent_id, which is now deprecated.final InsertDatasetEvent.BuilderrootSpanId(Optional<String> rootSpanId)Alias for calling Builder.rootSpanId with rootSpanId.orElse(null).final InsertDatasetEvent.BuilderrootSpanId(JsonField<String> rootSpanId)Sets Builder.rootSpanId to an arbitrary JSON value. final InsertDatasetEvent.BuilderspanId(String spanId)Use span_id,root_span_id, andspan_parentsinstead of_parent_id, which is now deprecated.final InsertDatasetEvent.BuilderspanId(Optional<String> spanId)Alias for calling Builder.spanId with spanId.orElse(null).final InsertDatasetEvent.BuilderspanId(JsonField<String> spanId)Sets Builder.spanId to an arbitrary JSON value. final InsertDatasetEvent.BuilderspanParents(List<String> spanParents)Use span_id,root_span_id, andspan_parentsinstead of_parent_id, which is now deprecated.final InsertDatasetEvent.BuilderspanParents(Optional<List<String>> spanParents)Alias for calling Builder.spanParents with spanParents.orElse(null).final InsertDatasetEvent.BuilderspanParents(JsonField<List<String>> spanParents)Sets Builder.spanParents to an arbitrary JSON value. final InsertDatasetEvent.BuilderaddSpanParent(String spanParent)Adds a single String to spanParents. final InsertDatasetEvent.Buildertags(List<String> tags)A list of tags to log final InsertDatasetEvent.Buildertags(Optional<List<String>> tags)Alias for calling Builder.tags with tags.orElse(null).final InsertDatasetEvent.Buildertags(JsonField<List<String>> tags)Sets Builder.tags to an arbitrary JSON value. final InsertDatasetEvent.BuilderaddTag(String tag)Adds a single String to tags. final InsertDatasetEvent.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final InsertDatasetEvent.BuilderputAdditionalProperty(String key, JsonValue value)final InsertDatasetEvent.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final InsertDatasetEvent.BuilderremoveAdditionalProperty(String key)final InsertDatasetEvent.BuilderremoveAllAdditionalProperties(Set<String> keys)final InsertDatasetEventbuild()Returns an immutable instance of InsertDatasetEvent. -
-
Method Detail
-
id
final InsertDatasetEvent.Builder id(String id)
A unique identifier for the dataset event. If you don't provide one, BrainTrust will generate one for you
-
id
final InsertDatasetEvent.Builder id(Optional<String> id)
Alias for calling Builder.id with
id.orElse(null).
-
id
final InsertDatasetEvent.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.
-
_isMerge
final InsertDatasetEvent.Builder _isMerge(Boolean _isMerge)
The
_is_mergefield controls how the row is merged with any existing row with the same id in the DB. By default (or when set tofalse), the existing row is completely replaced by the new row. When set totrue, the new row is deep-merged into the existing row, if one is found. If no existing row is found, the new row is inserted as is.For example, say there is an existing row in the DB
{"id": "foo", "input": {"a": 5, "b": 10}}. If we merge a new row as{"_is_merge": true, "id": "foo", "input": {"b": 11, "c": 20}}, the new row will be{"id": "foo", "input": {"a": 5, "b": 11, "c": 20}}. If we replace the new row as{"id": "foo", "input": {"b": 11, "c": 20}}, the new row will be{"id": "foo", "input": {"b": 11, "c": 20}}
-
_isMerge
final InsertDatasetEvent.Builder _isMerge(Boolean _isMerge)
Alias for Builder._isMerge.
This unboxed primitive overload exists for backwards compatibility.
-
_isMerge
final InsertDatasetEvent.Builder _isMerge(Optional<Boolean> _isMerge)
Alias for calling Builder._isMerge with
_isMerge.orElse(null).
-
_isMerge
final InsertDatasetEvent.Builder _isMerge(JsonField<Boolean> _isMerge)
Sets Builder._isMerge to an arbitrary JSON value.
You should usually call Builder._isMerge with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
_mergePaths
final InsertDatasetEvent.Builder _mergePaths(List<List<String>> _mergePaths)
The
_merge_pathsfield allows controlling the depth of the merge, when_is_merge=true._merge_pathsis a list of paths, where each path is a list of field names. The deep merge will not descend below any of the specified merge paths.For example, say there is an existing row in the DB
{"id": "foo", "input": {"a": {"b": 10}, "c": {"d": 20}}, "output": {"a": 20}}. If we merge a new row as{"_is_merge": true, "_merge_paths": [["input", "a"], ["output"]], "input": {"a": {"q": 30}, "c": {"e": 30}, "bar": "baz"}, "output": {"d": 40}}, the new row will be{"id": "foo": "input": {"a": {"q": 30}, "c": {"d": 20, "e": 30}, "bar": "baz"}, "output": {"d": 40}}. In this case, due to the merge paths, we have replacedinput.aandoutput, but have still deep-mergedinputandinput.c.
-
_mergePaths
final InsertDatasetEvent.Builder _mergePaths(Optional<List<List<String>>> _mergePaths)
Alias for calling Builder._mergePaths with
_mergePaths.orElse(null).
-
_mergePaths
final InsertDatasetEvent.Builder _mergePaths(JsonField<List<List<String>>> _mergePaths)
Sets Builder._mergePaths to an arbitrary JSON value.
You should usually call Builder._mergePaths with a well-typed
List<List<String>>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addMergePath
final InsertDatasetEvent.Builder addMergePath(List<String> mergePath)
Adds a single List<String> to _mergePaths.
-
_objectDelete
final InsertDatasetEvent.Builder _objectDelete(Boolean _objectDelete)
Pass
_object_delete=trueto mark the dataset event deleted. Deleted events will not show up in subsequent fetches for this dataset
-
_objectDelete
final InsertDatasetEvent.Builder _objectDelete(Boolean _objectDelete)
Alias for Builder._objectDelete.
This unboxed primitive overload exists for backwards compatibility.
-
_objectDelete
final InsertDatasetEvent.Builder _objectDelete(Optional<Boolean> _objectDelete)
Alias for calling Builder._objectDelete with
_objectDelete.orElse(null).
-
_objectDelete
final InsertDatasetEvent.Builder _objectDelete(JsonField<Boolean> _objectDelete)
Sets Builder._objectDelete to an arbitrary JSON value.
You should usually call Builder._objectDelete with a well-typed Boolean value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
_parentId
final InsertDatasetEvent.Builder _parentId(String _parentId)
DEPRECATED: The
_parent_idfield is deprecated and should not be used. Support for_parent_idwill be dropped in a future version of Braintrust. Logspan_id,root_span_id, andspan_parentsexplicitly instead.Use the
_parent_idfield to create this row as a subspan of an existing row. Tracking hierarchical relationships are important for tracing (see the guide for full details).For example, say we have logged a row
{"id": "abc", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}. We can create a sub-span of the parent row by logging{"_parent_id": "abc", "id": "llm_call", "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}. In the webapp, only the root span row"abc"will show up in the summary view. You can view the full trace hierarchy (in this case, the"llm_call"row) by clicking on the "abc" row.If the row is being merged into an existing row, this field will be ignored.
-
_parentId
final InsertDatasetEvent.Builder _parentId(Optional<String> _parentId)
Alias for calling Builder._parentId with
_parentId.orElse(null).
-
_parentId
final InsertDatasetEvent.Builder _parentId(JsonField<String> _parentId)
Sets Builder._parentId to an arbitrary JSON value.
You should usually call Builder._parentId 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 InsertDatasetEvent.Builder created(OffsetDateTime created)
The timestamp the dataset event was created
-
created
final InsertDatasetEvent.Builder created(Optional<OffsetDateTime> created)
Alias for calling Builder.created with
created.orElse(null).
-
created
final InsertDatasetEvent.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.
-
expected
final InsertDatasetEvent.Builder expected(JsonValue expected)
The output of your application, including post-processing (an arbitrary, JSON serializable object)
-
input
final InsertDatasetEvent.Builder input(JsonValue input)
The argument that uniquely define an input case (an arbitrary, JSON serializable object)
-
metadata
final InsertDatasetEvent.Builder metadata(InsertDatasetEvent.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 InsertDatasetEvent.Builder metadata(Optional<InsertDatasetEvent.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null).
-
metadata
final InsertDatasetEvent.Builder metadata(JsonField<InsertDatasetEvent.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.
-
origin
final InsertDatasetEvent.Builder origin(ObjectReference origin)
Indicates the event was copied from another object.
-
origin
final InsertDatasetEvent.Builder origin(Optional<ObjectReference> origin)
Alias for calling Builder.origin with
origin.orElse(null).
-
origin
final InsertDatasetEvent.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.
-
rootSpanId
final InsertDatasetEvent.Builder rootSpanId(String rootSpanId)
Use
span_id,root_span_id, andspan_parentsinstead of_parent_id, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the guide for full details.For example, say we have logged a row
{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}. We can create a sub-span of the parent row by logging{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}. In the webapp, only the root span row"abc"will show up in the summary view. You can view the full trace hierarchy (in this case, the"llm_call"row) by clicking on the "abc" row.If the row is being merged into an existing row, this field will be ignored.
-
rootSpanId
final InsertDatasetEvent.Builder rootSpanId(Optional<String> rootSpanId)
Alias for calling Builder.rootSpanId with
rootSpanId.orElse(null).
-
rootSpanId
final InsertDatasetEvent.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 InsertDatasetEvent.Builder spanId(String spanId)
Use
span_id,root_span_id, andspan_parentsinstead of_parent_id, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the guide for full details.For example, say we have logged a row
{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}. We can create a sub-span of the parent row by logging{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}. In the webapp, only the root span row"abc"will show up in the summary view. You can view the full trace hierarchy (in this case, the"llm_call"row) by clicking on the "abc" row.If the row is being merged into an existing row, this field will be ignored.
-
spanId
final InsertDatasetEvent.Builder spanId(Optional<String> spanId)
Alias for calling Builder.spanId with
spanId.orElse(null).
-
spanId
final InsertDatasetEvent.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.
-
spanParents
final InsertDatasetEvent.Builder spanParents(List<String> spanParents)
Use
span_id,root_span_id, andspan_parentsinstead of_parent_id, which is now deprecated. The span_id is a unique identifier describing the row's place in the a trace, and the root_span_id is a unique identifier for the whole trace. See the guide for full details.For example, say we have logged a row
{"id": "abc", "span_id": "span0", "root_span_id": "root_span0", "input": "foo", "output": "bar", "expected": "boo", "scores": {"correctness": 0.33}}. We can create a sub-span of the parent row by logging{"id": "llm_call", "span_id": "span1", "root_span_id": "root_span0", "span_parents": ["span0"], "input": {"prompt": "What comes after foo?"}, "output": "bar", "metrics": {"tokens": 1}}. In the webapp, only the root span row"abc"will show up in the summary view. You can view the full trace hierarchy (in this case, the"llm_call"row) by clicking on the "abc" row.If the row is being merged into an existing row, this field will be ignored.
-
spanParents
final InsertDatasetEvent.Builder spanParents(Optional<List<String>> spanParents)
Alias for calling Builder.spanParents with
spanParents.orElse(null).
-
spanParents
final InsertDatasetEvent.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 InsertDatasetEvent.Builder addSpanParent(String spanParent)
Adds a single String to spanParents.
-
tags
final InsertDatasetEvent.Builder tags(List<String> tags)
A list of tags to log
-
tags
final InsertDatasetEvent.Builder tags(Optional<List<String>> tags)
Alias for calling Builder.tags with
tags.orElse(null).
-
tags
final InsertDatasetEvent.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 InsertDatasetEvent.Builder addTag(String tag)
-
additionalProperties
final InsertDatasetEvent.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final InsertDatasetEvent.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final InsertDatasetEvent.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final InsertDatasetEvent.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final InsertDatasetEvent.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final InsertDatasetEvent build()
Returns an immutable instance of InsertDatasetEvent.
Further updates to this Builder will not mutate the returned instance.
-
-
-
-