test: verify sampling parameters through the full governance stack
This commit is contained in:
@@ -59,9 +59,7 @@ def validate_request_overlay(overlay: Mapping[str, Any], *, origin: str) -> dict
|
||||
return dict(overlay)
|
||||
|
||||
|
||||
def merge_sampling(
|
||||
extra_body: Mapping[str, Any], sampling: Mapping[str, Any]
|
||||
) -> dict[str, Any]:
|
||||
def merge_sampling(extra_body: Mapping[str, Any], sampling: Mapping[str, Any]) -> dict[str, Any]:
|
||||
"""合并配置级与调用级采样参数;调用级优先(issue #4 设计决策 A)。"""
|
||||
return {**extra_body, **sampling}
|
||||
|
||||
@@ -237,9 +235,7 @@ class SourceConfig:
|
||||
object.__setattr__(self, "extra_body", MappingProxyType(validated))
|
||||
|
||||
|
||||
def strip_unsupported_extra_body(
|
||||
sources: list[SourceConfig], *, path: str
|
||||
) -> list[SourceConfig]:
|
||||
def strip_unsupported_extra_body(sources: list[SourceConfig], *, path: str) -> list[SourceConfig]:
|
||||
"""剥离非 chat 路径不消费的 `extra_body` 并 warning(issue #4 决策 G)。
|
||||
|
||||
剥离是必需的而非顺手清理: embedding 的 payload 硬编码 `{model, input}`、
|
||||
|
||||
Reference in New Issue
Block a user