Class BetaOutputBehavior

  • All Implemented Interfaces:

    
    public final class BetaOutputBehavior
    
                        

    Which memory store a dream writes its result to. Defaults to create_new when left out of a create request.

    • Constructor Detail

    • 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_existing dream on the same memory store hasn't fully stopped, the request returns a 409 error.

      • 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_existing dream 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_existing dream on the same memory store hasn't fully stopped, the request returns a 409 error.