File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,16 @@ def track_openai_metrics(self, func):
172
172
"""
173
173
Track OpenAI-specific operations.
174
174
175
+ This function will track the duration of the operation, the token
176
+ usage, and the success or error status.
177
+
178
+ If the provided function throws, then this method will also throw.
179
+
180
+ In the case the provided function throws, this function will record the
181
+ duration and an error.
182
+
183
+ A failed operation will not have any token usage data.
184
+
175
185
:param func: Function to track.
176
186
:return: Result of the tracked function.
177
187
"""
@@ -190,6 +200,10 @@ def track_bedrock_converse_metrics(self, res: dict) -> dict:
190
200
"""
191
201
Track AWS Bedrock conversation operations.
192
202
203
+
204
+ This function will track the duration of the operation, the token
205
+ usage, and the success or error status.
206
+
193
207
:param res: Response dictionary from Bedrock.
194
208
:return: The original response dictionary.
195
209
"""
You can’t perform that action at this time.
0 commit comments