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

Defined Under Namespace

Modules: Type

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(id:, archived_at:, created_at:, ended_at:, error:, inputs:, instructions:, model:, output_behavior:, outputs:, session_id:, status:, type:, usage:) ⇒ void

An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.

By default the dream writes its result to a new memory store and doesn't change the input memory store. With output_behavior set to update_existing, it writes its result into the input memory store instead. The Dreams API is in research preview, so this resource can still change.

See the Dreams guide for what a dream reads and produces.

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

Parameters:



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

Instance Attribute Details

#archived_atTime?

A timestamp in RFC 3339 format

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_atTime

A timestamp in RFC 3339 format

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#ended_atTime?

A timestamp in RFC 3339 format

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


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

required :ended_at, Time, nil?: true

#errorAnthropic::Models::Beta::BetaDreamError?

Failure detail for a Dream whose status is failed.

Parameters:

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

Returns:



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

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

#idString

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

#inputsArray<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:



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

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

#instructionsString?

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

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :instructions, String, nil?: true

#modelAnthropic::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:



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

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

#output_behaviorAnthropic::Models::Beta::BetaOutputBehaviorCreateNew, Anthropic::Models::Beta::BetaOutputBehaviorUpdateExisting

Which memory store a dream writes its result to. Defaults to create_new when left out of a create request.

Parameters:

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

Returns:



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

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

#outputsArray<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:



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

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

#session_idString?

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)


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

required :session_id, String, nil?: true

#statusSymbol, 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:



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

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

#typeSymbol, Anthropic::Models::Beta::BetaDream::Type

Parameters:

  • value (Anthropic::Models::Beta::BetaDream::type_)

Returns:



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

required :type, enum: -> { Anthropic::Beta::BetaDream::Type }

#usageAnthropic::Models::Beta::BetaDreamUsage

The tokens that a dream has used so far.

The counts are zero while the dream is pending and update while it is running. They can keep changing after a cancel.

See the Dreams guide for how dreams are billed. See the prompt caching guide for how the input token counts add up.

Parameters:

  • value (Anthropic::Beta::BetaDreamUsage)

Returns:



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

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

Instance Method Details

#to_hash{

Returns:

  • ({)


70
# File 'sig/anthropic/models/beta/beta_dream.rbs', line 70

def to_hash: -> {