fix: ensure reasoning field in provider_specific_fields is redacted

This commit is contained in:
alchemicjon 2026-10-19 12:45:28 -04:00
parent cb8b9c0e0b
commit 953b93d1a8
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View file

@ -147,6 +147,7 @@ def _redacted_provider_specific_fields(fields: Mapping[str, object]) -> Mapping[
return {
**fields,
**({"reasoning_content": REDACTED_BY_LITELLM} if fields.get("reasoning_content") is not None else {}),
**({"reasoning": REDACTED_BY_LITELLM} if fields.get("reasoning") is not None else {}),
**{key: None for key in ("thinking_blocks", "reasoningContentBlocks", "citations") if key in fields},
}

View file

@ -51,6 +51,7 @@ SIGNATURE: Final = "opaque-thought-signature"
def _provider_fields() -> dict[str, object]:
return {
"reasoning_content": SECRET,
"reasoning": SECRET,
"thinking_blocks": [{"type": "thinking", "thinking": SECRET}],
"reasoningContentBlocks": [{"reasoningText": {"text": SECRET}}],
"citations": [{"cited_text": SECRET}],