Class: Anthropic::Models::Beta::BetaDream

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_dream.rb,
sig/anthropic/models/beta/beta_dream.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::Dreams#create

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, 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 ⇒ BetaDream

Returns a new instance of BetaDream.

Parameters:

  • id: (String)
  • archived_at: (Time, nil)
  • created_at: (Time)
  • ended_at: (Time, nil)
  • error: (Anthropic::Beta::BetaDreamErrorObject, nil)
  • inputs: (::Array[Anthropic::Models::Beta::beta_dream_input])
  • instructions: (String, nil)
  • model: (Anthropic::Beta::BetaDreamModelConfig)
  • output_behavior: (Anthropic::Models::Beta::beta_output_behavior)
  • outputs: (::Array[Anthropic::Beta::BetaDreamOutput])
  • session_id: (String, nil)
  • status: (Anthropic::Models::Beta::beta_dream_status)
  • usage: (Anthropic::Beta::BetaDreamUsage)
  • type: (:dream)


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'sig/anthropic/models/beta/beta_dream.rbs', line 53

def initialize: (
  id: String,
  archived_at: Time?,
  created_at: Time,
  ended_at: Time?,
  error: Anthropic::Beta::BetaDreamErrorObject?,
  inputs: ::Array[Anthropic::Models::Beta::beta_dream_input],
  instructions: String?,
  model: Anthropic::Beta::BetaDreamModelConfig,
  output_behavior: Anthropic::Models::Beta::beta_output_behavior,
  outputs: ::Array[Anthropic::Beta::BetaDreamOutput],
  session_id: String?,
  status: Anthropic::Models::Beta::beta_dream_status,
  usage: Anthropic::Beta::BetaDreamUsage,
  ?type: :dream
) -> void

Instance Attribute Details

#archived_at ⇒ Time?

When the dream was archived, in RFC 3339, or null if it hasn't been archived.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


18
# File 'lib/anthropic/models/beta/beta_dream.rb', line 18

required :archived_at, Time, nil?: true

#created_at ⇒ Time

When the dream was created, in RFC 3339.

Lists of dreams are sorted by this time, newest first.

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#ended_at ⇒ Time?

When the dream reached completed, failed, or canceled, in RFC 3339, or null if it is still pending or running.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


33
# File 'lib/anthropic/models/beta/beta_dream.rb', line 33

required :ended_at, Time, nil?: true

#error ⇒ Anthropic::Models::Beta::BetaDreamErrorObject?

Why the dream failed, or null if status isn't failed.

Parameters:

  • value (Anthropic::Beta::BetaDreamErrorObject, nil)

Returns:



39
# File 'lib/anthropic/models/beta/beta_dream.rb', line 39

required :error, -> { Anthropic::Beta::BetaDreamErrorObject }, nil?: true

#id ⇒ String

The unique ID of the dream (drm_...).

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/anthropic/models/beta/beta_dream.rb', line 12

required :id, String

#inputs ⇒ Array<Anthropic::Models::Beta::BetaDreamMemoryStoreInput, Anthropic::Models::Beta::BetaDreamSessionsInput>

The sources that the dream reads, from the request that created it.

Parameters:

  • value (::Array[Anthropic::Models::Beta::beta_dream_input])

Returns:



45
# File 'lib/anthropic/models/beta/beta_dream.rb', line 45

required :inputs, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaDreamInput] }

#instructions ⇒ String?

The guidance given when the dream was created, or null if none was given.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


51
# File 'lib/anthropic/models/beta/beta_dream.rb', line 51

required :instructions, String, nil?: true

#model ⇒ Anthropic::Models::Beta::BetaDreamModelConfig

The model that runs a dream, from the request that created it.

The dream uses this model for all of its work. The response always gives the model as an object, even if the request gave only a model ID.

Parameters:

  • value (Anthropic::Beta::BetaDreamModelConfig)

Returns:



60
# File 'lib/anthropic/models/beta/beta_dream.rb', line 60

required :model, -> { Anthropic::Beta::BetaDreamModelConfig }

#output_behavior ⇒ Anthropic::Models::Beta::BetaOutputBehaviorCreateNew, Anthropic::Models::Beta::BetaOutputBehaviorUpdateExisting

Where the dream writes its result, as set in the request that created the dream. If that request left out output_behavior, the dream used the create_new behavior.

