@terreno/ai 0.11.4-beta.2 → 0.11.4-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@langfuse/otel": "^5.0.1",
|
|
11
11
|
"@opentelemetry/api": "^1.9.0",
|
|
12
12
|
"@opentelemetry/sdk-node": "^0.213.0",
|
|
13
|
-
"@terreno/api": "0.11.4-beta.
|
|
13
|
+
"@terreno/api": "0.11.4-beta.4",
|
|
14
14
|
"ai": "^6.0.97",
|
|
15
15
|
"multer": "^1.4.5-lts.1"
|
|
16
16
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"access": "public"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@terreno/api": "0.11.4-beta.
|
|
65
|
+
"@terreno/api": "0.11.4-beta.4",
|
|
66
66
|
"mongoose": "^8.0.0"
|
|
67
67
|
},
|
|
68
68
|
"repository": {
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"test:coverage": "bun run ../scripts/check-coverage.ts"
|
|
82
82
|
},
|
|
83
83
|
"types": "dist/index.d.ts",
|
|
84
|
-
"version": "0.11.4-beta.
|
|
84
|
+
"version": "0.11.4-beta.4"
|
|
85
85
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import {beforeEach, describe, expect, it, mock} from "bun:test";
|
|
2
2
|
|
|
3
3
|
const shutdownMock = mock(async () => {});
|
|
4
|
-
let ctorCalls = 0;
|
|
5
4
|
class FakeLangfuseClient {
|
|
6
|
-
constructor(public opts: {baseUrl?: string; publicKey: string; secretKey: string}) {
|
|
7
|
-
ctorCalls += 1;
|
|
8
|
-
}
|
|
5
|
+
constructor(public opts: {baseUrl?: string; publicKey: string; secretKey: string}) {}
|
|
9
6
|
async shutdown(): Promise<void> {
|
|
10
7
|
return shutdownMock();
|
|
11
8
|
}
|
|
@@ -21,7 +18,6 @@ const {getLangfuseClient, initLangfuseClient, isLangfuseInitialized, shutdownLan
|
|
|
21
18
|
describe("langfuseClient", () => {
|
|
22
19
|
beforeEach(async () => {
|
|
23
20
|
await shutdownLangfuseClient();
|
|
24
|
-
ctorCalls = 0;
|
|
25
21
|
});
|
|
26
22
|
|
|
27
23
|
it("throws when accessing client before initialization", () => {
|
|
@@ -122,8 +122,8 @@ describe("getPrompt", () => {
|
|
|
122
122
|
expect(cached).toBeTruthy();
|
|
123
123
|
const expectedExpiryMs = Date.now() + 120_000;
|
|
124
124
|
// Allow some slack for test execution time
|
|
125
|
-
expect(cached
|
|
126
|
-
expect(cached
|
|
125
|
+
expect(cached?.expiresAt.getTime()).toBeGreaterThan(expectedExpiryMs - 5000);
|
|
126
|
+
expect(cached?.expiresAt.getTime()).toBeLessThan(expectedExpiryMs + 5000);
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
it("throws when Langfuse fetch fails", async () => {
|