Class: Anthropic::Resources::Beta::Dreams
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::Dreams
- Defined in:
- lib/anthropic/resources/beta/dreams.rb,
sig/anthropic/resources/beta/dreams.rbs
Instance Method Summary collapse
-
#archive(dream_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream
Archive a Dream.
-
#cancel(dream_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream
Cancel a Dream.
-
#create(inputs:, model:, instructions: nil, output_behavior: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream
Create a Dream.
-
#initialize(client:) ⇒ Dreams
constructor
private
A new instance of Dreams.
-
#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.
-
#retrieve(dream_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDream
Get a Dream.
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.
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.
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, = 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"}, **} ) 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.
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, = 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"}, **} ) 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.
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, = 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"}, **} ) 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.
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, = 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"}, **} ) 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.
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, = 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"}, **} ) end |