@@ -114,6 +114,36 @@ class PartialQuestionAnswer(pydantic.BaseModel):
114
114
answer : Optional [ChatMessage ]
115
115
116
116
117
+ class ProviderType (str , Enum ):
118
+ """
119
+ Represents the different types of providers we support.
120
+ """
121
+
122
+ openai = "openai"
123
+ anthropic = "anthropic"
124
+ vllm = "vllm"
125
+
126
+
127
+ class TokenUsageByModel (pydantic .BaseModel ):
128
+ """
129
+ Represents the tokens used by a model.
130
+ """
131
+
132
+ provider_type : ProviderType
133
+ model : str
134
+ used_tokens : int
135
+
136
+
137
+ class TokenUsage (pydantic .BaseModel ):
138
+ """
139
+ Represents the tokens used. Includes the information of the tokens used by model.
140
+ `used_tokens` are the total tokens used in the `tokens_by_model` list.
141
+ """
142
+
143
+ tokens_by_model : List [TokenUsageByModel ]
144
+ used_tokens : int
145
+
146
+
117
147
class Conversation (pydantic .BaseModel ):
118
148
"""
119
149
Represents a conversation.
@@ -124,6 +154,7 @@ class Conversation(pydantic.BaseModel):
124
154
type : QuestionType
125
155
chat_id : str
126
156
conversation_timestamp : datetime .datetime
157
+ token_usage : Optional [TokenUsage ]
127
158
128
159
129
160
class AlertConversation (pydantic .BaseModel ):
@@ -140,16 +171,6 @@ class AlertConversation(pydantic.BaseModel):
140
171
timestamp : datetime .datetime
141
172
142
173
143
- class ProviderType (str , Enum ):
144
- """
145
- Represents the different types of providers we support.
146
- """
147
-
148
- openai = "openai"
149
- anthropic = "anthropic"
150
- vllm = "vllm"
151
-
152
-
153
174
class ProviderAuthType (str , Enum ):
154
175
"""
155
176
Represents the different types of auth we support for providers.
0 commit comments