Module: Anthropic::Models::Beta::BetaDreamInput

Extended by:
Internal::Type::Union
Defined in:
lib/anthropic/models/beta/beta_dream_input.rb,
sig/anthropic/models/beta/beta_dream_input.rbs

Overview

A source that a dream reads, such as a memory store or a set of sessions.

Defined Under Namespace

Modules: Type

Class Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Class Method Details

.new(type:, memory_store_id:) ⇒ Anthropic::Beta::BetaDreamMemoryStoreInput .new(type:, session_ids:) ⇒ Anthropic::Beta::BetaDreamSessionsInput .new(type:, memory_store_id:, session_ids:) ⇒ Anthropic::Models::Beta::beta_dream_input

Creates a new instance of the variant class whose type matches the given value, passing the remaining arguments to its constructor.

Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaDreamInput for more details.

Overloads:

  • .new(type:, memory_store_id:) ⇒ Anthropic::Beta::BetaDreamMemoryStoreInput

    Parameters:

    • type: (:memory_store, "memory_store")
    • memory_store_id: (String)

    Returns:

    • (Anthropic::Beta::BetaDreamMemoryStoreInput)
  • .new(type:, session_ids:) ⇒ Anthropic::Beta::BetaDreamSessionsInput

    Parameters:

    • type: (:sessions, "sessions")
    • session_ids: (::Array[String])

    Returns:

    • (Anthropic::Beta::BetaDreamSessionsInput)
  • .new(type:, memory_store_id:, session_ids:) ⇒ Anthropic::Models::Beta::beta_dream_input

    Parameters:

    • type: (Anthropic::Models::Beta::BetaDreamInput::type_, String)
    • memory_store_id: (String)
    • session_ids: (::Array[String])

    Returns:

    • (Anthropic::Models::Beta::beta_dream_input)

Parameters:

  • type (Symbol, Anthropic::Models::Beta::BetaDreamInput::Type, String)
  • args (Hash{Symbol=>Object}) —

    Attributes for the chosen variant.

    @option args [String] :memory_store_id The ID of the memory store for the dream to read (memstore_...).

    @option args [Array] :session_ids The IDs of the sessions whose transcripts the dream reads (sesn_...).

Returns:

Raises:

  • (ArgumentError)


49
50
51
52
53
54
55
56
57
58
# File 'lib/anthropic/models/beta/beta_dream_input.rb', line 49

def self.new(type:, **args)
  case type.to_sym
  when :memory_store
    Anthropic::Beta::BetaDreamMemoryStoreInput.new(**args)
  when :sessions
    Anthropic::Beta::BetaDreamSessionsInput.new(**args)
  else
    raise ArgumentError, "unknown type: #{type}"
  end
end

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/beta_dream_input.rb', line 26

.variants ⇒ Array(Anthropic::Models::Beta::BetaDreamMemoryStoreInput, Anthropic::Models::Beta::BetaDreamSessionsInput)



# File 'lib/anthropic/models/beta/beta_dream_input.rb', line 30