Class: OpenAI::Model::Assistant
- Inherits:
-
Object
- Object
- OpenAI::Model::Assistant
- Defined in:
- lib/openai/models/assistant.rb
Overview
Represents an OpenAI Assistant
Instance Attribute Summary collapse
-
#created_at ⇒ Integer
readonly
The Unix timestamp (in seconds) for when the assistant was created.
-
#description ⇒ String | nil
readonly
The description of the assistant.
-
#id ⇒ String
readonly
The identifier, which can be referenced in API endpoints.
-
#instructions ⇒ String | nil
readonly
The system instructions that the assistant uses.
-
#metadata ⇒ Hash
readonly
Set of 16 key-value pairs that can be attached to an object.
-
#model ⇒ String
readonly
ID of the model to use.
-
#name ⇒ String | nil
readonly
The name of the assistant.
-
#object ⇒ String
readonly
The object type, which is always assistant.
-
#response_format ⇒ String
readonly
Specifies the format that the model must output.
-
#temperature ⇒ Numeric | nil
readonly
What sampling temperature to use, between 0 and 2.
-
#tool_resources ⇒ String | nul
readonly
A set of resources that are used by the assistant’s tools.
-
#tools ⇒ Array
readonly
A list of tool enabled on the assistant.
-
#top_p ⇒ Numeric | nil
readonly
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Assistant
constructor
A new instance of Assistant.
Constructor Details
#initialize(attributes) ⇒ Assistant
Returns a new instance of Assistant.
45 46 47 48 49 |
# File 'lib/openai/models/assistant.rb', line 45 def initialize(attributes) attributes.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#created_at ⇒ Integer (readonly)
Returns The Unix timestamp (in seconds) for when the assistant was created.
13 14 15 |
# File 'lib/openai/models/assistant.rb', line 13 def created_at @created_at end |
#description ⇒ String | nil (readonly)
Returns The description of the assistant. The maximum length is 512 characters.
19 20 21 |
# File 'lib/openai/models/assistant.rb', line 19 def description @description end |
#id ⇒ String (readonly)
Returns The identifier, which can be referenced in API endpoints.
7 8 9 |
# File 'lib/openai/models/assistant.rb', line 7 def id @id end |
#instructions ⇒ String | nil (readonly)
Returns The system instructions that the assistant uses. The maximum length is 256,000 characters.
25 26 27 |
# File 'lib/openai/models/assistant.rb', line 25 def instructions @instructions end |
#metadata ⇒ Hash (readonly)
Returns 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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
34 35 36 |
# File 'lib/openai/models/assistant.rb', line 34 def @metadata end |
#model ⇒ String (readonly)
Returns ID of the model to use.
22 23 24 |
# File 'lib/openai/models/assistant.rb', line 22 def model @model end |
#name ⇒ String | nil (readonly)
Returns The name of the assistant. The maximum length is 256 characters.
16 17 18 |
# File 'lib/openai/models/assistant.rb', line 16 def name @name end |
#object ⇒ String (readonly)
Returns The object type, which is always assistant.
10 11 12 |
# File 'lib/openai/models/assistant.rb', line 10 def object @object end |
#response_format ⇒ String (readonly)
Returns Specifies the format that the model must output.
43 44 45 |
# File 'lib/openai/models/assistant.rb', line 43 def response_format @response_format end |
#temperature ⇒ Numeric | nil (readonly)
Returns What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
37 38 39 |
# File 'lib/openai/models/assistant.rb', line 37 def temperature @temperature end |
#tool_resources ⇒ String | nul (readonly)
Returns A set of resources that are used by the assistant’s tools. The resources are specific to the type of tool. For example, the code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.
31 32 33 |
# File 'lib/openai/models/assistant.rb', line 31 def tool_resources @tool_resources end |
#tools ⇒ Array (readonly)
Returns A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, file_search, or function.
28 29 30 |
# File 'lib/openai/models/assistant.rb', line 28 def tools @tools end |
#top_p ⇒ Numeric | nil (readonly)
Returns An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.
40 41 42 |
# File 'lib/openai/models/assistant.rb', line 40 def top_p @top_p end |