Skip to content

Commit 1b5e2a5

Browse files
author
Daniel OBrien
committed
change types to dataclasses
1 parent bff84ef commit 1b5e2a5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ldai/types.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
from enum import Enum
2-
from typing import Callable, TypedDict
2+
from typing import Callable
33
from dataclasses import dataclass
44

55
@dataclass
6-
class TokenMetrics(TypedDict):
6+
class TokenMetrics():
77
total: int
88
input: int
99
output: int # type: ignore
1010

11-
class AIConfigData(TypedDict):
11+
@dataclass
12+
13+
class AIConfigData():
1214
config: dict
1315
prompt: any
1416
_ldMeta: dict
1517

16-
class AITracker(TypedDict):
18+
class AITracker():
1719
track_duration: Callable[..., None]
1820
track_tokens: Callable[..., None]
1921
track_error: Callable[..., None]
@@ -29,7 +31,9 @@ class FeedbackKind(Enum):
2931
Positive = "positive"
3032
Negative = "negative"
3133

32-
class TokenUsage(TypedDict):
34+
@dataclass
35+
36+
class TokenUsage():
3337
total_tokens: int
3438
prompt_tokens: int
3539
completion_tokens: int

0 commit comments

Comments
 (0)