fix(llm): 删除未实现的 LlmRequest.thinking 字段(CR-H5,YAGNI)
This commit is contained in:
22
packages/llm_gateway/tests/test_types.py
Normal file
22
packages/llm_gateway/tests/test_types.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""C1 类型契约不变量(`LlmRequest` 字段集)单测。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ww_llm_gateway.adapters.base import Capabilities
|
||||
from ww_llm_gateway.types import LlmRequest
|
||||
|
||||
|
||||
def test_llm_request_has_no_thinking_field() -> None:
|
||||
# CR-H5:删除从未被任何适配器/网关读取的死字段 `LlmRequest.thinking`(YAGNI)。
|
||||
assert "thinking" not in LlmRequest.model_fields
|
||||
assert set(LlmRequest.model_fields) == {
|
||||
"tier",
|
||||
"input",
|
||||
"system",
|
||||
"stream",
|
||||
"output_schema",
|
||||
"max_tokens",
|
||||
"scope",
|
||||
}
|
||||
# 同名但另一处 live 字段 `Capabilities.thinking`(适配器能力矩阵)不受影响。
|
||||
assert "thinking" in Capabilities.model_fields
|
||||
@@ -38,7 +38,6 @@ class LlmRequest(BaseModel):
|
||||
system: list[Block] = Field(default_factory=list)
|
||||
stream: bool = False
|
||||
output_schema: type[BaseModel] | None = None
|
||||
thinking: bool = False
|
||||
max_tokens: int | None = None
|
||||
scope: Scope
|
||||
|
||||
|
||||
Reference in New Issue
Block a user