Class: Anthropic::Resources::Beta::Dreams

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/dreams.rb,
sig/anthropic/resources/beta/dreams.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Dreams

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Dreams.

Parameters:



180
181
182
# File 'lib/anthropic/resources/beta/dreams.rb', line 180

def initialize(client:)
  @client = client
end

Instance Method Details

#archive(dream_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream

Archive a Dream

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

Parameters:

  • dream_id (String)

    Path parameter dream_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



137
138
139
140
141
142
143
144
145
146
# File 'lib/anthropic/resources/beta/dreams.rb', line 137

def archive(dream_id, params = {})
  parsed, options = Anthropic::Beta::DreamArchiveParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/dreams/%1$s/archive?beta=true", dream_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaDream,
    options: {extra_headers: {"anthropic-beta" => "dreaming-2026-04-21"}, **options}
  )
end

#cancel(dream_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream

Cancel a Dream

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

Parameters:

  • dream_id (String)

    Path parameter dream_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



166
167
168
169
170
171
172
173
174
175
# File 'lib/anthropic/resources/beta/dreams.rb', line 166

def cancel(dream_id, params = {})
  parsed, options = Anthropic::Beta::DreamCancelParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/dreams/%1$s/cancel?beta=true", dream_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaDream,
    options: {extra_headers: {"anthropic-beta" => "dreaming-2026-04-21"}, **options}
  )
end

#create(inputs:, model:, instructions: nil, output_behavior: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream

Create a Dream

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

Parameters:

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/anthropic/resources/beta/dreams.rb', line 31

def create(params)
  parsed, options = Anthropic::Beta::DreamCreateParams.dump_request(params)
  header_params = {betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"}
  @client.request(
    method: :post,
    path: "v1/dreams?beta=true",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Beta::BetaDream,
    options: {extra_headers: {"anthropic-beta" => "dreaming-2026-04-21"}, **options}
  )
end

#list(created_at_gt: nil, created_at_lt: nil, include_archived: nil, limit: nil, page: nil, statuses: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaDream>

List Dreams

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

Parameters:

  • created_at_gt (Time)

    Query param: Return dreams with created_at strictly after this timestamp (excl

  • created_at_lt (Time)

    Query param: Return dreams with created_at strictly before this timestamp (exc

  • include_archived (Boolean)

    Query param: Query parameter for include_archived

  • limit (Integer)

    Query param: Query parameter for limit

  • page (String)

    Query param: Query parameter for page

  • statuses (Array<Symbol, Anthropic::Models::Beta::BetaDreamStatus>)

    Query param: Filter by lifecycle status. Repeat the parameter to match any of mu

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Header param: Optional header to select the Workspace for this request. The valu

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/anthropic/resources/beta/dreams.rb', line 101

def list(params = {})
  query_params = [:created_at_gt, :created_at_lt, :include_archived, :limit, :page, :statuses]
  parsed, options = Anthropic::Beta::DreamListParams.dump_request(params)
  query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: "v1/dreams?beta=true",
    query: query.transform_keys(created_at_gt: "created_at[gt]", created_at_lt: "created_at[lt]"),
    headers: parsed.except(*query_params).transform_keys(
      betas: "anthropic-beta",
      workspace_id: "anthropic-workspace-id"
    ),
    page: Anthropic::Internal::PageCursor,
    model: Anthropic::Beta::BetaDream,
    options: {extra_headers: {"anthropic-beta" => "dreaming-2026-04-21"}, **options}
  )
end

#retrieve(dream_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream

Get a Dream

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

Parameters:

  • dream_id (String)

    Path parameter dream_id

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Optional header to specify the beta version(s) you want to use.

  • workspace_id (String)

    Optional header to select the Workspace for this request. The value is a Workspa

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



62
63
64
65
66
67
68
69
70
71
# File 'lib/anthropic/resources/beta/dreams.rb', line 62

def retrieve(dream_id, params = {})
  parsed, options = Anthropic::Beta::DreamRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/dreams/%1$s?beta=true", dream_id],
    headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"),
    model: Anthropic::Beta::BetaDream,
    options: {extra_headers: {"anthropic-beta" => "dreaming-2026-04-21"}, **options}
  )
end