Class ThreadCreateAndRunParams.Thread.Message.Builder
-
- All Implemented Interfaces:
public final class ThreadCreateAndRunParams.Thread.Message.Builder
A builder for Message.
-
-
Method Summary
-
-
Method Detail
-
content
final ThreadCreateAndRunParams.Thread.Message.Builder content(ThreadCreateAndRunParams.Thread.Message.Content content)
The text contents of the message.
-
content
final ThreadCreateAndRunParams.Thread.Message.Builder content(JsonField<ThreadCreateAndRunParams.Thread.Message.Content> content)
Sets Builder.content to an arbitrary JSON value.
You should usually call Builder.content with a well-typed Content value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
content
final ThreadCreateAndRunParams.Thread.Message.Builder content(String text)
Alias for calling content with
Content.ofText(text)
.
-
contentOfArrayOfContentParts
final ThreadCreateAndRunParams.Thread.Message.Builder contentOfArrayOfContentParts(List<MessageContentPartParam> arrayOfContentParts)
Alias for calling content with
Content.ofArrayOfContentParts(arrayOfContentParts)
.
-
role
final ThreadCreateAndRunParams.Thread.Message.Builder role(ThreadCreateAndRunParams.Thread.Message.Role role)
The role of the entity that is creating the message. Allowed values include:
user
: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.assistant
: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
-
role
final ThreadCreateAndRunParams.Thread.Message.Builder role(JsonField<ThreadCreateAndRunParams.Thread.Message.Role> role)
Sets Builder.role to an arbitrary JSON value.
You should usually call Builder.role with a well-typed Role value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
attachments
final ThreadCreateAndRunParams.Thread.Message.Builder attachments(List<ThreadCreateAndRunParams.Thread.Message.Attachment> attachments)
A list of files attached to the message, and the tools they should be added to.
-
attachments
final ThreadCreateAndRunParams.Thread.Message.Builder attachments(Optional<List<ThreadCreateAndRunParams.Thread.Message.Attachment>> attachments)
Alias for calling Builder.attachments with
attachments.orElse(null)
.
-
attachments
final ThreadCreateAndRunParams.Thread.Message.Builder attachments(JsonField<List<ThreadCreateAndRunParams.Thread.Message.Attachment>> attachments)
Sets Builder.attachments to an arbitrary JSON value.
You should usually call Builder.attachments with a well-typed
List<Attachment>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addAttachment
final ThreadCreateAndRunParams.Thread.Message.Builder addAttachment(ThreadCreateAndRunParams.Thread.Message.Attachment attachment)
Adds a single Attachment to attachments.
-
metadata
final ThreadCreateAndRunParams.Thread.Message.Builder metadata(ThreadCreateAndRunParams.Thread.Message.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 ThreadCreateAndRunParams.Thread.Message.Builder metadata(Optional<ThreadCreateAndRunParams.Thread.Message.Metadata> metadata)
Alias for calling Builder.metadata with
metadata.orElse(null)
.
-
metadata
final ThreadCreateAndRunParams.Thread.Message.Builder metadata(JsonField<ThreadCreateAndRunParams.Thread.Message.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.
-
additionalProperties
final ThreadCreateAndRunParams.Thread.Message.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final ThreadCreateAndRunParams.Thread.Message.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final ThreadCreateAndRunParams.Thread.Message.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final ThreadCreateAndRunParams.Thread.Message.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final ThreadCreateAndRunParams.Thread.Message.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final ThreadCreateAndRunParams.Thread.Message build()
Returns an immutable instance of Message.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.content() .role()
-
-
-
-