Skip to content

Commit 9aaf08b

Browse files
committed
updates from new version (depends on browserbase#759)
1 parent 67215a5 commit 9aaf08b

File tree

3 files changed

+1207
-7
lines changed

3 files changed

+1207
-7
lines changed

examples/laminar_observability.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
// 2. Run `export LMNR_PROJECT_API_KEY=<your-api-key>`
77
// 3. Expose your OPENAI_API_KEY to the environment.
88

9-
import { Laminar } from "@lmnr-ai/lmnr";
9+
import { Laminar, getTracer } from "@lmnr-ai/lmnr";
1010
import { Stagehand } from "@/dist";
11+
import { OpenAI } from "openai";
1112
import { z } from "zod";
1213

1314
Laminar.initialize({
1415
projectApiKey: process.env.LMNR_PROJECT_API_KEY,
15-
// In some JS bundlers, you may not need to pass instrumentModules; it may
16-
// be enough to initialize Laminar *before* importing Stagehand.
1716
instrumentModules: {
1817
stagehand: Stagehand,
18+
OpenAI: OpenAI,
1919
},
2020
});
2121

@@ -25,6 +25,10 @@ async function example() {
2525
modelName: "gpt-4o-mini",
2626
modelClientOptions: {
2727
apiKey: process.env.OPENAI_API_KEY,
28+
aiSdkTelemetrySettings: {
29+
isEnabled: true,
30+
tracer: getTracer(),
31+
},
2832
},
2933
});
3034
await stagehand.init();
@@ -42,9 +46,9 @@ async function example() {
4246

4347
await stagehand.close();
4448

45-
// In one-off scripts like this, it is important to shut down Laminar to make
49+
// In one-off scripts like this, it is important to flush Laminar to make
4650
// sure all spans and session data is flushed and sent to the server.
47-
await Laminar.shutdown();
51+
await Laminar.flush();
4852
}
4953

5054
(async () => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@eslint/js": "^9.16.0",
3939
"@langchain/core": "^0.3.40",
4040
"@langchain/openai": "^0.4.4",
41-
"@lmnr-ai/lmnr": "^0.5.0",
41+
"@lmnr-ai/lmnr": "^0.6.0",
4242
"@types/adm-zip": "^0.5.7",
4343
"@types/cheerio": "^0.22.35",
4444
"@types/express": "^4.17.21",

0 commit comments

Comments
 (0)