Class: OpenAI::Model::Assistant

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/models/assistant.rb

Overview

Represents an OpenAI Assistant

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atInteger (readonly)

Returns The Unix timestamp (in seconds) for when the assistant was created.

Returns:

  • (Integer)

    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

#descriptionString | nil (readonly)

Returns The description of the assistant. The maximum length is 512 characters.

Returns:

  • (String | nil)

    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

#idString (readonly)

Returns The identifier, which can be referenced in API endpoints.

Returns:

  • (String)

    The identifier, which can be referenced in API endpoints.



7
8
9
# File 'lib/openai/models/assistant.rb', line 7

def id
  @id
end

#instructionsString | nil (readonly)

Returns The system instructions that the assistant uses. The maximum length is 256,000 characters.

Returns:

  • (String | nil)

    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

#metadataHash (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.

Returns:

  • (Hash)

    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

#modelString (readonly)

Returns ID of the model to use.

Returns:

  • (String)

    ID of the model to use.



22
23
24
# File 'lib/openai/models/assistant.rb', line 22

def model
  @model
end

#nameString | nil (readonly)

Returns The name of the assistant. The maximum length is 256 characters.

Returns:

  • (String | nil)

    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

#objectString (readonly)

Returns The object type, which is always assistant.

Returns:

  • (String)

    The object type, which is always assistant.



10
11
12
# File 'lib/openai/models/assistant.rb', line 10

def object
  @object
end

#response_formatString (readonly)

Returns Specifies the format that the model must output.

Returns:

  • (String)

    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

#temperatureNumeric | 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.

Returns:

  • (Numeric | nil)

    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_resourcesString | 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.

Returns:

  • (String | nul)

    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

#toolsArray (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.

Returns:

  • (Array)

    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_pNumeric | 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.

Returns:

  • (Numeric | nil)

    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