@lmnr-ai/lmnr 0.5.2 → 0.6.1
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/README.md +31 -16
- package/assets/rrweb/rrweb.umd.min.cjs +98 -0
- package/dist/cli.d.mts +1 -2
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +27 -17
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +23 -13
- package/dist/cli.mjs.map +1 -1
- package/dist/{evaluations-Bu7nHmvf.d.mts → evaluations-DnYxZEAV.d.mts} +240 -61
- package/dist/{evaluations-Bu7nHmvf.d.ts → evaluations-DnYxZEAV.d.ts} +240 -61
- package/dist/index.d.mts +200 -72
- package/dist/index.d.ts +200 -72
- package/dist/index.js +621 -528
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +641 -547
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -19
- package/assets/rrweb/rrweb.min.js +0 -26
package/README.md
CHANGED
|
@@ -18,12 +18,9 @@ npm install @lmnr-ai/lmnr
|
|
|
18
18
|
And then in the code
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
|
-
|
|
22
|
-
export NEXT_OTEL_FETCH_DISABLED=1
|
|
21
|
+
import { Laminar } from '@lmnr-ai/lmnr'
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
L.initialize({ projectApiKey: '<PROJECT_API_KEY>' })
|
|
23
|
+
Laminar.initialize({ projectApiKey: '<PROJECT_API_KEY>' })
|
|
27
24
|
```
|
|
28
25
|
|
|
29
26
|
This will automatically instrument most of the LLM, Vector DB, and related
|
|
@@ -31,7 +28,13 @@ calls with OpenTelemetry-compatible instrumentation.
|
|
|
31
28
|
|
|
32
29
|
[Read docs](https://docs.lmnr.ai) to learn more.
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
Auto-instrumentations are provided by [OpenLLMetry](https://github.com/traceloop/openllmetry-js).
|
|
32
|
+
|
|
33
|
+
### Where to place Laminar.initialize()
|
|
34
|
+
|
|
35
|
+
Laminar.initialize() must be called
|
|
36
|
+
- once in your application,
|
|
37
|
+
- as early as possible, but after other instrumentation libraries
|
|
35
38
|
|
|
36
39
|
## Instrumentation
|
|
37
40
|
|
|
@@ -66,21 +69,33 @@ const poemWriter = async (topic = "turbulence") => {
|
|
|
66
69
|
await observe({name: 'poemWriter'}, async () => await poemWriter('laminar flow'))
|
|
67
70
|
```
|
|
68
71
|
|
|
69
|
-
### Sending
|
|
72
|
+
### Sending spans to Laminar from a different tracing library
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
Many tracing libraries accept `spanProcessors` as an initialization parameter.
|
|
72
75
|
|
|
73
|
-
|
|
76
|
+
Laminar exposes `LaminarSpanProcessor` that you could use for these purposes.
|
|
74
77
|
|
|
75
|
-
|
|
78
|
+
Be careful NOT to call `Laminar.initialize` in such setup, to avoid double tracing.
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
import { Laminar as L } from '@lmnr-ai/lmnr';
|
|
79
|
-
// ...
|
|
80
|
-
const poem = response.choices[0].message.content;
|
|
80
|
+
#### Example with @vercel/otel
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
For example, in Next.js instrumentation.ts you could do:
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
import { registerOTel } from '@vercel/otel'
|
|
86
|
+
|
|
87
|
+
export async function register() {
|
|
88
|
+
if (process.env.NEXT_RUNTIME === "nodejs") {
|
|
89
|
+
const { Laminar, LaminarSpanProcessor, initializeLaminarInstrumentations } = await import("@lmnr-ai/lmnr");
|
|
90
|
+
registerOTel({
|
|
91
|
+
serviceName: "my-service",
|
|
92
|
+
spanProcessors: [
|
|
93
|
+
new LaminarSpanProcessor(),
|
|
94
|
+
],
|
|
95
|
+
instrumentations: initializeLaminarInstrumentations(),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
84
99
|
```
|
|
85
100
|
|
|
86
101
|
## Evaluations
|