You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Represents the interface of the AI Config Tracker, useful for mocking.
10
+
/// </summary>
11
+
publicinterfaceILdAiConfigTracker
12
+
{
13
+
/// <summary>
14
+
/// The retrieved AI model configuration.
15
+
/// </summary>
16
+
publicLdAiConfigConfig{get;}
17
+
18
+
/// <summary>
19
+
/// Tracks a duration metric related to this config.
20
+
/// </summary>
21
+
/// <param name="durationMs">the duration in milliseconds</param>
22
+
publicvoidTrackDuration(floatdurationMs);
23
+
24
+
/// <summary>
25
+
/// Tracks the duration of a task, and returns the result of the task.
26
+
/// </summary>
27
+
/// <param name="task">the task</param>
28
+
/// <typeparam name="T">type of the task's result</typeparam>
29
+
/// <returns>the task</returns>
30
+
publicTask<T>TrackDurationOfTask<T>(Task<T>task);
31
+
32
+
/// <summary>
33
+
/// Tracks feedback (positive or negative) related to the output of the model.
34
+
/// </summary>
35
+
/// <param name="feedback">the feedback</param>
36
+
/// <exception cref="ArgumentOutOfRangeException">thrown if the feedback value is not <see cref="Feedback.Positive"/> or <see cref="Feedback.Negative"/></exception>
37
+
publicvoidTrackFeedback(Feedbackfeedback);
38
+
39
+
/// <summary>
40
+
/// Tracks a generation event related to this config.
41
+
/// </summary>
42
+
publicvoidTrackSuccess();
43
+
44
+
/// <summary>
45
+
/// Tracks a request to a provider. The request is a task that returns a <see cref="ProviderResponse"/>, which
46
+
/// contains information about the request such as token usage and metrics.
47
+
/// </summary>
48
+
/// <param name="request">a task representing the request</param>
/// Tracks feedback (positive or negative) related to the output of the model.
86
-
/// </summary>
87
-
/// <param name="feedback">the feedback</param>
88
-
/// <exception cref="ArgumentOutOfRangeException">thrown if the feedback value is not <see cref="Feedback.Positive"/> or <see cref="Feedback.Negative"/></exception>
74
+
/// <inheritdoc/>
89
75
publicvoidTrackFeedback(Feedbackfeedback)
90
76
{
91
77
switch(feedback)
@@ -101,21 +87,13 @@ public void TrackFeedback(Feedback feedback)
101
87
}
102
88
}
103
89
104
-
/// <summary>
105
-
/// Tracks a generation event related to this config.
106
-
/// </summary>
90
+
/// <inheritdoc/>
107
91
publicvoidTrackSuccess()
108
92
{
109
93
_client.Track(Generation,_context,_trackData,1);
110
94
}
111
95
112
-
113
-
/// <summary>
114
-
/// Tracks a request to a provider. The request is a task that returns a <see cref="ProviderResponse"/>, which
115
-
/// contains information about the request such as token usage and metrics.
116
-
/// </summary>
117
-
/// <param name="request">a task representing the request</param>
0 commit comments