AS AgentScopeAPI 手册 / API Reference

CachePolicy

public enum CachePolicy
源码Source io/agentscope/core/model/CachePolicy.java:33–45

定义缓存策略相关取值的枚举。位于 io.agentscope.core.model 包。核心成员包括 DEFAULT、DISABLED、ENABLED。

Controls whether ModelRegistry caches models created with a ModelCreationContext.

Policy summary:

  • #DEFAULT: preserves legacy behavior. Empty contexts are cached by model id; non-empty contexts are not cached.

  • #DISABLED: never cache. Every resolution creates a new model instance.

  • #ENABLED: opt-in caching. The cache identity is either the explicit cacheId supplied by the caller or a fingerprint derived only from standard simple fields. Contexts containing opaque options/components require an explicit cacheId.

枚举常量摘要Enum Constant Summary

常量Constant说明Description
DEFAULT
执行默认相关操作。
Preserve registry defaults.
DISABLED
禁用D。
Never cache the created model.
ENABLED
启用D。
Cache the created model using an explicit or safely derived context cache identity.

枚举常量详情Enum Constant Detail

DEFAULT

DEFAULT
staticfinal

执行默认相关操作。

Preserve registry defaults.

源码Source io/agentscope/core/model/CachePolicy.java:38

DISABLED

DISABLED
staticfinal

禁用D。

Never cache the created model.

源码Source io/agentscope/core/model/CachePolicy.java:41

ENABLED

ENABLED
staticfinal

启用D。

Cache the created model using an explicit or safely derived context cache identity.

源码Source io/agentscope/core/model/CachePolicy.java:44
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.