Parameters:

  • value (Anthropic::Models::Beta::beta_output_behavior)

Returns:



68
# File 'lib/anthropic/models/beta/beta_dream.rb', line 68

required :output_behavior, union: -> { Anthropic::Beta::BetaOutputBehavior }

#outputs ⇒ Array<Anthropic::Models::Beta::BetaDreamOutput>

The memory store that holds the dream's result, as a one-item array, or an empty array until the dream records that memory store.

The array is empty while the dream is pending and for a short time after it starts running. It can stay empty if the dream fails or is canceled before then. The memory store holds the complete result only once status is completed.

See the Dreams guide for how to review and use the result.

Parameters:

  • value (::Array[Anthropic::Beta::BetaDreamOutput])

Returns:



84
# File 'lib/anthropic/models/beta/beta_dream.rb', line 84

required :outputs, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaDreamOutput] }

#session_id ⇒ String?

The ID of the session that runs the dream (sesn_...), or null if that session hasn't started.

Stream that session's events to follow what the dream reads and writes.

See the Dreams guide for how to watch a running dream.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


97
# File 'lib/anthropic/models/beta/beta_dream.rb', line 97

required :session_id, String, nil?: true

#status ⇒ Symbol, Anthropic::Models::Beta::BetaDreamStatus

Where a dream is in its lifecycle.

completed, failed, and canceled are final: once a dream has one of these statuses, its status doesn't change again.

See the Dreams guide for what each status means.

Parameters:

  • value (Anthropic::Models::Beta::beta_dream_status)

Returns:



110
# File 'lib/anthropic/models/beta/beta_dream.rb', line 110

required :status, enum: -> { Anthropic::Beta::BetaDreamStatus }

#type ⇒ Symbol, :dream

Parameters:

  • value (:dream)

Returns:

  • (Symbol, :dream)


115
# File 'lib/anthropic/models/beta/beta_dream.rb', line 115

required :type, const: :dream

#usage ⇒ Anthropic::Models::Beta::BetaDreamUsage

The dream's token counts, which stop changing once its status is completed or failed. After a cancel, they can keep changing.

Parameters:

  • value (Anthropic::Beta::BetaDreamUsage)

Returns:



122
# File 'lib/anthropic/models/beta/beta_dream.rb', line 122

required :usage, -> { Anthropic::Beta::BetaDreamUsage }

Instance Method Details

#to_hash ⇒ { id: String, archived_at: Time?, created_at: Time, ended_at: Time?, error: Anthropic::Beta::BetaDreamErrorObject?, inputs: ::Array[Anthropic::Models::Beta::beta_dream_input], instructions: String?, model: Anthropic::Beta::BetaDreamModelConfig, output_behavior: Anthropic::Models::Beta::beta_output_behavior, outputs: ::Array[Anthropic::Beta::BetaDreamOutput], session_id: String?, status: Anthropic::Models::Beta::beta_dream_status, type: :dream, usage: Anthropic::Beta::BetaDreamUsage }

Returns:

  • ({ id: String, archived_at: Time?, created_at: Time, ended_at: Time?, error: Anthropic::Beta::BetaDreamErrorObject?, inputs: ::Array[Anthropic::Models::Beta::beta_dream_input], instructions: String?, model: Anthropic::Beta::BetaDreamModelConfig, output_behavior: Anthropic::Models::Beta::beta_output_behavior, outputs: ::Array[Anthropic::Beta::BetaDreamOutput], session_id: String?, status: Anthropic::Models::Beta::beta_dream_status, type: :dream, usage: Anthropic::Beta::BetaDreamUsage })


70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'sig/anthropic/models/beta/beta_dream.rbs', line 70

def to_hash: -> {
  id: String,
  archived_at: Time?,
  created_at: Time,
  ended_at: Time?,
  error: Anthropic::Beta::BetaDreamErrorObject?,
  inputs: ::Array[Anthropic::Models::Beta::beta_dream_input],
  instructions: String?,
  model: Anthropic::Beta::BetaDreamModelConfig,
  output_behavior: Anthropic::Models::Beta::beta_output_behavior,
  outputs: ::Array[Anthropic::Beta::BetaDreamOutput],
  session_id: String?,
  status: Anthropic::Models::Beta::beta_dream_status,
  type: :dream,
  usage: Anthropic::Beta::BetaDreamUsage
}