Class BetaOutputBehavior
-
- All Implemented Interfaces:
public final class BetaOutputBehaviorWhich memory store a dream writes its result to. Defaults to
create_newwhen left out of a create request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaOutputBehavior.VisitorAn interface that defines how to map each variant of BetaOutputBehavior to a value of type T.
public final classBetaOutputBehavior.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaOutputBehaviorCreateNew>createNew()Write the result to a new memory store that starts as a copy of the input memory store. final Optional<BetaOutputBehaviorUpdateExisting>updateExisting()Write the result into the input memory store instead of a new memory store. final Optional<JsonValue>_json()final BetaOutputBehavior.Typetype()final BooleanisCreateNew()final BooleanisUpdateExisting()final BetaOutputBehaviorCreateNewasCreateNew()Write the result to a new memory store that starts as a copy of the input memory store. final BetaOutputBehaviorUpdateExistingasUpdateExisting()Write the result into the input memory store instead of a new memory store. final <T extends Any> Taccept(BetaOutputBehavior.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaOutputBehaviorvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaOutputBehaviorofCreateNew(BetaOutputBehaviorCreateNew createNew)Write the result to a new memory store that starts as a copy of the input memory store. final static BetaOutputBehaviorofUpdateExisting(BetaOutputBehaviorUpdateExisting updateExisting)Write the result into the input memory store instead of a new memory store. final static BetaOutputBehaviorofUpdateExisting(String memoryStoreId)Returns an immutable instance of BetaOutputBehavior whose ofUpdateExisting variant is built from the given required memoryStoreId. -
-
Method Detail
-
createNew
final Optional<BetaOutputBehaviorCreateNew> createNew()
Write the result to a new memory store that starts as a copy of the input memory store. This is the default.
The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.
-
updateExisting
final Optional<BetaOutputBehaviorUpdateExisting> updateExisting()
Write the result into the input memory store instead of a new memory store.
The credential must be allowed to write memory stores, or the request returns a 403 error. While another
update_existingdream on the same memory store hasn't fully stopped, the request returns a 409 error.
-
type
final BetaOutputBehavior.Type type()
-
isCreateNew
final Boolean isCreateNew()
-
isUpdateExisting
final Boolean isUpdateExisting()
-
asCreateNew
final BetaOutputBehaviorCreateNew asCreateNew()
Write the result to a new memory store that starts as a copy of the input memory store. This is the default.
The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.
-
asUpdateExisting
final BetaOutputBehaviorUpdateExisting asUpdateExisting()
Write the result into the input memory store instead of a new memory store.
The credential must be allowed to write memory stores, or the request returns a 403 error. While another
update_existingdream on the same memory store hasn't fully stopped, the request returns a 409 error.
-
accept
final <T extends Any> T accept(BetaOutputBehavior.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 = betaOutputBehavior.accept(new BetaOutputBehavior.Visitor<Optional<String>>() { @Override public Optional<String> visitCreateNew(BetaOutputBehaviorCreateNew createNew) { return Optional.of(createNew.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaOutputBehavior 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.
-
ofCreateNew
final static BetaOutputBehavior ofCreateNew(BetaOutputBehaviorCreateNew createNew)
Write the result to a new memory store that starts as a copy of the input memory store. This is the default.
The new memory store is in the same workspace as the dream. The dream doesn't change the input memory store.
-
ofUpdateExisting
final static BetaOutputBehavior ofUpdateExisting(BetaOutputBehaviorUpdateExisting updateExisting)
Write the result into the input memory store instead of a new memory store.
The credential must be allowed to write memory stores, or the request returns a 403 error. While another
update_existingdream on the same memory store hasn't fully stopped, the request returns a 409 error.
-
ofUpdateExisting
final static BetaOutputBehavior ofUpdateExisting(String memoryStoreId)
Returns an immutable instance of BetaOutputBehavior whose ofUpdateExisting variant is built from the given required memoryStoreId.
-
-
-
-