上下文(Context)缓存Config
data class ContextCacheConfig @ExperimentalContextCachingFeature constructor(val cacheIntervals: Int = 10, val ttl: Duration = 1800.seconds, val minTokens: Int = 0, val createHttpOptions: HttpOptions? = null)
Configuration for context caching across all agents in an app.
When this config is present on an app, context caching is enabled for all agents. When absent (null), context caching is disabled.
Context caching can significantly reduce costs and improve response times by reusing previously processed context across multiple requests.
Constructing this type requires @OptIn(ExperimentalContextCachingFeature::class).
构造函数(Constructors)
Link copied to clipboard
constructor(cacheIntervals: Int = 10, ttl: Duration = 1800.seconds, minTokens: Int = 0, createHttpOptions: HttpOptions? = null)
类型
Link copied to clipboard
Fluent Builder for ContextCacheConfig该功能主要为 Java 语言的调用者提供支持;如果某个属性未被设置,其值将默认使用构造函数中指定的默认值。
属性(Properties)
函数
Link copied to clipboard
返回一个 Builder 使用该实例的属性进行初始化,主要适用于 Java 调用者。建议优先选择这种方式。 copy 来自 Java 的代码: copy 该函数会按位置获取所有属性的值;因此,每当有新属性被添加时,其函数签名(即函数的定义)就会发生变化。