Class BetaDreamInput
-
- All Implemented Interfaces:
public final class BetaDreamInputA source that a dream reads, such as a memory store or a set of sessions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaDreamInput.VisitorAn interface that defines how to map each variant of BetaDreamInput to a value of type T.
public final classBetaDreamInput.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaDreamMemoryStoreInput>memoryStore()The memory store that a dream reads, given as an entry in inputs.final Optional<BetaDreamSessionsInput>sessions()The sessions that a dream reads, given as an entry in inputs.final Optional<JsonValue>_json()final BetaDreamInput.Typetype()final BooleanisMemoryStore()final BooleanisSessions()final BetaDreamMemoryStoreInputasMemoryStore()The memory store that a dream reads, given as an entry in inputs.final BetaDreamSessionsInputasSessions()The sessions that a dream reads, given as an entry in inputs.final <T extends Any> Taccept(BetaDreamInput.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaDreamInputvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaDreamInputofMemoryStore(BetaDreamMemoryStoreInput memoryStore)The memory store that a dream reads, given as an entry in inputs.final static BetaDreamInputofMemoryStore(String memoryStoreId)Returns an immutable instance of BetaDreamInput whose ofMemoryStore variant is built from the given required memoryStoreId. final static BetaDreamInputofSessions(BetaDreamSessionsInput sessions)The sessions that a dream reads, given as an entry in inputs.final static BetaDreamInputofSessions(List<String> sessionIds)Returns an immutable instance of BetaDreamInput whose ofSessions variant is built from the given required sessionIds. -
-
Method Detail
-
memoryStore
final Optional<BetaDreamMemoryStoreInput> memoryStore()
The memory store that a dream reads, given as an entry in
inputs.With
output_behaviorset toupdate_existing, the dream writes its result into this memory store. Otherwise the dream doesn't change it.
-
sessions
final Optional<BetaDreamSessionsInput> sessions()
The sessions that a dream reads, given as an entry in
inputs.
-
type
final BetaDreamInput.Type type()
-
isMemoryStore
final Boolean isMemoryStore()
-
isSessions
final Boolean isSessions()
-
asMemoryStore
final BetaDreamMemoryStoreInput asMemoryStore()
The memory store that a dream reads, given as an entry in
inputs.With
output_behaviorset toupdate_existing, the dream writes its result into this memory store. Otherwise the dream doesn't change it.
-
asSessions
final BetaDreamSessionsInput asSessions()
The sessions that a dream reads, given as an entry in
inputs.
-
accept
final <T extends Any> T accept(BetaDreamInput.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = betaDreamInput.accept(new BetaDreamInput.Visitor<Optional<String>>() { @Override public Optional<String> visitMemoryStore(BetaDreamMemoryStoreInput memoryStore) { return Optional.of(memoryStore.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaDreamInput validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofMemoryStore
final static BetaDreamInput ofMemoryStore(BetaDreamMemoryStoreInput memoryStore)
The memory store that a dream reads, given as an entry in
inputs.With
output_behaviorset toupdate_existing, the dream writes its result into this memory store. Otherwise the dream doesn't change it.
-
ofMemoryStore
final static BetaDreamInput ofMemoryStore(String memoryStoreId)
Returns an immutable instance of BetaDreamInput whose ofMemoryStore variant is built from the given required memoryStoreId.
-
ofSessions
final static BetaDreamInput ofSessions(BetaDreamSessionsInput sessions)
The sessions that a dream reads, given as an entry in
inputs.
-
ofSessions
final static BetaDreamInput ofSessions(List<String> sessionIds)
Returns an immutable instance of BetaDreamInput whose ofSessions variant is built from the given required sessionIds.
-
-
-
-