Class: OpenAI::Models::Beta::Thread

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/thread.rb

Overview

Defined Under Namespace

Classes: ToolResources

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, #inspect, inspect, 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(id: , created_at: , metadata: , tool_resources: , object: :thread) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Beta::Thread for more details.

Represents a thread that contains [messages](platform.openai.com/docs/api-reference/messages).

Parameters:

  • id (String) (defaults to: )

    The identifier, which can be referenced in API endpoints.

  • created_at (Integer) (defaults to: )

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

  • metadata (Hash{Symbol=>String}, nil) (defaults to: )

    Set of 16 key-value pairs that can be attached to an object. This can be

  • tool_resources (OpenAI::Models::Beta::Thread::ToolResources, nil) (defaults to: )

    A set of resources that are made available to the assistant’s tools in this thre

  • object (Symbol, :thread) (defaults to: :thread)

    The object type, which is always ‘thread`.



# File 'lib/openai/models/beta/thread.rb', line 46

Instance Attribute Details

#created_atInteger

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

Returns:

  • (Integer)


18
# File 'lib/openai/models/beta/thread.rb', line 18

required :created_at, Integer

#idString

The identifier, which can be referenced in API endpoints.

Returns:

  • (String)


12
# File 'lib/openai/models/beta/thread.rb', line 12

required :id, String

#metadataHash{Symbol=>String}?

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.

Returns:

  • (Hash{Symbol=>String}, nil)


29
# File 'lib/openai/models/beta/thread.rb', line 29

required :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#objectSymbol, :thread

The object type, which is always ‘thread`.

Returns:

  • (Symbol, :thread)


35
# File 'lib/openai/models/beta/thread.rb', line 35

required :object, const: :thread

#tool_resourcesOpenAI::Models::Beta::Thread::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 the `file_search` tool requires a list of vector store IDs.



44
# File 'lib/openai/models/beta/thread.rb', line 44

required :tool_resources, -> { OpenAI::Beta::Thread::ToolResources }, nil?: true