Skip to content

Commit 6da4b22

Browse files
committed
More doc
1 parent 7d6a551 commit 6da4b22

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ldai/tracker.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ def track_openai_metrics(self, func):
172172
"""
173173
Track OpenAI-specific operations.
174174
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+
175185
:param func: Function to track.
176186
:return: Result of the tracked function.
177187
"""
@@ -190,6 +200,10 @@ def track_bedrock_converse_metrics(self, res: dict) -> dict:
190200
"""
191201
Track AWS Bedrock conversation operations.
192202
203+
204+
This function will track the duration of the operation, the token
205+
usage, and the success or error status.
206+
193207
:param res: Response dictionary from Bedrock.
194208
:return: The original response dictionary.
195209
"""

0 commit comments

Comments
 (0)