Enum Class AnthropicCacheType
- All Implemented Interfaces:
Serializable, Comparable<AnthropicCacheType>, Constable
Cache types supported by Anthropic's prompt caching feature.
Prompt caching allows reusing frequently used prompts to reduce costs and improve response times for repeated interactions.
- Author:
- Claudio Silva Junior, Soby Chacko, Austin Dase
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns a new CacheControl instance for this cache type.cacheControl(String ttl) Returns a new CacheControl instance for this cache type with the specified TTL.static AnthropicCacheTypeReturns the enum constant of this class with the specified name.static AnthropicCacheType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EPHEMERAL
Ephemeral cache with 5-minute lifetime, refreshed on each use.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
cacheControl
Returns a new CacheControl instance for this cache type.- Returns:
- a CacheControl instance configured for this cache type
-
cacheControl
Returns a new CacheControl instance for this cache type with the specified TTL.- Parameters:
ttl- the time-to-live for the cache entry (e.g., "5m" for 5 minutes, "1h" for 1 hour)- Returns:
- a CacheControl instance configured for this cache type and TTL
-