Skip to content

Commit 4ea01ce

Browse files
authored
chore: Clarify composite-tracker re-call wording (#1382)
1 parent b246631 commit 4ea01ce

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ export interface LDAIConfigTracker {
152152
* @param func Function which executes the AI run
153153
* @returns The result of the AI run
154154
*
155-
* @remarks Because each inner metric is at-most-once per Tracker, calling
156-
* this twice on the same Tracker will run the inner function again but
157-
* produce no additional metric events.
155+
* @remarks Subsequent calls re-run the inner function but emit only metrics
156+
* not already recorded on this Tracker. Call createTracker on the AI Config
157+
* to start a new run.
158158
*/
159159
trackMetricsOf<TRes>(
160160
metricsExtractor: (result: TRes) => LDAIMetrics,
@@ -182,9 +182,9 @@ export interface LDAIConfigTracker {
182182
* @param metricsExtractor Function that asynchronously extracts metrics from the stream
183183
* @returns The stream result (returned immediately, not a Promise)
184184
*
185-
* @remarks Because each inner metric is at-most-once per Tracker, calling
186-
* this twice on the same Tracker will run the inner function again but
187-
* produce no additional metric events.
185+
* @remarks Subsequent calls re-run the inner function but emit only metrics
186+
* not already recorded on this Tracker. Call createTracker on the AI Config
187+
* to start a new run.
188188
*/
189189
trackStreamMetricsOf<TStream>(
190190
streamCreator: () => TStream,
@@ -199,8 +199,8 @@ export interface LDAIConfigTracker {
199199
* @param res The result of the Bedrock operation.
200200
* @returns The input operation.
201201
*
202-
* @remarks Because each inner metric is at-most-once per Tracker, calling
203-
* this twice on the same Tracker will produce no additional metric events.
202+
* @remarks Subsequent calls emit only metrics not already recorded on this
203+
* Tracker. Call createTracker on the AI Config to start a new run.
204204
*/
205205
trackBedrockConverseMetrics<
206206
TRes extends {

0 commit comments

Comments
 (0)