mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
fix(pass-through): check eu_jev decisions against the model eu/jev runs
Serve only POST /eu_jev/v1/systemone, eu/jev's one endpoint, resolve an omitted model and the legacy names to eu-jeff-latest for key model checks and pricing, check scopes under eu_jev/<model> like Laya and Bespoke, and answer 503 when EU_JEV_API_KEY is unset
This commit is contained in:
parent
27f8047904
commit
3988b236d0
10 changed files with 166 additions and 2075 deletions
10
litellm/llms/eu_jev.py
Normal file
10
litellm/llms/eu_jev.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from typing import Final
|
||||
|
||||
EU_JEV_LATEST_MODEL: Final = "eu-jeff-latest"
|
||||
_EU_JEV_CURRENT_RELEASE_NAMES: Final = frozenset((EU_JEV_LATEST_MODEL, "jeff-latest", "jeff-1.0.0"))
|
||||
|
||||
|
||||
def eu_jev_registry_model(requested_model: str | None) -> str:
|
||||
if requested_model is None or requested_model in _EU_JEV_CURRENT_RELEASE_NAMES:
|
||||
return EU_JEV_LATEST_MODEL
|
||||
return requested_model
|
||||
|
|
@ -11,6 +11,7 @@ from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLogging
|
|||
from litellm.litellm_core_utils.litellm_logging import (
|
||||
get_standard_logging_object_payload, # pyright: ignore[reportUnknownVariableType] # legacy helper has an untyped signature
|
||||
)
|
||||
from litellm.llms.eu_jev import eu_jev_registry_model
|
||||
from litellm.llms.laya.common_utils import laya_response_model
|
||||
from litellm.types.llms.base import LiteLLMBaseModel
|
||||
from litellm.types.utils import ModelResponse, StandardPassThroughResponseObject, Usage
|
||||
|
|
@ -82,13 +83,16 @@ class TypeSafePassthroughLoggingHandler:
|
|||
response_model: Final = (
|
||||
laya_response_model(response_body, request_model) if custom_llm_provider == "laya" else response.model
|
||||
)
|
||||
logged_model: Final = response_model or request_model or "unknown"
|
||||
registry_request_model: Final = (
|
||||
eu_jev_registry_model(request_model) if custom_llm_provider == "eu_jev" else request_model
|
||||
)
|
||||
logged_model: Final = response_model or registry_request_model or "unknown"
|
||||
model_name: Final = f"{custom_llm_provider}/{logged_model}"
|
||||
usage: Final = response.usage or _TypeSafeUsage()
|
||||
input_tokens: Final = usage.input_tokens
|
||||
output_tokens: Final = usage.output_tokens
|
||||
candidate_model_keys: Final = tuple(
|
||||
f"{custom_llm_provider}/{model}" for model in (response_model, request_model) if model is not None
|
||||
f"{custom_llm_provider}/{model}" for model in (response_model, registry_request_model) if model is not None
|
||||
)
|
||||
pricing: Final = _pricing_for(candidate_model_keys)
|
||||
response_cost: Final = (
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2161,6 +2161,13 @@ def _extract_model_candidates_from_request(
|
|||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc)) from exc
|
||||
return _dedupe_model_candidates((f"{provider}/{decision_model}",))
|
||||
if route.rstrip("/") == "/eu_jev/v1/systemone":
|
||||
from litellm.llms.eu_jev import eu_jev_registry_model
|
||||
|
||||
requested_model: Final = TypeAdapter(Mapping[str, object]).validate_python(request_data).get("model")
|
||||
if requested_model is not None and not isinstance(requested_model, str):
|
||||
raise HTTPException(status_code=400, detail="eu_jev model must be a string")
|
||||
return [f"eu_jev/{eu_jev_registry_model(requested_model)}"]
|
||||
if route == "/cost/predict-cache":
|
||||
prediction_models: Final = _cache_prediction_model_candidates(request_data, llm_router, team_id) # pyright: ignore[reportUnknownArgumentType] # the typed reader validates each deployment ID from this legacy payload
|
||||
return _dedupe_model_candidates(prediction_models)
|
||||
|
|
|
|||
|
|
@ -715,15 +715,13 @@ _EU_JEV_DECISION_REQUEST_BODY: Final = inline_request_body(
|
|||
)
|
||||
|
||||
|
||||
@router.api_route(
|
||||
"/eu_jev/{endpoint:path}",
|
||||
methods=["GET", "POST", "PUT", "DELETE", "PATCH"],
|
||||
@router.post(
|
||||
"/eu_jev/v1/systemone",
|
||||
tags=["eu/jev Pass-through", "pass-through"],
|
||||
responses={200: {"model": EuJevDecisionResponse}},
|
||||
openapi_extra={"requestBody": _EU_JEV_DECISION_REQUEST_BODY},
|
||||
)
|
||||
async def eu_jev_proxy_route(
|
||||
endpoint: str,
|
||||
request: Request,
|
||||
fastapi_response: Response,
|
||||
user_api_key_dict: Annotated[UserAPIKeyAuth, Depends(user_api_key_auth)],
|
||||
|
|
@ -732,8 +730,8 @@ async def eu_jev_proxy_route(
|
|||
Forward a request to eu/jev, an EU-hosted decision API, with `EU_JEV_API_KEY`.
|
||||
|
||||
`POST /eu_jev/v1/systemone` sends a `state` and one to eight named `questions` (`choice`, `noul` or `score`)
|
||||
and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` is
|
||||
rejected with a 400.
|
||||
and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` and
|
||||
`stream` are rejected with a 400.
|
||||
|
||||
[Docs](https://docs.litellm.ai/docs/pass_through/eu_jev)
|
||||
"""
|
||||
|
|
@ -742,19 +740,18 @@ async def eu_jev_proxy_route(
|
|||
raise HTTPException(status_code=400, detail="custom_body is not supported for eu_jev requests")
|
||||
if body.get("stream"):
|
||||
raise HTTPException(status_code=400, detail="Streaming is not supported for eu_jev requests")
|
||||
base_target_url: Final = get_secret_str("EU_JEV_API_BASE") or "https://eu-jev.com"
|
||||
encoded_endpoint: Final = httpx.URL(endpoint).path
|
||||
normalized_endpoint: Final = encoded_endpoint if encoded_endpoint.startswith("/") else f"/{encoded_endpoint}"
|
||||
base_url: Final = httpx.URL(base_target_url)
|
||||
updated_url: Final = base_url.copy_with(
|
||||
path=HttpPassThroughEndpointHelpers.join_base_and_endpoint_path(base_url, normalized_endpoint),
|
||||
)
|
||||
eu_jev_api_key: Final = passthrough_endpoint_router.get_credentials(
|
||||
custom_llm_provider="eu_jev",
|
||||
region_name=None,
|
||||
)
|
||||
if not eu_jev_api_key:
|
||||
raise HTTPException(status_code=503, detail="eu_jev is not configured, set EU_JEV_API_KEY on the proxy")
|
||||
base_url: Final = httpx.URL(get_secret_str("EU_JEV_API_BASE") or "https://eu-jev.com")
|
||||
updated_url: Final = base_url.copy_with(
|
||||
path=HttpPassThroughEndpointHelpers.join_base_and_endpoint_path(base_url, "/v1/systemone"),
|
||||
)
|
||||
endpoint_func: Final = create_pass_through_route(
|
||||
endpoint=endpoint,
|
||||
endpoint="v1/systemone",
|
||||
target=str(updated_url),
|
||||
custom_headers={
|
||||
"Authorization": f"Bearer {eu_jev_api_key}",
|
||||
|
|
|
|||
|
|
@ -1028,6 +1028,33 @@ def test_oss_native_model_cannot_implicitly_select_an_unauthorized_checkpoint(pr
|
|||
assert denied.value.status_code == 400
|
||||
|
||||
|
||||
# eu-jev.com/docs (read 2026-10-21): an omitted model means eu-jeff-latest, and the legacy names
|
||||
# jeff-latest and jeff-1.0.0 answer with the current release.
|
||||
@pytest.mark.parametrize(
|
||||
("request_data", "permission_model"),
|
||||
[
|
||||
({}, "eu_jev/eu-jeff-latest"),
|
||||
({"model": None}, "eu_jev/eu-jeff-latest"),
|
||||
({"model": "eu-jeff-latest"}, "eu_jev/eu-jeff-latest"),
|
||||
({"model": "jeff-latest"}, "eu_jev/eu-jeff-latest"),
|
||||
({"model": "jeff-1.0.0"}, "eu_jev/eu-jeff-latest"),
|
||||
({"model": "eu-jeff-1.0.0"}, "eu_jev/eu-jeff-1.0.0"),
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize("suffix", ["", "/"])
|
||||
def test_eu_jev_decision_is_checked_against_the_model_eu_jev_runs(
|
||||
request_data: dict[str, object], permission_model: str, suffix: str
|
||||
) -> None:
|
||||
assert get_model_from_request(request_data=request_data, route=f"/eu_jev/v1/systemone{suffix}") == permission_model
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", [["eu-jeff-latest"], 7, {"name": "eu-jeff-latest"}])
|
||||
def test_eu_jev_decision_rejects_a_model_that_is_not_a_string(model: object) -> None:
|
||||
with pytest.raises(HTTPException) as denied:
|
||||
get_model_from_request(request_data={"model": model}, route="/eu_jev/v1/systemone")
|
||||
assert denied.value.status_code == 400
|
||||
|
||||
|
||||
def test_laya_model_normalization_does_not_change_other_provider_routes() -> None:
|
||||
assert get_model_from_request(request_data={"model": "jev-latest"}, route="/typesafe/v1/systemone") == "jev-latest"
|
||||
assert get_model_from_request(request_data={}, route="/laya/health") is None
|
||||
|
|
|
|||
|
|
@ -391,6 +391,54 @@ def test_eu_jev_decision_is_priced_from_its_registry_row():
|
|||
assert response["kwargs"]["combined_usage_object"].completion_tokens == 0
|
||||
|
||||
|
||||
# eu-jev.com/docs (read 2026-10-21): an omitted model and the legacy names answer with the current release,
|
||||
# which a future eu/jev release reports under a version the registry does not list yet.
|
||||
@pytest.mark.parametrize("request_body", [{}, {"model": "jeff-latest"}, {"model": "jeff-1.0.0"}])
|
||||
def test_eu_jev_current_release_requests_are_priced_as_the_latest_alias(request_body: dict[str, object]) -> None:
|
||||
unlisted_release: Final = "eu-jeff-99.0.0"
|
||||
assert f"eu_jev/{unlisted_release}" not in litellm.model_cost
|
||||
response = TypeSafePassthroughLoggingHandler.typesafe_passthrough_handler(
|
||||
httpx_response=_response(),
|
||||
response_body={"model": unlisted_release, "usage": {"input_tokens": 64, "output_tokens": 0}},
|
||||
logging_obj=_logging_obj(),
|
||||
url_route="https://eu-jev.com/v1/systemone",
|
||||
result='{"answers": {}}',
|
||||
start_time=datetime.now(),
|
||||
end_time=datetime.now(),
|
||||
cache_hit=False,
|
||||
request_body=request_body,
|
||||
custom_llm_provider="eu_jev",
|
||||
)
|
||||
|
||||
latest_cost: Final = litellm.model_cost["eu_jev/eu-jeff-latest"]["input_cost_per_token"]
|
||||
assert response["kwargs"]["model"] == f"eu_jev/{unlisted_release}"
|
||||
assert latest_cost > 0
|
||||
assert response["kwargs"]["response_cost"] == pytest.approx(64 * latest_cost)
|
||||
|
||||
|
||||
def test_eu_jev_pinned_release_is_not_priced_as_the_latest_alias(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setitem(
|
||||
litellm.model_cost,
|
||||
"eu_jev/eu-jeff-latest",
|
||||
{**litellm.model_cost["eu_jev/eu-jeff-latest"], "input_cost_per_token": 1.0},
|
||||
)
|
||||
response = TypeSafePassthroughLoggingHandler.typesafe_passthrough_handler(
|
||||
httpx_response=_response(),
|
||||
response_body={"model": "eu-jeff-1.0.0", "usage": {"input_tokens": 64, "output_tokens": 0}},
|
||||
logging_obj=_logging_obj(),
|
||||
url_route="https://eu-jev.com/v1/systemone",
|
||||
result='{"answers": {}}',
|
||||
start_time=datetime.now(),
|
||||
end_time=datetime.now(),
|
||||
cache_hit=False,
|
||||
request_body={"model": "eu-jeff-1.0.0"},
|
||||
custom_llm_provider="eu_jev",
|
||||
)
|
||||
|
||||
pinned_cost: Final = litellm.model_cost["eu_jev/eu-jeff-1.0.0"]["input_cost_per_token"]
|
||||
assert response["kwargs"]["response_cost"] == pytest.approx(64 * pinned_cost)
|
||||
|
||||
|
||||
def test_success_handler_dispatches_eu_jev_to_the_shared_handler():
|
||||
normalized = PassThroughEndpointLogging().normalize_llm_passthrough_logging_payload(
|
||||
httpx_response=_response(),
|
||||
|
|
|
|||
|
|
@ -8326,14 +8326,6 @@ class TestTypeSafePassthroughRoute:
|
|||
|
||||
|
||||
class TestEuJevPassthroughRoute:
|
||||
@staticmethod
|
||||
def _request(body: object, query_params: Mapping[str, str] | None = None) -> MagicMock:
|
||||
request = MagicMock(spec=Request)
|
||||
request.method = "POST"
|
||||
request.query_params = query_params or {}
|
||||
request.json = AsyncMock(return_value=body)
|
||||
return request
|
||||
|
||||
@pytest.fixture
|
||||
def client(self, monkeypatch: pytest.MonkeyPatch) -> Iterator[TestClient]:
|
||||
from litellm.proxy.proxy_server import app
|
||||
|
|
@ -8359,6 +8351,49 @@ class TestEuJevPassthroughRoute:
|
|||
assert sent.headers["authorization"] == "Bearer eu-jev-test-key"
|
||||
assert json.loads(sent.content) == body
|
||||
|
||||
def test_forwards_query_params_to_the_decision_endpoint(self, client: TestClient) -> None:
|
||||
with respx.mock(assert_all_called=True) as upstream:
|
||||
route: Final = upstream.post("https://eu-jev.example/base/v1/systemone", params={"trace": "yes"}).respond(
|
||||
200, json={"answers": {}}
|
||||
)
|
||||
response: Final = client.post("/eu_jev/v1/systemone?trace=yes", json={"state": "x"})
|
||||
|
||||
assert response.status_code == 200
|
||||
assert route.called
|
||||
|
||||
def test_uses_the_hosted_api_when_base_is_unset(self, client: TestClient, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.delenv("EU_JEV_API_BASE")
|
||||
with respx.mock(assert_all_called=True) as upstream:
|
||||
route: Final = upstream.post("https://eu-jev.com/v1/systemone").respond(200, json={"answers": {}})
|
||||
response: Final = client.post("/eu_jev/v1/systemone", json={"state": "x"})
|
||||
|
||||
assert response.status_code == 200
|
||||
assert route.called
|
||||
|
||||
def test_answers_503_without_calling_upstream_when_the_key_is_unset(
|
||||
self, client: TestClient, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
monkeypatch.delenv("EU_JEV_API_KEY")
|
||||
with respx.mock(assert_all_called=False) as upstream:
|
||||
route: Final = upstream.route(host="eu-jev.example").respond(200, json={"answers": {}})
|
||||
response: Final = client.post("/eu_jev/v1/systemone", json={"state": "x"})
|
||||
|
||||
assert response.status_code == 503
|
||||
assert "EU_JEV_API_KEY" in response.text
|
||||
assert not route.called
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("method", "path"),
|
||||
[("GET", "/eu_jev/api/account/keys"), ("DELETE", "/eu_jev/v1/keys/abc"), ("GET", "/eu_jev/v1/systemone")],
|
||||
)
|
||||
def test_forwards_nothing_but_a_decision(self, client: TestClient, method: str, path: str) -> None:
|
||||
with respx.mock(assert_all_called=False) as upstream:
|
||||
route: Final = upstream.route(host="eu-jev.example").respond(200, json={})
|
||||
response: Final = client.request(method, path)
|
||||
|
||||
assert response.status_code in (404, 405)
|
||||
assert not route.called
|
||||
|
||||
def test_rejects_custom_body_that_would_replace_the_authorized_request(self, client: TestClient) -> None:
|
||||
smuggled: Final = {"model": "eu-jeff-latest", "state": "refund", "questions": {"q": {"type": "noul"}}}
|
||||
with respx.mock(assert_all_called=False) as upstream:
|
||||
|
|
@ -8380,64 +8415,6 @@ class TestEuJevPassthroughRoute:
|
|||
assert "Streaming" in response.text
|
||||
assert not route.called
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_forwards_target_auth_headers_provider_and_query(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setenv("EU_JEV_API_KEY", "eu-jev-test-key")
|
||||
monkeypatch.setenv("EU_JEV_API_BASE", "https://eu-jev.example/base")
|
||||
|
||||
async def fake_upstream(request, *_args):
|
||||
target: Final = create_route.call_args.kwargs["target"]
|
||||
upstream_url: Final = httpx.URL(target).copy_merge_params(request.query_params)
|
||||
return Response(content=json.dumps({"upstream_query": parse_qs(upstream_url.query.decode())}))
|
||||
|
||||
endpoint_func = AsyncMock(side_effect=fake_upstream)
|
||||
create_route = Mock(return_value=endpoint_func)
|
||||
monkeypatch.setattr(
|
||||
"litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints.create_pass_through_route",
|
||||
create_route,
|
||||
)
|
||||
|
||||
result = await eu_jev_proxy_route(
|
||||
endpoint="v1/systemone",
|
||||
request=self._request({"state": "x"}, {"trace": "yes"}),
|
||||
fastapi_response=MagicMock(spec=Response),
|
||||
user_api_key_dict=UserAPIKeyAuth(api_key="virtual-key"),
|
||||
)
|
||||
|
||||
assert json.loads(result.body) == {"upstream_query": {"trace": ["yes"]}}
|
||||
endpoint_func.assert_awaited_once()
|
||||
create_route.assert_called_once_with(
|
||||
endpoint="v1/systemone",
|
||||
target="https://eu-jev.example/base/v1/systemone",
|
||||
custom_headers={
|
||||
"Authorization": "Bearer eu-jev-test-key",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
custom_llm_provider="eu_jev",
|
||||
is_streaming_request=False,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_uses_the_hosted_api_when_base_is_unset(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setenv("EU_JEV_API_KEY", "eu-jev-test-key")
|
||||
monkeypatch.delenv("EU_JEV_API_BASE", raising=False)
|
||||
|
||||
endpoint_func = AsyncMock(return_value=Response())
|
||||
create_route = Mock(return_value=endpoint_func)
|
||||
monkeypatch.setattr(
|
||||
"litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints.create_pass_through_route",
|
||||
create_route,
|
||||
)
|
||||
|
||||
await eu_jev_proxy_route(
|
||||
endpoint="v1/systemone",
|
||||
request=self._request({"state": "x"}),
|
||||
fastapi_response=MagicMock(spec=Response),
|
||||
user_api_key_dict=UserAPIKeyAuth(api_key="virtual-key"),
|
||||
)
|
||||
|
||||
assert create_route.call_args.kwargs["target"] == "https://eu-jev.com/v1/systemone"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("provider", ["laya", "bespoke"])
|
||||
class TestOssDecisionPassthroughRoute:
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ PROTOCOL_CONSTRAINED_PASS_THROUGH_ROUTES: Final = MappingProxyType(
|
|||
"/tinyfish/{endpoint:path}": frozenset({"GET", "POST"}),
|
||||
"/laya/v1/systemone": frozenset({"POST"}),
|
||||
"/bespoke/v1/systemone": frozenset({"POST"}),
|
||||
"/eu_jev/v1/systemone": frozenset({"POST"}),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
667
ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
667
ui/litellm-dashboard/src/lib/http/schema.d.ts
generated
vendored
|
|
@ -5333,70 +5333,30 @@ export interface paths {
|
|||
patch: operations["assemblyai_proxy_route_eu_assemblyai__endpoint__patch"];
|
||||
trace?: never;
|
||||
};
|
||||
"/eu_jev/{endpoint}": {
|
||||
"/eu_jev/v1/systemone": {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
get?: never;
|
||||
put?: never;
|
||||
/**
|
||||
* Eu Jev Proxy Route
|
||||
* @description Forward a request to eu/jev, an EU-hosted decision API, with `EU_JEV_API_KEY`.
|
||||
*
|
||||
* `POST /eu_jev/v1/systemone` sends a `state` and one to eight named `questions` (`choice`, `noul` or `score`)
|
||||
* and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` is
|
||||
* rejected with a 400.
|
||||
* and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` and
|
||||
* `stream` are rejected with a 400.
|
||||
*
|
||||
* [Docs](https://docs.litellm.ai/docs/pass_through/eu_jev)
|
||||
*/
|
||||
get: operations["eu_jev_proxy_route_eu_jev__endpoint__get"];
|
||||
/**
|
||||
* Eu Jev Proxy Route
|
||||
* @description Forward a request to eu/jev, an EU-hosted decision API, with `EU_JEV_API_KEY`.
|
||||
*
|
||||
* `POST /eu_jev/v1/systemone` sends a `state` and one to eight named `questions` (`choice`, `noul` or `score`)
|
||||
* and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` is
|
||||
* rejected with a 400.
|
||||
*
|
||||
* [Docs](https://docs.litellm.ai/docs/pass_through/eu_jev)
|
||||
*/
|
||||
put: operations["eu_jev_proxy_route_eu_jev__endpoint__put"];
|
||||
/**
|
||||
* Eu Jev Proxy Route
|
||||
* @description Forward a request to eu/jev, an EU-hosted decision API, with `EU_JEV_API_KEY`.
|
||||
*
|
||||
* `POST /eu_jev/v1/systemone` sends a `state` and one to eight named `questions` (`choice`, `noul` or `score`)
|
||||
* and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` is
|
||||
* rejected with a 400.
|
||||
*
|
||||
* [Docs](https://docs.litellm.ai/docs/pass_through/eu_jev)
|
||||
*/
|
||||
post: operations["eu_jev_proxy_route_eu_jev__endpoint__post"];
|
||||
/**
|
||||
* Eu Jev Proxy Route
|
||||
* @description Forward a request to eu/jev, an EU-hosted decision API, with `EU_JEV_API_KEY`.
|
||||
*
|
||||
* `POST /eu_jev/v1/systemone` sends a `state` and one to eight named `questions` (`choice`, `noul` or `score`)
|
||||
* and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` is
|
||||
* rejected with a 400.
|
||||
*
|
||||
* [Docs](https://docs.litellm.ai/docs/pass_through/eu_jev)
|
||||
*/
|
||||
delete: operations["eu_jev_proxy_route_eu_jev__endpoint__delete"];
|
||||
post: operations["eu_jev_proxy_route_eu_jev_v1_systemone_post"];
|
||||
delete?: never;
|
||||
options?: never;
|
||||
head?: never;
|
||||
/**
|
||||
* Eu Jev Proxy Route
|
||||
* @description Forward a request to eu/jev, an EU-hosted decision API, with `EU_JEV_API_KEY`.
|
||||
*
|
||||
* `POST /eu_jev/v1/systemone` sends a `state` and one to eight named `questions` (`choice`, `noul` or `score`)
|
||||
* and returns one answer per question name, with spend booked from the reported `usage`. `custom_body` is
|
||||
* rejected with a 400.
|
||||
*
|
||||
* [Docs](https://docs.litellm.ai/docs/pass_through/eu_jev)
|
||||
*/
|
||||
patch: operations["eu_jev_proxy_route_eu_jev__endpoint__patch"];
|
||||
patch?: never;
|
||||
trace?: never;
|
||||
};
|
||||
"/extraction": {
|
||||
|
|
@ -59256,13 +59216,11 @@ export interface operations {
|
|||
};
|
||||
};
|
||||
};
|
||||
eu_jev_proxy_route_eu_jev__endpoint__get: {
|
||||
eu_jev_proxy_route_eu_jev_v1_systemone_post: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path: {
|
||||
endpoint: string;
|
||||
};
|
||||
path?: never;
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody: {
|
||||
|
|
@ -59394,611 +59352,6 @@ export interface operations {
|
|||
"application/json": components["schemas"]["EuJevDecisionResponse"];
|
||||
};
|
||||
};
|
||||
/** @description Validation Error */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HTTPValidationError"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
eu_jev_proxy_route_eu_jev__endpoint__put: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path: {
|
||||
endpoint: string;
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody: {
|
||||
content: {
|
||||
/**
|
||||
* @example {
|
||||
* "model": "eu-jeff-latest",
|
||||
* "questions": {
|
||||
* "frustration": {
|
||||
* "criteria": [
|
||||
* "calm",
|
||||
* "mildly annoyed",
|
||||
* "angry"
|
||||
* ],
|
||||
* "instructions": "How frustrated is the customer?",
|
||||
* "type": "score"
|
||||
* },
|
||||
* "is_refund_request": {
|
||||
* "instructions": "Is the customer asking for a refund?",
|
||||
* "type": "noul"
|
||||
* },
|
||||
* "team": {
|
||||
* "criteria": {
|
||||
* "billing": "Payments, invoices, and refunds",
|
||||
* "support": "Technical issues and bugs"
|
||||
* },
|
||||
* "instructions": "Which team should handle this?",
|
||||
* "type": "choice"
|
||||
* }
|
||||
* },
|
||||
* "state": "I was charged twice. Can I get a refund?"
|
||||
* }
|
||||
*/
|
||||
"application/json": {
|
||||
/**
|
||||
* Model
|
||||
* @description eu-jeff-latest follows the current release, eu-jeff-1.0.0 pins it
|
||||
* @default eu-jeff-latest
|
||||
*/
|
||||
model?: string;
|
||||
/**
|
||||
* Questions
|
||||
* @description One to eight questions, keyed by names of up to 80 characters
|
||||
*/
|
||||
questions: {
|
||||
[key: string]: {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 64 options, option name to description. A null description uses the option name
|
||||
*/
|
||||
criteria: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
};
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "choice";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Optional descriptions of what true and false mean
|
||||
*/
|
||||
criteria?: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
} | null;
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "noul";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 10 level descriptions, ordered from low to high
|
||||
*/
|
||||
criteria: (string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null)[];
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "score";
|
||||
};
|
||||
};
|
||||
/**
|
||||
* State
|
||||
* @description The content to evaluate, a string of up to 100,000 characters or a JSON object or array
|
||||
*/
|
||||
state: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[];
|
||||
};
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description Successful Response */
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["EuJevDecisionResponse"];
|
||||
};
|
||||
};
|
||||
/** @description Validation Error */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HTTPValidationError"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
eu_jev_proxy_route_eu_jev__endpoint__post: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path: {
|
||||
endpoint: string;
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody: {
|
||||
content: {
|
||||
/**
|
||||
* @example {
|
||||
* "model": "eu-jeff-latest",
|
||||
* "questions": {
|
||||
* "frustration": {
|
||||
* "criteria": [
|
||||
* "calm",
|
||||
* "mildly annoyed",
|
||||
* "angry"
|
||||
* ],
|
||||
* "instructions": "How frustrated is the customer?",
|
||||
* "type": "score"
|
||||
* },
|
||||
* "is_refund_request": {
|
||||
* "instructions": "Is the customer asking for a refund?",
|
||||
* "type": "noul"
|
||||
* },
|
||||
* "team": {
|
||||
* "criteria": {
|
||||
* "billing": "Payments, invoices, and refunds",
|
||||
* "support": "Technical issues and bugs"
|
||||
* },
|
||||
* "instructions": "Which team should handle this?",
|
||||
* "type": "choice"
|
||||
* }
|
||||
* },
|
||||
* "state": "I was charged twice. Can I get a refund?"
|
||||
* }
|
||||
*/
|
||||
"application/json": {
|
||||
/**
|
||||
* Model
|
||||
* @description eu-jeff-latest follows the current release, eu-jeff-1.0.0 pins it
|
||||
* @default eu-jeff-latest
|
||||
*/
|
||||
model?: string;
|
||||
/**
|
||||
* Questions
|
||||
* @description One to eight questions, keyed by names of up to 80 characters
|
||||
*/
|
||||
questions: {
|
||||
[key: string]: {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 64 options, option name to description. A null description uses the option name
|
||||
*/
|
||||
criteria: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
};
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "choice";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Optional descriptions of what true and false mean
|
||||
*/
|
||||
criteria?: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
} | null;
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "noul";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 10 level descriptions, ordered from low to high
|
||||
*/
|
||||
criteria: (string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null)[];
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "score";
|
||||
};
|
||||
};
|
||||
/**
|
||||
* State
|
||||
* @description The content to evaluate, a string of up to 100,000 characters or a JSON object or array
|
||||
*/
|
||||
state: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[];
|
||||
};
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description Successful Response */
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["EuJevDecisionResponse"];
|
||||
};
|
||||
};
|
||||
/** @description Validation Error */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HTTPValidationError"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
eu_jev_proxy_route_eu_jev__endpoint__delete: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path: {
|
||||
endpoint: string;
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody: {
|
||||
content: {
|
||||
/**
|
||||
* @example {
|
||||
* "model": "eu-jeff-latest",
|
||||
* "questions": {
|
||||
* "frustration": {
|
||||
* "criteria": [
|
||||
* "calm",
|
||||
* "mildly annoyed",
|
||||
* "angry"
|
||||
* ],
|
||||
* "instructions": "How frustrated is the customer?",
|
||||
* "type": "score"
|
||||
* },
|
||||
* "is_refund_request": {
|
||||
* "instructions": "Is the customer asking for a refund?",
|
||||
* "type": "noul"
|
||||
* },
|
||||
* "team": {
|
||||
* "criteria": {
|
||||
* "billing": "Payments, invoices, and refunds",
|
||||
* "support": "Technical issues and bugs"
|
||||
* },
|
||||
* "instructions": "Which team should handle this?",
|
||||
* "type": "choice"
|
||||
* }
|
||||
* },
|
||||
* "state": "I was charged twice. Can I get a refund?"
|
||||
* }
|
||||
*/
|
||||
"application/json": {
|
||||
/**
|
||||
* Model
|
||||
* @description eu-jeff-latest follows the current release, eu-jeff-1.0.0 pins it
|
||||
* @default eu-jeff-latest
|
||||
*/
|
||||
model?: string;
|
||||
/**
|
||||
* Questions
|
||||
* @description One to eight questions, keyed by names of up to 80 characters
|
||||
*/
|
||||
questions: {
|
||||
[key: string]: {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 64 options, option name to description. A null description uses the option name
|
||||
*/
|
||||
criteria: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
};
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "choice";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Optional descriptions of what true and false mean
|
||||
*/
|
||||
criteria?: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
} | null;
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "noul";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 10 level descriptions, ordered from low to high
|
||||
*/
|
||||
criteria: (string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null)[];
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "score";
|
||||
};
|
||||
};
|
||||
/**
|
||||
* State
|
||||
* @description The content to evaluate, a string of up to 100,000 characters or a JSON object or array
|
||||
*/
|
||||
state: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[];
|
||||
};
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description Successful Response */
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["EuJevDecisionResponse"];
|
||||
};
|
||||
};
|
||||
/** @description Validation Error */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HTTPValidationError"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
eu_jev_proxy_route_eu_jev__endpoint__patch: {
|
||||
parameters: {
|
||||
query?: never;
|
||||
header?: never;
|
||||
path: {
|
||||
endpoint: string;
|
||||
};
|
||||
cookie?: never;
|
||||
};
|
||||
requestBody: {
|
||||
content: {
|
||||
/**
|
||||
* @example {
|
||||
* "model": "eu-jeff-latest",
|
||||
* "questions": {
|
||||
* "frustration": {
|
||||
* "criteria": [
|
||||
* "calm",
|
||||
* "mildly annoyed",
|
||||
* "angry"
|
||||
* ],
|
||||
* "instructions": "How frustrated is the customer?",
|
||||
* "type": "score"
|
||||
* },
|
||||
* "is_refund_request": {
|
||||
* "instructions": "Is the customer asking for a refund?",
|
||||
* "type": "noul"
|
||||
* },
|
||||
* "team": {
|
||||
* "criteria": {
|
||||
* "billing": "Payments, invoices, and refunds",
|
||||
* "support": "Technical issues and bugs"
|
||||
* },
|
||||
* "instructions": "Which team should handle this?",
|
||||
* "type": "choice"
|
||||
* }
|
||||
* },
|
||||
* "state": "I was charged twice. Can I get a refund?"
|
||||
* }
|
||||
*/
|
||||
"application/json": {
|
||||
/**
|
||||
* Model
|
||||
* @description eu-jeff-latest follows the current release, eu-jeff-1.0.0 pins it
|
||||
* @default eu-jeff-latest
|
||||
*/
|
||||
model?: string;
|
||||
/**
|
||||
* Questions
|
||||
* @description One to eight questions, keyed by names of up to 80 characters
|
||||
*/
|
||||
questions: {
|
||||
[key: string]: {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 64 options, option name to description. A null description uses the option name
|
||||
*/
|
||||
criteria: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
};
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "choice";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Optional descriptions of what true and false mean
|
||||
*/
|
||||
criteria?: {
|
||||
[key: string]: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
} | null;
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "noul";
|
||||
} | {
|
||||
/**
|
||||
* Criteria
|
||||
* @description Two to 10 level descriptions, ordered from low to high
|
||||
*/
|
||||
criteria: (string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null)[];
|
||||
/**
|
||||
* Instructions
|
||||
* @description Free text, or a JSON object, array or null that eu/jev serializes to text before inference
|
||||
*/
|
||||
instructions: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[] | null;
|
||||
/**
|
||||
* Type
|
||||
* @constant
|
||||
*/
|
||||
type: "score";
|
||||
};
|
||||
};
|
||||
/**
|
||||
* State
|
||||
* @description The content to evaluate, a string of up to 100,000 characters or a JSON object or array
|
||||
*/
|
||||
state: string | {
|
||||
[key: string]: unknown;
|
||||
} | unknown[];
|
||||
};
|
||||
};
|
||||
};
|
||||
responses: {
|
||||
/** @description Successful Response */
|
||||
200: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["EuJevDecisionResponse"];
|
||||
};
|
||||
};
|
||||
/** @description Validation Error */
|
||||
422: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": components["schemas"]["HTTPValidationError"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
extraction_extraction_post: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue