Merge remote-tracking branch 'origin/litellm_systemone_endpoint' into litellm_openai_decisions_provider

# Conflicts:
#	litellm/proxy/decisions_endpoints/endpoints.py
#	litellm/types/decisions.py
This commit is contained in:
mateo-berri 2026-10-07 20:42:49 -07:00
commit c19ada66ed
2 changed files with 24 additions and 1 deletions

View file

@ -320,7 +320,7 @@ class OpenAIDecisionResponse(_HiddenParamsResponse):
answers: tuple[OpenAIDecisionAnswer, ...]
usage: OpenAIDecisionUsage
model_config = ConfigDict(frozen=True)
model_config = ConfigDict(extra="allow", frozen=True)
_NO_EXTRA: Final[Mapping[str, object]] = MappingProxyType({})

View file

@ -387,6 +387,29 @@ def test_openai_format_decisions_translate_through_systemone(
assert float(response.headers["x-litellm-response-cost"]) > 0
@pytest.mark.parametrize(
("endpoint", "request_body", "upstream_response"),
(
("/v1/systemone", _REQUEST, _RESPONSE),
("/v1/decisions", _OPENAI_FORMAT_REQUEST, _SYSTEMONE_ANSWERS_FOR_OPENAI_REQUEST),
),
ids=("systemone", "openai_format"),
)
def test_decisions_return_guardrail_information_when_requested(
client: TestClient,
respx_mock: respx.MockRouter,
endpoint: str,
request_body: Mapping[str, object],
upstream_response: Mapping[str, object],
) -> None:
respx_mock.post("https://api.perplexity.ai/v1/decisions").respond(json=upstream_response)
response: Final = client.post(endpoint, json={**request_body, "include_guardrail_response": True})
assert response.status_code == 200, response.text
assert response.json()["guardrail_information"] == []
@pytest.mark.parametrize(
"request_body",
(