fixup(sap): outdated docs

This commit is contained in:
Yamac Ay 2026-10-20 13:07:28 +02:00
parent 808bad989d
commit 247aa59f16
No known key found for this signature in database
GPG key ID: D113B438819CA628

View file

@ -33,9 +33,7 @@ def _now_ts() -> int:
def normalize_reasoning_content(raw: dict[str, object]) -> dict[str, object]:
# SAP AI Core returns reasoning tokens as a list: message.reasoning_content = [{"content": ..., "signature": ...}]
# ModelResponse.reasoning_content is typed Optional[str], so map the list to
# thinking_blocks and collapse the text into a single joined string.
"""Transform reasoning_content from SAP Orchestration format [{"content": ..., "signature": ...}] to Optional[str] and a thinking_blocks list."""
choices: Final[list[object]] = list(raw.get("choices") or [])
normalized_choices: Final[dict[str, object]] = [
normalize_choice(choice) for choice in choices if isinstance(choice, dict)
@ -45,9 +43,7 @@ def normalize_reasoning_content(raw: dict[str, object]) -> dict[str, object]:
def normalize_choice(choice: dict[str, object]) -> dict[str, object]:
# Normalize a single choice dict (message or delta shape) in isolation.
# Exposed as a static method so tests and callers can exercise one choice
# without constructing a full response envelope.
"""Normalize a single choice dict (message or delta shape) in isolation."""
for key in ("message", "delta"):
carrier = choice.get(key)
if not isinstance(carrier, dict):