From f307d45394801d7c108e22d5b4c1383e8a856b5a Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:52:49 -0800 Subject: [PATCH] Linting --- .../__tests__/LDAIConfigTrackerImpl.test.ts | 4 ++-- packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts | 2 +- .../server-ai/src/api/config/LDAIConfigTracker.ts | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/sdk/server-ai/__tests__/LDAIConfigTrackerImpl.test.ts b/packages/sdk/server-ai/__tests__/LDAIConfigTrackerImpl.test.ts index 49e4d27ae..73ccd8e2c 100644 --- a/packages/sdk/server-ai/__tests__/LDAIConfigTrackerImpl.test.ts +++ b/packages/sdk/server-ai/__tests__/LDAIConfigTrackerImpl.test.ts @@ -142,7 +142,7 @@ it('tracks error when OpenAI metrics function throws', async () => { await expect( tracker.trackOpenAIMetrics(async () => { throw error; - }) + }), ).rejects.toThrow(error); expect(mockTrack).toHaveBeenCalledWith( @@ -357,7 +357,7 @@ it('tracks duration when async function throws', async () => { await expect( tracker.trackDurationOf(async () => { throw error; - }) + }), ).rejects.toThrow(error); expect(mockTrack).toHaveBeenCalledWith( diff --git a/packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts b/packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts index 313653a16..c7906d271 100644 --- a/packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts +++ b/packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts @@ -78,7 +78,7 @@ export class LDAIConfigTrackerImpl implements LDAIConfigTracker { this.trackTokens(createOpenAiUsage(result.usage)); } return result; - } catch(err) { + } catch (err) { this.trackError(); throw err; } diff --git a/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts b/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts index 36f47372b..9cfc55c86 100644 --- a/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts +++ b/packages/sdk/server-ai/src/api/config/LDAIConfigTracker.ts @@ -64,12 +64,12 @@ export interface LDAIConfigTracker { /** * Track the duration of execution of the provided function. - * + * * If the provided function throws, then this method will also throw. * In the case the provided function throws, this function will still record the duration. - * + * * This function does not automatically record an error when the function throws. - * + * * @param func The function to track the duration of. * @returns The result of the function. */ @@ -77,9 +77,9 @@ export interface LDAIConfigTracker { /** * Track an OpenAI operation. - * + * * This function will track the duration of the operation, the token usage, and the success or error status. - * + * * If the provided function throws, then this method will also throw. * In the case the provided function throws, this function will record the duration and an error. * A failed operation will not have any token usage data. @@ -101,7 +101,7 @@ export interface LDAIConfigTracker { /** * Track an operation which uses Bedrock. - * + * * This function will track the duration of the operation, the token usage, and the success or error status. * * @param res The result of the Bedrock operation.