Skip to content

Commit bfe8e31

Browse files
committed
back to typealias
1 parent e753a0b commit bfe8e31

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

eval_protocol/proxy/proxy_core/models.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,20 @@
33
"""
44

55
from pydantic import BaseModel
6-
from typing import Optional, List, Any, Dict, Protocol
6+
from typing import Optional, List, Any, Dict, TypeAlias, Callable
77
from fastapi import Request
88

99

10+
ChatRequestHook: TypeAlias = Callable[[Dict[str, Any], Request, "ChatParams"], tuple[Dict[str, Any], "ChatParams"]]
11+
TracesRequestHook: TypeAlias = Callable[[Request, "TracesParams"], "TracesParams"]
12+
13+
1014
class AccountInfo(BaseModel):
1115
"""Account information returned from authentication."""
1216

1317
account_id: str
1418

1519

16-
class ChatRequestHook(Protocol):
17-
def __call__(
18-
self, data: Dict[str, Any], request: Request, params: "ChatParams"
19-
) -> tuple[Dict[str, Any], "ChatParams"]: ...
20-
21-
22-
class TracesRequestHook(Protocol):
23-
def __call__(self, request: Request, params: "TracesParams") -> "TracesParams": ...
24-
25-
2620
class ChatParams(BaseModel):
2721
"""Typed container for chat completion URL path parameters."""
2822

0 commit comments

Comments
 (0)