@@ -114,6 +114,36 @@ class PartialQuestionAnswer(pydantic.BaseModel):
114114 answer : Optional [ChatMessage ]
115115
116116
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+
117147class Conversation (pydantic .BaseModel ):
118148 """
119149 Represents a conversation.
@@ -124,6 +154,7 @@ class Conversation(pydantic.BaseModel):
124154 type : QuestionType
125155 chat_id : str
126156 conversation_timestamp : datetime .datetime
157+ token_usage : Optional [TokenUsage ]
127158
128159
129160class AlertConversation (pydantic .BaseModel ):
@@ -140,16 +171,6 @@ class AlertConversation(pydantic.BaseModel):
140171 timestamp : datetime .datetime
141172
142173
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-
153174class ProviderAuthType (str , Enum ):
154175 """
155176 Represents the different types of auth we support for providers.
0 commit comments