@terreno/ai 0.11.2 → 0.11.4-beta.2
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 +15 -9
- package/src/langfuseClient.test.ts +0 -72
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.2",
|
|
13
|
+
"@terreno/api": "0.11.4-beta.2",
|
|
14
14
|
"ai": "^6.0.97",
|
|
15
15
|
"multer": "^1.4.5-lts.1"
|
|
16
16
|
},
|
|
@@ -30,16 +30,22 @@
|
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js",
|
|
35
|
+
"require": "./dist/index.js",
|
|
36
|
+
"default": "./dist/index.js"
|
|
35
37
|
},
|
|
36
38
|
"./langfuseClient": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
+
"types": "./dist/langfuseClient.d.ts",
|
|
40
|
+
"import": "./dist/langfuseClient.js",
|
|
41
|
+
"require": "./dist/langfuseClient.js",
|
|
42
|
+
"default": "./dist/langfuseClient.js"
|
|
39
43
|
},
|
|
40
44
|
"./langfuseApp": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
45
|
+
"types": "./dist/langfuseApp.d.ts",
|
|
46
|
+
"import": "./dist/langfuseApp.js",
|
|
47
|
+
"require": "./dist/langfuseApp.js",
|
|
48
|
+
"default": "./dist/langfuseApp.js"
|
|
43
49
|
}
|
|
44
50
|
},
|
|
45
51
|
"homepage": "https://github.com/FlourishHealth/terreno#readme",
|
|
@@ -56,7 +62,7 @@
|
|
|
56
62
|
"access": "public"
|
|
57
63
|
},
|
|
58
64
|
"peerDependencies": {
|
|
59
|
-
"@terreno/api": "0.11.2",
|
|
65
|
+
"@terreno/api": "0.11.4-beta.2",
|
|
60
66
|
"mongoose": "^8.0.0"
|
|
61
67
|
},
|
|
62
68
|
"repository": {
|
|
@@ -75,5 +81,5 @@
|
|
|
75
81
|
"test:coverage": "bun run ../scripts/check-coverage.ts"
|
|
76
82
|
},
|
|
77
83
|
"types": "dist/index.d.ts",
|
|
78
|
-
"version": "0.11.2"
|
|
84
|
+
"version": "0.11.4-beta.2"
|
|
79
85
|
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {afterEach, beforeEach, describe, expect, it} from "bun:test";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getLangfuseClient,
|
|
5
|
-
initLangfuseClient,
|
|
6
|
-
isLangfuseInitialized,
|
|
7
|
-
shutdownLangfuseClient,
|
|
8
|
-
} from "./langfuseClient";
|
|
9
|
-
|
|
10
|
-
describe("langfuseClient", () => {
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
await shutdownLangfuseClient();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
afterEach(async () => {
|
|
16
|
-
await shutdownLangfuseClient();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("throws when getLangfuseClient is called before initialization", () => {
|
|
20
|
-
expect(() => getLangfuseClient()).toThrow(
|
|
21
|
-
"Langfuse client not initialized. Call initLangfuseClient first."
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("isLangfuseInitialized returns false before initialization", () => {
|
|
26
|
-
expect(isLangfuseInitialized()).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("initLangfuseClient creates and returns a client", () => {
|
|
30
|
-
const client = initLangfuseClient({
|
|
31
|
-
publicKey: "pk-test",
|
|
32
|
-
secretKey: "sk-test",
|
|
33
|
-
});
|
|
34
|
-
expect(client).toBeDefined();
|
|
35
|
-
expect(isLangfuseInitialized()).toBe(true);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("getLangfuseClient returns the initialized client", () => {
|
|
39
|
-
const initialized = initLangfuseClient({
|
|
40
|
-
publicKey: "pk-test",
|
|
41
|
-
secretKey: "sk-test",
|
|
42
|
-
});
|
|
43
|
-
const retrieved = getLangfuseClient();
|
|
44
|
-
expect(retrieved).toBe(initialized);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("initLangfuseClient accepts a custom baseUrl", () => {
|
|
48
|
-
const client = initLangfuseClient({
|
|
49
|
-
baseUrl: "https://custom.langfuse.com",
|
|
50
|
-
publicKey: "pk-test",
|
|
51
|
-
secretKey: "sk-test",
|
|
52
|
-
});
|
|
53
|
-
expect(client).toBeDefined();
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("shutdownLangfuseClient resets the instance", async () => {
|
|
57
|
-
initLangfuseClient({
|
|
58
|
-
publicKey: "pk-test",
|
|
59
|
-
secretKey: "sk-test",
|
|
60
|
-
});
|
|
61
|
-
expect(isLangfuseInitialized()).toBe(true);
|
|
62
|
-
await shutdownLangfuseClient();
|
|
63
|
-
expect(isLangfuseInitialized()).toBe(false);
|
|
64
|
-
expect(() => getLangfuseClient()).toThrow();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("shutdownLangfuseClient is a no-op when not initialized", async () => {
|
|
68
|
-
expect(isLangfuseInitialized()).toBe(false);
|
|
69
|
-
await shutdownLangfuseClient();
|
|
70
|
-
expect(isLangfuseInitialized()).toBe(false);
|
|
71
|
-
});
|
|
72
|
-
});
|