Skip to content

Commit ed7b652

Browse files
committed
feat: Include AI sdk version in tracking information
1 parent 960a499 commit ed7b652

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

packages/sdk/server-ai/src/LDAIConfigTrackerImpl.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
} from './api/metrics';
1414
import { LDClientMin } from './LDClientMin';
1515

16+
const { version } = require('../package.json');
17+
1618
export class LDAIConfigTrackerImpl implements LDAIConfigTracker {
1719
private _trackedMetrics: LDAIMetricSummary = {};
1820

@@ -32,13 +34,15 @@ export class LDAIConfigTrackerImpl implements LDAIConfigTracker {
3234
version: number;
3335
modelName: string;
3436
providerName: string;
37+
aiSdkVersion: string;
3538
} {
3639
return {
3740
variationKey: this._variationKey,
3841
configKey: this._configKey,
3942
version: this._version,
4043
modelName: this._modelName,
4144
providerName: this._providerName,
45+
aiSdkVersion: version,
4246
};
4347
}
4448

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ export interface LDAIConfigTracker {
4242
variationKey: string;
4343
configKey: string;
4444
version: number;
45+
modelName: string;
46+
providerName: string;
47+
aiSdkVersion: string;
4548
};
4649
/**
4750
* Track the duration of generation.

packages/sdk/server-ai/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"stripInternal": true,
1717
"moduleResolution": "node"
1818
},
19-
"include": ["src"],
19+
"include": ["src/**/*"],
2020
"exclude": ["**/*.test.ts", "dist", "node_modules", "__tests__"]
2121
}

packages/sdk/server-ai/tsconfig.ref.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["src/**/*"],
3+
"include": ["src/**/*", "package.json"],
44
"compilerOptions": {
55
"composite": true
66
}

0 commit comments

Comments
 (0)