类class
agentscope.app.ragDimensionPolicyError
class DimensionPolicyError(KnowledgeBaseError)
源码Source
agentscope/app/rag/knowledge_base_manager/_errors.py:30–59维度策略错误,把私有文档转化为可检索的知识。位于 agentscope.app.rag 包,继承自 KnowledgeBaseError。
Carries both the offending dimension and the manager's policy so the router can surface a precise error message without having to re-derive either side.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
def __init__(message: str, *, requested_dimension: int, policy_dimension: int | None) -> None | 初始化 `DimensionPolicyError` 实例。 Initialize the error. |
构造器详情Constructor Detail
DimensionPolicyError
def __init__(message: str, *, requested_dimension: int, policy_dimension: int | None) -> None
初始化 DimensionPolicyError 实例。
Initialize the error.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | str | 消息(类型 `str`)。Human-readable error message. |
requested_dimensionkw | int | requested 维度(类型 `int`)。The dimension the caller asked for. |
policy_dimensionkw | int | None | 策略维度(类型 `int | None`)。The dimension the policy enforces, or `None` if the policy admits any dimension. |
源码Source
agentscope/app/rag/knowledge_base_manager/_errors.py:39–59