Class: OpenAI::Models::Beta::ThreadCreateParams::Message
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Beta::ThreadCreateParams::Message
- Defined in:
- lib/openai/models/beta/thread_create_params.rb,
sig/openai/models/beta/thread_create_params.rbs
Defined Under Namespace
Modules: Content, Role Classes: Attachment
Instance Attribute Summary collapse
-
#attachments ⇒ ::Array[OpenAI::Beta::ThreadCreateParams::Message::Attachment]?
A list of files attached to the message, and the tools they should be added to.
-
#content ⇒ OpenAI::Models::Beta::ThreadCreateParams::Message::content
The text contents of the message.
-
#metadata ⇒ OpenAI::Models::metadata?
Set of 16 key-value pairs that can be attached to an object.
-
#role ⇒ OpenAI::Models::Beta::ThreadCreateParams::Message::role
The role of the entity that is creating the message.
Attributes inherited from Internal::Type::BaseModel
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Internal::Type::BaseModel
==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(content:, role:, attachments: nil, metadata: nil) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/openai/models/beta/thread_create_params.rb', line 61 class Message < OpenAI::Internal::Type::BaseModel # @!attribute content # The text contents of the message. # # @return [String, Array<OpenAI::Models::Beta::Threads::ImageFileContentBlock, OpenAI::Models::Beta::Threads::ImageURLContentBlock, OpenAI::Models::Beta::Threads::TextContentBlockParam>] required :content, union: -> { OpenAI::Beta::ThreadCreateParams::Message::Content } # @!attribute 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. # # @return [Symbol, OpenAI::Models::Beta::ThreadCreateParams::Message::Role] required :role, enum: -> { OpenAI::Beta::ThreadCreateParams::Message::Role } # @!attribute attachments # A list of files attached to the message, and the tools they should be added to. # # @return [Array<OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment>, nil] optional( :attachments, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ThreadCreateParams::Message::Attachment] }, nil?: true ) # @!attribute 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. # # @return [Hash{Symbol=>String}, nil] optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true # @!method initialize(content:, role:, attachments: nil, metadata: nil) # @param content [String, Array<OpenAI::Models::Beta::Threads::ImageFileContentBlock, OpenAI::Models::Beta::Threads::ImageURLContentBlock, OpenAI::Models::Beta::Threads::TextContentBlockParam>] # The text contents of the message. # # @param role [Symbol, OpenAI::Models::Beta::ThreadCreateParams::Message::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. # # @param attachments [Array<OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment>, nil] # A list of files attached to the message, and the tools they should be added to. # # @param metadata [Hash{Symbol=>String}, nil] # 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. # The text contents of the message. # # @see OpenAI::Models::Beta::ThreadCreateParams::Message#content module Content extend OpenAI::Internal::Type::Union # The text contents of the message. variant String # An array of content parts with a defined type, each can be of type `text` or images can be passed with `image_url` or `image_file`. Image types are only supported on [Vision-compatible models](https://developers.openai.com/api/docs/models). variant -> { OpenAI::Models::Beta::ThreadCreateParams::Message::Content::MessageContentPartParamArray } # @!method self.variants # @return [Array(String, Array<OpenAI::Models::Beta::Threads::ImageFileContentBlock, OpenAI::Models::Beta::Threads::ImageURLContentBlock, OpenAI::Models::Beta::Threads::TextContentBlockParam>)] # @type [OpenAI::Internal::Type::Converter] MessageContentPartParamArray = OpenAI::Internal::Type::ArrayOf[ union: -> { OpenAI::Beta::Threads::MessageContentPartParam } ] end # 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. # # @see OpenAI::Models::Beta::ThreadCreateParams::Message#role module Role extend OpenAI::Internal::Type::Enum USER = :user ASSISTANT = :assistant # @!method self.values # @return [Array<Symbol>] end class Attachment < OpenAI::Internal::Type::BaseModel # @!attribute file_id # The ID of the file to attach to the message. # # @return [String, nil] optional :file_id, String # @!attribute tools # The tools to add this file to. # # @return [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::Tool::FileSearch>, nil] optional( :tools, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::ThreadCreateParams::Message::Attachment::Tool] } ) # @!method initialize(file_id: nil, tools: nil) # @param file_id [String] # The ID of the file to attach to the message. # # @param tools [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::Tool::FileSearch>] # The tools to add this file to. module Tool extend OpenAI::Internal::Type::Union discriminator :type variant :code_interpreter, -> { OpenAI::Beta::CodeInterpreterTool } variant :file_search, -> { OpenAI::Beta::ThreadCreateParams::Message::Attachment::Tool::FileSearch } class FileSearch < OpenAI::Internal::Type::BaseModel # @!attribute type # The type of tool being defined: `file_search` # # @return [Symbol, :file_search] required :type, const: :file_search # @!method initialize(type: :file_search) # @param type [Symbol, :file_search] # The type of tool being defined: `file_search` end # @!method self.variants # @return [Array(OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::ThreadCreateParams::Message::Attachment::Tool::FileSearch)] end end end |
Instance Attribute Details
#attachments ⇒ ::Array[OpenAI::Beta::ThreadCreateParams::Message::Attachment]?
A list of files attached to the message, and the tools they should be added to.
83 84 85 86 87 88 89 |
# File 'lib/openai/models/beta/thread_create_params.rb', line 83 optional( :attachments, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::ThreadCreateParams::Message::Attachment] }, nil?: true ) |
#content ⇒ OpenAI::Models::Beta::ThreadCreateParams::Message::content
The text contents of the message.
66 |
# File 'lib/openai/models/beta/thread_create_params.rb', line 66 required :content, union: -> { OpenAI::Beta::ThreadCreateParams::Message::Content } |
#metadata ⇒ OpenAI::Models::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.
100 |
# File 'lib/openai/models/beta/thread_create_params.rb', line 100 optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true |
#role ⇒ OpenAI::Models::Beta::ThreadCreateParams::Message::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.
77 |
# File 'lib/openai/models/beta/thread_create_params.rb', line 77 required :role, enum: -> { OpenAI::Beta::ThreadCreateParams::Message::Role } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/beta/thread_create_params.rb', line 160
|
Instance Method Details
#to_hash ⇒ {
128 |
# File 'sig/openai/models/beta/thread_create_params.rbs', line 128
def to_hash: -> {
|