Skip to content

Commit 1f5e477

Browse files
chore(docs): improve descriptions in the Dreams API reference
Stainless-Generated-From: f46d8807cb9bbc35ca6db36004d52aae66166d4f
1 parent 5574c63 commit 1f5e477

16 files changed

Lines changed: 92 additions & 51 deletions

‎scripts/mock-spec.json.gz‎

197 Bytes
Binary file not shown.

‎src/anthropic/resources/beta/dreams.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,9 @@ def list(
238238
for how to page through dreams.
239239
240240
Args:
241-
created_at_gt: Return dreams with `created_at` strictly after this timestamp (exclusive lower
242-
bound, RFC 3339). Unset applies no lower bound.
241+
created_at_gt: Return only dreams created after this time (exclusive), in RFC 3339.
243242
244-
created_at_lt: Return dreams with `created_at` strictly before this timestamp (exclusive upper
245-
bound, RFC 3339). Unset applies no upper bound.
243+
created_at_lt: Return only dreams created before this time (exclusive), in RFC 3339.
246244
247245
include_archived: Whether to include archived dreams. Defaults to `false`.
248246
@@ -253,8 +251,10 @@ def list(
253251
254252
Leave it out to get the first page.
255253
256-
statuses: Filter by lifecycle status. Repeat the parameter to match any of multiple
257-
statuses. Empty applies no status filter.
254+
statuses: Return only dreams that have one of these statuses.
255+
256+
Repeat the parameter to give more than one status. Leave it out to return dreams
257+
of every status.
258258
259259
betas: Optional header to specify the beta version(s) you want to use.
260260
@@ -653,11 +653,9 @@ def list(
653653
for how to page through dreams.
654654
655655
Args:
656-
created_at_gt: Return dreams with `created_at` strictly after this timestamp (exclusive lower
657-
bound, RFC 3339). Unset applies no lower bound.
656+
created_at_gt: Return only dreams created after this time (exclusive), in RFC 3339.
658657
659-
created_at_lt: Return dreams with `created_at` strictly before this timestamp (exclusive upper
660-
bound, RFC 3339). Unset applies no upper bound.
658+
created_at_lt: Return only dreams created before this time (exclusive), in RFC 3339.
661659
662660
include_archived: Whether to include archived dreams. Defaults to `false`.
663661
@@ -668,8 +666,10 @@ def list(
668666
669667
Leave it out to get the first page.
670668
671-
statuses: Filter by lifecycle status. Repeat the parameter to match any of multiple
672-
statuses. Empty applies no status filter.
669+
statuses: Return only dreams that have one of these statuses.
670+
671+
Repeat the parameter to give more than one status. Leave it out to return dreams
672+
of every status.
673673
674674
betas: Optional header to specify the beta version(s) you want to use.
675675

‎src/anthropic/types/beta/beta_dream.py‎

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616

1717
class BetaDream(BaseModel):
1818
"""
19-
An asynchronous memory-consolidation job that reads a memory store plus a set of session transcripts and writes consolidated memories into an output memory store — a new store by default, or an existing store chosen via output_behavior. The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.
19+
An asynchronous job that reads a memory store and past sessions, then writes a reorganized version of that memory store.
20+
21+
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.
22+
23+
See the [Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#how-it-works) for what a dream reads and produces.
2024
"""
2125

2226
id: str
@@ -41,9 +45,10 @@ class BetaDream(BaseModel):
4145
"""The guidance given when the dream was created, or `null` if none was given."""
4246

4347
model: BetaDreamModelConfig
44-
"""Model identifier and configuration applied to every pipeline stage.
48+
"""The model that runs a dream, from the request that created it.
4549
46-
Same wire shape as the Agents API ModelConfig.
50+
The dream uses this model for all of its work. The response always gives the
51+
model as an object, even if the request gave only a model ID.
4752
"""
4853

4954
output_behavior: BetaOutputBehavior
@@ -80,9 +85,27 @@ class BetaDream(BaseModel):
8085
"""
8186

8287
status: BetaDreamStatus
83-
"""Lifecycle status of a Dream."""
88+
"""Where a dream is in its lifecycle.
89+
90+
`completed`, `failed`, and `canceled` are final: once a dream has one of these
91+
statuses, its status doesn't change again.
92+
93+
See the
94+
[Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#lifecycle)
95+
for what each status means.
96+
"""
8497

8598
type: Literal["dream"]
8699

87100
usage: BetaDreamUsage
88-
"""Cumulative token usage for the dream across every pipeline stage."""
101+
"""The tokens that a dream has used so far.
102+
103+
The counts are zero while the dream is `pending` and update while it is
104+
`running`. They can keep changing after a cancel.
105+
106+
See the
107+
[Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#billing)
108+
for how dreams are billed. See the
109+
[prompt caching guide](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#tracking-cache-performance)
110+
for how the input token counts add up.
111+
"""

‎src/anthropic/types/beta/beta_dream_memory_store_input.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77

88
class BetaDreamMemoryStoreInput(BaseModel):
9-
"""An input memory store the dream reads from.
9+
"""The memory store that a dream reads, given as an entry in `inputs`.
1010
11-
The dream never mutates this store unless it is also the destination: with output_behavior {type: "update_existing"} the job consolidates this store in place.
11+
With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.
1212
"""
1313

1414
memory_store_id: str

‎src/anthropic/types/beta/beta_dream_memory_store_input_param.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77

88
class BetaDreamMemoryStoreInputParam(TypedDict, total=False):
9-
"""An input memory store the dream reads from.
9+
"""The memory store that a dream reads, given as an entry in `inputs`.
1010
11-
The dream never mutates this store unless it is also the destination: with output_behavior {type: "update_existing"} the job consolidates this store in place.
11+
With `output_behavior` set to `update_existing`, the dream writes its result into this memory store. Otherwise the dream doesn't change it.
1212
"""
1313

1414
memory_store_id: Required[str]

‎src/anthropic/types/beta/beta_dream_model_config.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77

88

99
class BetaDreamModelConfig(BaseModel):
10-
"""Model identifier and configuration applied to every pipeline stage.
10+
"""The model that runs a dream, from the request that created it.
1111
12-
Same wire shape as the Agents API ModelConfig.
12+
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.
1313
"""
1414

1515
id: str
16-
"""Model identifier, e.g. "claude-opus-5". 1-256 characters."""
16+
"""
17+
The ID of the model that runs the dream, as given in the request that created
18+
it.
19+
"""
1720

1821
speed: Optional[Literal["standard", "fast"]] = None
1922
"""Inference speed mode.

‎src/anthropic/types/beta/beta_dream_model_config_param.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@
77

88

99
class BetaDreamModelConfigParam(TypedDict, total=False):
10-
"""Model identifier and configuration applied to every pipeline stage."""
10+
"""The object form of `model` in a request to create a dream."""
1111

1212
id: Required[str]
13-
"""Model identifier, e.g. "claude-opus-5". 1-256 characters."""
13+
"""The ID of the model to run the dream with.
14+
15+
The ID can be 1 to 256 characters long.
16+
17+
The
18+
[limits table in the Dreams guide](https://platform.claude.com/docs/en/managed-agents/dreams#limits)
19+
lists the supported models.
20+
"""
1421

1522
speed: Optional[Literal["standard", "fast"]]
1623
"""Inference speed mode.

‎src/anthropic/types/beta/beta_dream_output.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
class BetaDreamOutput(BaseModel):
9-
"""An output memory store the dream writes consolidated memories into."""
9+
"""The memory store that holds a dream's result, as an entry in `outputs`."""
1010

1111
memory_store_id: str
1212
"""The ID of the memory store that the dream writes its result to (`memstore_...`).

‎src/anthropic/types/beta/beta_dream_sessions_input.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
class BetaDreamSessionsInput(BaseModel):
10-
"""Input session transcripts the dream reads."""
10+
"""The sessions that a dream reads, given as an entry in `inputs`."""
1111

1212
session_ids: List[str]
1313
"""The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

‎src/anthropic/types/beta/beta_dream_sessions_input_param.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
class BetaDreamSessionsInputParam(TypedDict, total=False):
11-
"""Input session transcripts the dream reads."""
11+
"""The sessions that a dream reads, given as an entry in `inputs`."""
1212

1313
session_ids: Required[SequenceNotStr[str]]
1414
"""The IDs of the sessions whose transcripts the dream reads (`sesn_...`).

0 commit comments

Comments
 (0)