Class Thread.Builder
-
- All Implemented Interfaces:
public final class Thread.Builder
A builder for Thread.
-
-
Method Summary
Modifier and Type Method Description final Thread.Builder
id(String id)
The identifier, which can be referenced in API endpoints. final Thread.Builder
id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value. final Thread.Builder
createdAt(Long createdAt)
The Unix timestamp (in seconds) for when the thread was created. final Thread.Builder
createdAt(JsonField<Long> createdAt)
Sets Builder.createdAt to an arbitrary JSON value. final Thread.Builder
metadata(Thread.Metadata metadata)
Set of 16 key-value pairs that can be attached to an object. final Thread.Builder
metadata(Optional<Thread.Metadata> metadata)
Alias for calling Builder.metadata with metadata.orElse(null)
.final Thread.Builder
metadata(JsonField<Thread.Metadata> metadata)
Sets Builder.metadata to an arbitrary JSON value. final Thread.Builder
object_(JsonValue object_)
Sets the field to an arbitrary JSON value. final Thread.Builder
toolResources(Thread.ToolResources toolResources)
A set of resources that are made available to the assistant's tools in this thread. final Thread.Builder
toolResources(Optional<Thread.ToolResources> toolResources)
Alias for calling Builder.toolResources with toolResources.orElse(null)
.final Thread.Builder
toolResources(JsonField<Thread.ToolResources> toolResources)
Sets Builder.toolResources to an arbitrary JSON value. final Thread.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final Thread.Builder
putAdditionalProperty(String key, JsonValue value)
final Thread.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final Thread.Builder
removeAdditionalProperty(String key)
final Thread.Builder
removeAllAdditionalProperties(Set<String> keys)
final Thread
build()
Returns an immutable instance of Thread. -
-
Method Detail
-
id
final Thread.Builder id(String id)
The identifier, which can be referenced in API endpoints.
-
id
final Thread.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.
-
createdAt
final Thread.Builder createdAt(Long createdAt)
The Unix timestamp (in seconds) for when the thread was created.
-
createdAt
final Thread.Builder createdAt(JsonField<Long> createdAt)
Sets Builder.createdAt to an arbitrary JSON value.
You should usually call Builder.createdAt with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
metadata
final Thread.Builder metadata(Thread.Metadata metadata)
Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
-
metadata
final Thread.Builder metadata(Optional<Thread.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null)
.
-
metadata
final Thread.Builder metadata(JsonField<Thread.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.
-
object_
final Thread.Builder object_(JsonValue object_)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("thread")
This method is primarily for setting the field to an undocumented or not yet supported value.
-
toolResources
final Thread.Builder toolResources(Thread.ToolResources toolResources)
A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the
code_interpreter
tool requires a list of file IDs, while thefile_search
tool requires a list of vector store IDs.
-
toolResources
final Thread.Builder toolResources(Optional<Thread.ToolResources> toolResources)
Alias for calling Builder.toolResources with
toolResources.orElse(null)
.
-
toolResources
final Thread.Builder toolResources(JsonField<Thread.ToolResources> toolResources)
Sets Builder.toolResources to an arbitrary JSON value.
You should usually call Builder.toolResources with a well-typed ToolResources value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final Thread.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final Thread.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final Thread.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final Thread.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final Thread.Builder removeAllAdditionalProperties(Set<String> keys)
-
-
-
-