@lmnr-ai/lmnr 0.4.28 → 0.4.30
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/dist/cli.js +33 -32
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +33 -32
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +33 -32
- package/src/evaluations.ts +8 -1
- package/src/laminar.ts +5 -2
package/dist/cli.js
CHANGED
|
@@ -36,7 +36,7 @@ var require_package = __commonJS({
|
|
|
36
36
|
"package.json"(exports2, module2) {
|
|
37
37
|
module2.exports = {
|
|
38
38
|
name: "@lmnr-ai/lmnr",
|
|
39
|
-
version: "0.4.
|
|
39
|
+
version: "0.4.30",
|
|
40
40
|
description: "TypeScript SDK for Laminar AI",
|
|
41
41
|
main: "dist/index.js",
|
|
42
42
|
types: "dist/index.d.ts",
|
|
@@ -64,55 +64,56 @@ var require_package = __commonJS({
|
|
|
64
64
|
},
|
|
65
65
|
homepage: "https://github.com/lmnr-ai/lmnr-ts#README",
|
|
66
66
|
devDependencies: {
|
|
67
|
-
"@anthropic-ai/sdk": "^0.
|
|
68
|
-
"@aws-sdk/client-bedrock-runtime": "^3.
|
|
69
|
-
"@azure/openai": "
|
|
67
|
+
"@anthropic-ai/sdk": "^0.33.1",
|
|
68
|
+
"@aws-sdk/client-bedrock-runtime": "^3.716.0",
|
|
69
|
+
"@azure/openai": "^2.0.0",
|
|
70
70
|
"@google-cloud/aiplatform": "^3.34.0",
|
|
71
|
-
"@google-cloud/vertexai": "^1.9.
|
|
72
|
-
"@langchain/core": "^0.3.
|
|
73
|
-
"@pinecone-database/pinecone": "^
|
|
71
|
+
"@google-cloud/vertexai": "^1.9.2",
|
|
72
|
+
"@langchain/core": "^0.3.26",
|
|
73
|
+
"@pinecone-database/pinecone": "^4.0.0",
|
|
74
74
|
"@qdrant/js-client-rest": "^1.12.0",
|
|
75
75
|
"@types/argparse": "^2.0.17",
|
|
76
76
|
"@types/cli-progress": "^3.11.6",
|
|
77
|
-
"@types/node": "^22.10.
|
|
77
|
+
"@types/node": "^22.10.2",
|
|
78
78
|
"@types/semver": "^7.5.8",
|
|
79
79
|
"@types/uuid": "^10.0.0",
|
|
80
80
|
bufferutil: "^4.0.8",
|
|
81
81
|
chromadb: "^1.9.4",
|
|
82
82
|
"cohere-ai": "^7.15.0",
|
|
83
|
-
langchain: "^0.3.
|
|
84
|
-
llamaindex: "^0.
|
|
85
|
-
openai: "^4.
|
|
83
|
+
langchain: "^0.3.8",
|
|
84
|
+
llamaindex: "^0.8.30",
|
|
85
|
+
openai: "^4.77.0",
|
|
86
86
|
tsup: "^8.3.5",
|
|
87
87
|
tsx: "^4.19.2",
|
|
88
88
|
typescript: "^5.7.2"
|
|
89
89
|
},
|
|
90
90
|
dependencies: {
|
|
91
|
-
"@grpc/grpc-js": "^1.12.
|
|
91
|
+
"@grpc/grpc-js": "^1.12.5",
|
|
92
92
|
"@opentelemetry/api": "^1.9.0",
|
|
93
|
-
"@opentelemetry/core": "^1.
|
|
94
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
95
|
-
"@opentelemetry/exporter-trace-otlp-proto": "^0.
|
|
96
|
-
"@opentelemetry/
|
|
97
|
-
"@opentelemetry/
|
|
98
|
-
"@opentelemetry/sdk-
|
|
99
|
-
"@opentelemetry/sdk-trace-
|
|
93
|
+
"@opentelemetry/core": "^1.30.0",
|
|
94
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.57.0",
|
|
95
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.57.0",
|
|
96
|
+
"@opentelemetry/otlp-exporter-base": "^0.57.0",
|
|
97
|
+
"@opentelemetry/instrumentation": "^0.57.0",
|
|
98
|
+
"@opentelemetry/sdk-node": "^0.57.0",
|
|
99
|
+
"@opentelemetry/sdk-trace-base": "^1.30.0",
|
|
100
|
+
"@opentelemetry/sdk-trace-node": "^1.30.0",
|
|
100
101
|
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
101
|
-
"@traceloop/ai-semantic-conventions": "^0.11.
|
|
102
|
-
"@traceloop/instrumentation-anthropic": "^0.11.
|
|
103
|
-
"@traceloop/instrumentation-azure": "^0.11.
|
|
104
|
-
"@traceloop/instrumentation-bedrock": "^0.11.
|
|
105
|
-
"@traceloop/instrumentation-chromadb": "^0.11.
|
|
106
|
-
"@traceloop/instrumentation-cohere": "^0.11.
|
|
107
|
-
"@traceloop/instrumentation-langchain": "^0.11.
|
|
108
|
-
"@traceloop/instrumentation-llamaindex": "^0.11.
|
|
109
|
-
"@traceloop/instrumentation-openai": "^0.11.
|
|
110
|
-
"@traceloop/instrumentation-pinecone": "^0.11.
|
|
111
|
-
"@traceloop/instrumentation-qdrant": "^0.11.
|
|
112
|
-
"@traceloop/instrumentation-vertexai": "^0.11.
|
|
102
|
+
"@traceloop/ai-semantic-conventions": "^0.11.6",
|
|
103
|
+
"@traceloop/instrumentation-anthropic": "^0.11.6",
|
|
104
|
+
"@traceloop/instrumentation-azure": "^0.11.6",
|
|
105
|
+
"@traceloop/instrumentation-bedrock": "^0.11.6",
|
|
106
|
+
"@traceloop/instrumentation-chromadb": "^0.11.6",
|
|
107
|
+
"@traceloop/instrumentation-cohere": "^0.11.6",
|
|
108
|
+
"@traceloop/instrumentation-langchain": "^0.11.6",
|
|
109
|
+
"@traceloop/instrumentation-llamaindex": "^0.11.6",
|
|
110
|
+
"@traceloop/instrumentation-openai": "^0.11.6",
|
|
111
|
+
"@traceloop/instrumentation-pinecone": "^0.11.6",
|
|
112
|
+
"@traceloop/instrumentation-qdrant": "^0.11.6",
|
|
113
|
+
"@traceloop/instrumentation-vertexai": "^0.11.6",
|
|
113
114
|
argparse: "^2.0.1",
|
|
114
115
|
"cli-progress": "^3.12.0",
|
|
115
|
-
esbuild: "^0.24.
|
|
116
|
+
esbuild: "^0.24.2",
|
|
116
117
|
glob: "^11.0.0",
|
|
117
118
|
uuid: "^11.0.3"
|
|
118
119
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/cli.ts"],"sourcesContent":["{\n \"name\": \"@lmnr-ai/lmnr\",\n \"version\": \"0.4.28\",\n \"description\": \"TypeScript SDK for Laminar AI\",\n \"main\": \"dist/index.js\",\n \"types\": \"dist/index.d.ts\",\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/cli.ts --format esm,cjs --dts\",\n \"test\": \"tsx --test test/*.test.ts\"\n },\n \"bin\": {\n \"lmnr\": \"./dist/cli.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/lmnr-ai/lmnr-ts.git\"\n },\n \"keywords\": [\n \"laminar\",\n \"lmnr\",\n \"sdk\",\n \"lmnr.ai\"\n ],\n \"author\": \"founders@lmnr.ai\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/lmnr-ai/lmnr-ts/issues\"\n },\n \"homepage\": \"https://github.com/lmnr-ai/lmnr-ts#README\",\n \"devDependencies\": {\n \"@anthropic-ai/sdk\": \"^0.27.3\",\n \"@aws-sdk/client-bedrock-runtime\": \"^3.705.0\",\n \"@azure/openai\": \"1.0.0-beta.13\",\n \"@google-cloud/aiplatform\": \"^3.34.0\",\n \"@google-cloud/vertexai\": \"^1.9.0\",\n \"@langchain/core\": \"^0.3.20\",\n \"@pinecone-database/pinecone\": \"^3.0.3\",\n \"@qdrant/js-client-rest\": \"^1.12.0\",\n \"@types/argparse\": \"^2.0.17\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"^22.10.1\",\n \"@types/semver\": \"^7.5.8\",\n \"@types/uuid\": \"^10.0.0\",\n \"bufferutil\": \"^4.0.8\",\n \"chromadb\": \"^1.9.4\",\n \"cohere-ai\": \"^7.15.0\",\n \"langchain\": \"^0.3.6\",\n \"llamaindex\": \"^0.7.10\",\n \"openai\": \"^4.75.0\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.7.2\"\n },\n \"dependencies\": {\n \"@grpc/grpc-js\": \"^1.12.3\",\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^1.28.0\",\n \"@opentelemetry/exporter-trace-otlp-grpc\": \"^0.53.0\",\n \"@opentelemetry/exporter-trace-otlp-proto\": \"^0.53.0\",\n \"@opentelemetry/instrumentation\": \"^0.53.0\",\n \"@opentelemetry/sdk-node\": \"^0.53.0\",\n \"@opentelemetry/sdk-trace-base\": \"^1.28.0\",\n \"@opentelemetry/sdk-trace-node\": \"^1.28.0\",\n \"@opentelemetry/semantic-conventions\": \"^1.28.0\",\n \"@traceloop/ai-semantic-conventions\": \"^0.11.0\",\n \"@traceloop/instrumentation-anthropic\": \"^0.11.1\",\n \"@traceloop/instrumentation-azure\": \"^0.11.1\",\n \"@traceloop/instrumentation-bedrock\": \"^0.11.1\",\n \"@traceloop/instrumentation-chromadb\": \"^0.11.3\",\n \"@traceloop/instrumentation-cohere\": \"^0.11.1\",\n \"@traceloop/instrumentation-langchain\": \"^0.11.4\",\n \"@traceloop/instrumentation-llamaindex\": \"^0.11.1\",\n \"@traceloop/instrumentation-openai\": \"^0.11.3\",\n \"@traceloop/instrumentation-pinecone\": \"^0.11.1\",\n \"@traceloop/instrumentation-qdrant\": \"^0.11.1\",\n \"@traceloop/instrumentation-vertexai\": \"^0.11.4\",\n \"argparse\": \"^2.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"esbuild\": \"^0.24.0\",\n \"glob\": \"^11.0.0\",\n \"uuid\": \"^11.0.3\"\n }\n}\n","#!/usr/bin/env node\n\nimport { ArgumentParser } from \"argparse\";\nimport * as esbuild from \"esbuild\";\nimport * as glob from \"glob\";\n\nconst pjson = require('../package.json');\n\nexport function loadModule({\n filename,\n moduleText,\n}: {\n filename: string;\n moduleText: string;\n}) {\n // TODO: Figure out how to remove all ts-ignores\n // TODO: Cleanup by setting the original values of _evaluation and _set_global_evaluation back\n // @ts-ignore\n globalThis._evaluation = undefined; // @ts-ignore\n globalThis._set_global_evaluation = true; // @ts-ignore\n\n // it needs \"require\" to be passed in\n new Function(\"require\", moduleText)(require);\n\n // Return the modified _evals global variable\n // @ts-ignore\n return globalThis._evaluation;\n}\n\nasync function cli() {\n const [, , ...args] = process.argv;\n\n // Use argparse, which is the port of the python library\n const parser = new ArgumentParser({\n prog: \"lmnr\",\n description: \"CLI for Laminar. Use `lmnr <subcommand> --help` for more information.\",\n });\n\n parser.add_argument(\"-v\", \"--version\", { action: \"version\", version: pjson.version });\n\n const subparsers = parser.add_subparsers({\n title: \"subcommands\",\n dest: \"subcommand\",\n });\n\n const parserEval = subparsers.add_parser(\"eval\", {\n description: \"Run an evaluation\",\n help: \"Run an evaluation\",\n });\n\n parserEval.add_argument(\"file\", {\n help: \"A file containing the evaluation to run. If no file is provided, \" +\n \"the evaluation will run all `*.eval.ts|js` files in the `evals` directory.\",\n nargs: \"?\",\n });\n\n parserEval.add_argument(\"--fail-on-error\", {\n help: \"Fail on error. If specified, will fail if encounters a file that cannot be run\",\n action: \"store_true\",\n });\n\n parserEval.set_defaults({\n func: async (args: any) => {\n const files = args.file\n ? [args.file]\n : glob.sync('evals/**/*.eval.{ts,js}')\n\n files.sort();\n\n if (files.length === 0) {\n console.error(\"No evaluation files found. Please provide a file or \" +\n \"ensure there are files in the `evals` directory.\");\n process.exit(1);\n }\n\n if (!args.file) {\n console.log(`Located ${files.length} evaluation files in evals/`);\n }\n\n for (const file of files) {\n console.log(`Loading ${file}...`);\n // TODO: Add various optimizations, e.g. minify, pure, tree shaking, etc.\n const buildOptions = {\n entryPoints: [file],\n outfile: `tmp_out_${file}.js`,\n write: false, // will be loaded in memory as a temp file\n platform: \"node\" as esbuild.Platform,\n bundle: true,\n external: [\"node_modules/*\"],\n };\n\n const result = await esbuild.build(buildOptions);\n\n if (!result.outputFiles) {\n console.error(\"Error when building: No output files found\");\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n const outputFileText = result.outputFiles[0].text;\n\n const evaluation = loadModule({\n filename: args.file,\n moduleText: outputFileText,\n });\n\n // @ts-ignore\n if (!evaluation?.run) {\n console.error(`Evaluation ${file} does not properly call evaluate()`);\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n // @ts-ignore\n await evaluation.run();\n }\n }\n });\n\n parser.set_defaults({\n func: async (args: any) => {\n parser.print_help();\n process.exit(0);\n }\n });\n\n const parsed = parser.parse_args(args);\n await parsed.func(parsed);\n}\n\ncli();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,iBAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,SAAW;AAAA,QACT,OAAS;AAAA,QACT,MAAQ;AAAA,MACV;AAAA,MACA,KAAO;AAAA,QACL,MAAQ;AAAA,MACV;AAAA,MACA,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,QAAU;AAAA,MACV,SAAW;AAAA,MACX,MAAQ;AAAA,QACN,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,MACZ,iBAAmB;AAAA,QACjB,qBAAqB;AAAA,QACrB,mCAAmC;AAAA,QACnC,iBAAiB;AAAA,QACjB,4BAA4B;AAAA,QAC5B,0BAA0B;AAAA,QAC1B,mBAAmB;AAAA,QACnB,+BAA+B;AAAA,QAC/B,0BAA0B;AAAA,QAC1B,mBAAmB;AAAA,QACnB,uBAAuB;AAAA,QACvB,eAAe;AAAA,QACf,iBAAiB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AC;AAGD,YAAI,CAAC,YAAY,KAAK;AACpB,kBAAQ,MAAM,cAAc,IAAI,oCAAoC;AACpE,cAAIA,MAAK,eAAe;AACtB,oBAAQ,KAAK,CAAC;AAAA,UAChB;AACA;AAAA,QACF;AAGA,cAAM,WAAW,IAAI;AAAA,MACvB;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO,aAAa;AAAA,IAClB,MAAM,OAAOA,UAAc;AACzB,aAAO,WAAW;AAClB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAED,QAAM,SAAS,OAAO,WAAW,IAAI;AACrC,QAAM,OAAO,KAAK,MAAM;AAC1B;AAEA,IAAI;","names":["exports","module","args"]}
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/cli.ts"],"sourcesContent":["{\n \"name\": \"@lmnr-ai/lmnr\",\n \"version\": \"0.4.30\",\n \"description\": \"TypeScript SDK for Laminar AI\",\n \"main\": \"dist/index.js\",\n \"types\": \"dist/index.d.ts\",\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/cli.ts --format esm,cjs --dts\",\n \"test\": \"tsx --test test/*.test.ts\"\n },\n \"bin\": {\n \"lmnr\": \"./dist/cli.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/lmnr-ai/lmnr-ts.git\"\n },\n \"keywords\": [\n \"laminar\",\n \"lmnr\",\n \"sdk\",\n \"lmnr.ai\"\n ],\n \"author\": \"founders@lmnr.ai\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/lmnr-ai/lmnr-ts/issues\"\n },\n \"homepage\": \"https://github.com/lmnr-ai/lmnr-ts#README\",\n \"devDependencies\": {\n \"@anthropic-ai/sdk\": \"^0.33.1\",\n \"@aws-sdk/client-bedrock-runtime\": \"^3.716.0\",\n \"@azure/openai\": \"^2.0.0\",\n \"@google-cloud/aiplatform\": \"^3.34.0\",\n \"@google-cloud/vertexai\": \"^1.9.2\",\n \"@langchain/core\": \"^0.3.26\",\n \"@pinecone-database/pinecone\": \"^4.0.0\",\n \"@qdrant/js-client-rest\": \"^1.12.0\",\n \"@types/argparse\": \"^2.0.17\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"^22.10.2\",\n \"@types/semver\": \"^7.5.8\",\n \"@types/uuid\": \"^10.0.0\",\n \"bufferutil\": \"^4.0.8\",\n \"chromadb\": \"^1.9.4\",\n \"cohere-ai\": \"^7.15.0\",\n \"langchain\": \"^0.3.8\",\n \"llamaindex\": \"^0.8.30\",\n \"openai\": \"^4.77.0\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.7.2\"\n },\n \"dependencies\": {\n \"@grpc/grpc-js\": \"^1.12.5\",\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^1.30.0\",\n \"@opentelemetry/exporter-trace-otlp-grpc\": \"^0.57.0\",\n \"@opentelemetry/exporter-trace-otlp-proto\": \"^0.57.0\",\n \"@opentelemetry/otlp-exporter-base\": \"^0.57.0\",\n \"@opentelemetry/instrumentation\": \"^0.57.0\",\n \"@opentelemetry/sdk-node\": \"^0.57.0\",\n \"@opentelemetry/sdk-trace-base\": \"^1.30.0\",\n \"@opentelemetry/sdk-trace-node\": \"^1.30.0\",\n \"@opentelemetry/semantic-conventions\": \"^1.28.0\",\n \"@traceloop/ai-semantic-conventions\": \"^0.11.6\",\n \"@traceloop/instrumentation-anthropic\": \"^0.11.6\",\n \"@traceloop/instrumentation-azure\": \"^0.11.6\",\n \"@traceloop/instrumentation-bedrock\": \"^0.11.6\",\n \"@traceloop/instrumentation-chromadb\": \"^0.11.6\",\n \"@traceloop/instrumentation-cohere\": \"^0.11.6\",\n \"@traceloop/instrumentation-langchain\": \"^0.11.6\",\n \"@traceloop/instrumentation-llamaindex\": \"^0.11.6\",\n \"@traceloop/instrumentation-openai\": \"^0.11.6\",\n \"@traceloop/instrumentation-pinecone\": \"^0.11.6\",\n \"@traceloop/instrumentation-qdrant\": \"^0.11.6\",\n \"@traceloop/instrumentation-vertexai\": \"^0.11.6\",\n \"argparse\": \"^2.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"esbuild\": \"^0.24.2\",\n \"glob\": \"^11.0.0\",\n \"uuid\": \"^11.0.3\"\n }\n}\n","#!/usr/bin/env node\n\nimport { ArgumentParser } from \"argparse\";\nimport * as esbuild from \"esbuild\";\nimport * as glob from \"glob\";\n\nconst pjson = require('../package.json');\n\nexport function loadModule({\n filename,\n moduleText,\n}: {\n filename: string;\n moduleText: string;\n}) {\n // TODO: Figure out how to remove all ts-ignores\n // TODO: Cleanup by setting the original values of _evaluation and _set_global_evaluation back\n // @ts-ignore\n globalThis._evaluation = undefined; // @ts-ignore\n globalThis._set_global_evaluation = true; // @ts-ignore\n\n // it needs \"require\" to be passed in\n new Function(\"require\", moduleText)(require);\n\n // Return the modified _evals global variable\n // @ts-ignore\n return globalThis._evaluation;\n}\n\nasync function cli() {\n const [, , ...args] = process.argv;\n\n // Use argparse, which is the port of the python library\n const parser = new ArgumentParser({\n prog: \"lmnr\",\n description: \"CLI for Laminar. Use `lmnr <subcommand> --help` for more information.\",\n });\n\n parser.add_argument(\"-v\", \"--version\", { action: \"version\", version: pjson.version });\n\n const subparsers = parser.add_subparsers({\n title: \"subcommands\",\n dest: \"subcommand\",\n });\n\n const parserEval = subparsers.add_parser(\"eval\", {\n description: \"Run an evaluation\",\n help: \"Run an evaluation\",\n });\n\n parserEval.add_argument(\"file\", {\n help: \"A file containing the evaluation to run. If no file is provided, \" +\n \"the evaluation will run all `*.eval.ts|js` files in the `evals` directory.\",\n nargs: \"?\",\n });\n\n parserEval.add_argument(\"--fail-on-error\", {\n help: \"Fail on error. If specified, will fail if encounters a file that cannot be run\",\n action: \"store_true\",\n });\n\n parserEval.set_defaults({\n func: async (args: any) => {\n const files = args.file\n ? [args.file]\n : glob.sync('evals/**/*.eval.{ts,js}')\n\n files.sort();\n\n if (files.length === 0) {\n console.error(\"No evaluation files found. Please provide a file or \" +\n \"ensure there are files in the `evals` directory.\");\n process.exit(1);\n }\n\n if (!args.file) {\n console.log(`Located ${files.length} evaluation files in evals/`);\n }\n\n for (const file of files) {\n console.log(`Loading ${file}...`);\n // TODO: Add various optimizations, e.g. minify, pure, tree shaking, etc.\n const buildOptions = {\n entryPoints: [file],\n outfile: `tmp_out_${file}.js`,\n write: false, // will be loaded in memory as a temp file\n platform: \"node\" as esbuild.Platform,\n bundle: true,\n external: [\"node_modules/*\"],\n };\n\n const result = await esbuild.build(buildOptions);\n\n if (!result.outputFiles) {\n console.error(\"Error when building: No output files found\");\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n const outputFileText = result.outputFiles[0].text;\n\n const evaluation = loadModule({\n filename: args.file,\n moduleText: outputFileText,\n });\n\n // @ts-ignore\n if (!evaluation?.run) {\n console.error(`Evaluation ${file} does not properly call evaluate()`);\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n // @ts-ignore\n await evaluation.run();\n }\n }\n });\n\n parser.set_defaults({\n func: async (args: any) => {\n parser.print_help();\n process.exit(0);\n }\n });\n\n const parsed = parser.parse_args(args);\n await parsed.func(parsed);\n}\n\ncli();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,iBAAAA,UAAAC,SAAA;AAAA,IAAAA,QAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,SAAW;AAAA,QACT,OAAS;AAAA,QACT,MAAQ;AAAA,MACV;AAAA,MACA,KAAO;AAAA,QACL,MAAQ;AAAA,MACV;AAAA,MACA,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,QAAU;AAAA,MACV,SAAW;AAAA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AA,UACR,UAAU,CAAC,gBAAgB;AAAA,QAC7B;AAEA,cAAM,SAAS,MAAc,cAAM,YAAY;AAE/C,YAAI,CAAC,OAAO,aAAa;AACvB,kBAAQ,MAAM,4CAA4C;AAC1D,cAAIA,MAAK,eAAe;AACtB,oBAAQ,KAAK,CAAC;AAAA,UAChB;AACA;AAAA,QACF;AAEA,cAAM,iBAAiB,OAAO,YAAY,CAAC,EAAE;AAE7C,cAAM,aAAa,WAAW;AAAA,UAC5B,UAAUA,MAAK;AAAA,UACf,YAAY;AAAA,QACd,CAAC;AAGD,YAAI,CAAC,YAAY,KAAK;AACpB,kBAAQ,MAAM,cAAc,IAAI,oCAAoC;AACpE,cAAIA,MAAK,eAAe;AACtB,oBAAQ,KAAK,CAAC;AAAA,UAChB;AACA;AAAA,QACF;AAGA,cAAM,WAAW,IAAI;AAAA,MACvB;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO,aAAa;AAAA,IAClB,MAAM,OAAOA,UAAc;AACzB,aAAO,WAAW;AAClB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAED,QAAM,SAAS,OAAO,WAAW,IAAI;AACrC,QAAM,OAAO,KAAK,MAAM;AAC1B;AAEA,IAAI;","names":["exports","module","args"]}
|
package/dist/cli.mjs
CHANGED
|
@@ -15,7 +15,7 @@ var require_package = __commonJS({
|
|
|
15
15
|
"package.json"(exports, module) {
|
|
16
16
|
module.exports = {
|
|
17
17
|
name: "@lmnr-ai/lmnr",
|
|
18
|
-
version: "0.4.
|
|
18
|
+
version: "0.4.30",
|
|
19
19
|
description: "TypeScript SDK for Laminar AI",
|
|
20
20
|
main: "dist/index.js",
|
|
21
21
|
types: "dist/index.d.ts",
|
|
@@ -43,55 +43,56 @@ var require_package = __commonJS({
|
|
|
43
43
|
},
|
|
44
44
|
homepage: "https://github.com/lmnr-ai/lmnr-ts#README",
|
|
45
45
|
devDependencies: {
|
|
46
|
-
"@anthropic-ai/sdk": "^0.
|
|
47
|
-
"@aws-sdk/client-bedrock-runtime": "^3.
|
|
48
|
-
"@azure/openai": "
|
|
46
|
+
"@anthropic-ai/sdk": "^0.33.1",
|
|
47
|
+
"@aws-sdk/client-bedrock-runtime": "^3.716.0",
|
|
48
|
+
"@azure/openai": "^2.0.0",
|
|
49
49
|
"@google-cloud/aiplatform": "^3.34.0",
|
|
50
|
-
"@google-cloud/vertexai": "^1.9.
|
|
51
|
-
"@langchain/core": "^0.3.
|
|
52
|
-
"@pinecone-database/pinecone": "^
|
|
50
|
+
"@google-cloud/vertexai": "^1.9.2",
|
|
51
|
+
"@langchain/core": "^0.3.26",
|
|
52
|
+
"@pinecone-database/pinecone": "^4.0.0",
|
|
53
53
|
"@qdrant/js-client-rest": "^1.12.0",
|
|
54
54
|
"@types/argparse": "^2.0.17",
|
|
55
55
|
"@types/cli-progress": "^3.11.6",
|
|
56
|
-
"@types/node": "^22.10.
|
|
56
|
+
"@types/node": "^22.10.2",
|
|
57
57
|
"@types/semver": "^7.5.8",
|
|
58
58
|
"@types/uuid": "^10.0.0",
|
|
59
59
|
bufferutil: "^4.0.8",
|
|
60
60
|
chromadb: "^1.9.4",
|
|
61
61
|
"cohere-ai": "^7.15.0",
|
|
62
|
-
langchain: "^0.3.
|
|
63
|
-
llamaindex: "^0.
|
|
64
|
-
openai: "^4.
|
|
62
|
+
langchain: "^0.3.8",
|
|
63
|
+
llamaindex: "^0.8.30",
|
|
64
|
+
openai: "^4.77.0",
|
|
65
65
|
tsup: "^8.3.5",
|
|
66
66
|
tsx: "^4.19.2",
|
|
67
67
|
typescript: "^5.7.2"
|
|
68
68
|
},
|
|
69
69
|
dependencies: {
|
|
70
|
-
"@grpc/grpc-js": "^1.12.
|
|
70
|
+
"@grpc/grpc-js": "^1.12.5",
|
|
71
71
|
"@opentelemetry/api": "^1.9.0",
|
|
72
|
-
"@opentelemetry/core": "^1.
|
|
73
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
74
|
-
"@opentelemetry/exporter-trace-otlp-proto": "^0.
|
|
75
|
-
"@opentelemetry/
|
|
76
|
-
"@opentelemetry/
|
|
77
|
-
"@opentelemetry/sdk-
|
|
78
|
-
"@opentelemetry/sdk-trace-
|
|
72
|
+
"@opentelemetry/core": "^1.30.0",
|
|
73
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.57.0",
|
|
74
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.57.0",
|
|
75
|
+
"@opentelemetry/otlp-exporter-base": "^0.57.0",
|
|
76
|
+
"@opentelemetry/instrumentation": "^0.57.0",
|
|
77
|
+
"@opentelemetry/sdk-node": "^0.57.0",
|
|
78
|
+
"@opentelemetry/sdk-trace-base": "^1.30.0",
|
|
79
|
+
"@opentelemetry/sdk-trace-node": "^1.30.0",
|
|
79
80
|
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
80
|
-
"@traceloop/ai-semantic-conventions": "^0.11.
|
|
81
|
-
"@traceloop/instrumentation-anthropic": "^0.11.
|
|
82
|
-
"@traceloop/instrumentation-azure": "^0.11.
|
|
83
|
-
"@traceloop/instrumentation-bedrock": "^0.11.
|
|
84
|
-
"@traceloop/instrumentation-chromadb": "^0.11.
|
|
85
|
-
"@traceloop/instrumentation-cohere": "^0.11.
|
|
86
|
-
"@traceloop/instrumentation-langchain": "^0.11.
|
|
87
|
-
"@traceloop/instrumentation-llamaindex": "^0.11.
|
|
88
|
-
"@traceloop/instrumentation-openai": "^0.11.
|
|
89
|
-
"@traceloop/instrumentation-pinecone": "^0.11.
|
|
90
|
-
"@traceloop/instrumentation-qdrant": "^0.11.
|
|
91
|
-
"@traceloop/instrumentation-vertexai": "^0.11.
|
|
81
|
+
"@traceloop/ai-semantic-conventions": "^0.11.6",
|
|
82
|
+
"@traceloop/instrumentation-anthropic": "^0.11.6",
|
|
83
|
+
"@traceloop/instrumentation-azure": "^0.11.6",
|
|
84
|
+
"@traceloop/instrumentation-bedrock": "^0.11.6",
|
|
85
|
+
"@traceloop/instrumentation-chromadb": "^0.11.6",
|
|
86
|
+
"@traceloop/instrumentation-cohere": "^0.11.6",
|
|
87
|
+
"@traceloop/instrumentation-langchain": "^0.11.6",
|
|
88
|
+
"@traceloop/instrumentation-llamaindex": "^0.11.6",
|
|
89
|
+
"@traceloop/instrumentation-openai": "^0.11.6",
|
|
90
|
+
"@traceloop/instrumentation-pinecone": "^0.11.6",
|
|
91
|
+
"@traceloop/instrumentation-qdrant": "^0.11.6",
|
|
92
|
+
"@traceloop/instrumentation-vertexai": "^0.11.6",
|
|
92
93
|
argparse: "^2.0.1",
|
|
93
94
|
"cli-progress": "^3.12.0",
|
|
94
|
-
esbuild: "^0.24.
|
|
95
|
+
esbuild: "^0.24.2",
|
|
95
96
|
glob: "^11.0.0",
|
|
96
97
|
uuid: "^11.0.3"
|
|
97
98
|
}
|
package/dist/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/cli.ts"],"sourcesContent":["{\n \"name\": \"@lmnr-ai/lmnr\",\n \"version\": \"0.4.28\",\n \"description\": \"TypeScript SDK for Laminar AI\",\n \"main\": \"dist/index.js\",\n \"types\": \"dist/index.d.ts\",\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/cli.ts --format esm,cjs --dts\",\n \"test\": \"tsx --test test/*.test.ts\"\n },\n \"bin\": {\n \"lmnr\": \"./dist/cli.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/lmnr-ai/lmnr-ts.git\"\n },\n \"keywords\": [\n \"laminar\",\n \"lmnr\",\n \"sdk\",\n \"lmnr.ai\"\n ],\n \"author\": \"founders@lmnr.ai\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/lmnr-ai/lmnr-ts/issues\"\n },\n \"homepage\": \"https://github.com/lmnr-ai/lmnr-ts#README\",\n \"devDependencies\": {\n \"@anthropic-ai/sdk\": \"^0.27.3\",\n \"@aws-sdk/client-bedrock-runtime\": \"^3.705.0\",\n \"@azure/openai\": \"1.0.0-beta.13\",\n \"@google-cloud/aiplatform\": \"^3.34.0\",\n \"@google-cloud/vertexai\": \"^1.9.0\",\n \"@langchain/core\": \"^0.3.20\",\n \"@pinecone-database/pinecone\": \"^3.0.3\",\n \"@qdrant/js-client-rest\": \"^1.12.0\",\n \"@types/argparse\": \"^2.0.17\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"^22.10.1\",\n \"@types/semver\": \"^7.5.8\",\n \"@types/uuid\": \"^10.0.0\",\n \"bufferutil\": \"^4.0.8\",\n \"chromadb\": \"^1.9.4\",\n \"cohere-ai\": \"^7.15.0\",\n \"langchain\": \"^0.3.6\",\n \"llamaindex\": \"^0.7.10\",\n \"openai\": \"^4.75.0\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.7.2\"\n },\n \"dependencies\": {\n \"@grpc/grpc-js\": \"^1.12.3\",\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^1.28.0\",\n \"@opentelemetry/exporter-trace-otlp-grpc\": \"^0.53.0\",\n \"@opentelemetry/exporter-trace-otlp-proto\": \"^0.53.0\",\n \"@opentelemetry/instrumentation\": \"^0.53.0\",\n \"@opentelemetry/sdk-node\": \"^0.53.0\",\n \"@opentelemetry/sdk-trace-base\": \"^1.28.0\",\n \"@opentelemetry/sdk-trace-node\": \"^1.28.0\",\n \"@opentelemetry/semantic-conventions\": \"^1.28.0\",\n \"@traceloop/ai-semantic-conventions\": \"^0.11.0\",\n \"@traceloop/instrumentation-anthropic\": \"^0.11.1\",\n \"@traceloop/instrumentation-azure\": \"^0.11.1\",\n \"@traceloop/instrumentation-bedrock\": \"^0.11.1\",\n \"@traceloop/instrumentation-chromadb\": \"^0.11.3\",\n \"@traceloop/instrumentation-cohere\": \"^0.11.1\",\n \"@traceloop/instrumentation-langchain\": \"^0.11.4\",\n \"@traceloop/instrumentation-llamaindex\": \"^0.11.1\",\n \"@traceloop/instrumentation-openai\": \"^0.11.3\",\n \"@traceloop/instrumentation-pinecone\": \"^0.11.1\",\n \"@traceloop/instrumentation-qdrant\": \"^0.11.1\",\n \"@traceloop/instrumentation-vertexai\": \"^0.11.4\",\n \"argparse\": \"^2.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"esbuild\": \"^0.24.0\",\n \"glob\": \"^11.0.0\",\n \"uuid\": \"^11.0.3\"\n }\n}\n","#!/usr/bin/env node\n\nimport { ArgumentParser } from \"argparse\";\nimport * as esbuild from \"esbuild\";\nimport * as glob from \"glob\";\n\nconst pjson = require('../package.json');\n\nexport function loadModule({\n filename,\n moduleText,\n}: {\n filename: string;\n moduleText: string;\n}) {\n // TODO: Figure out how to remove all ts-ignores\n // TODO: Cleanup by setting the original values of _evaluation and _set_global_evaluation back\n // @ts-ignore\n globalThis._evaluation = undefined; // @ts-ignore\n globalThis._set_global_evaluation = true; // @ts-ignore\n\n // it needs \"require\" to be passed in\n new Function(\"require\", moduleText)(require);\n\n // Return the modified _evals global variable\n // @ts-ignore\n return globalThis._evaluation;\n}\n\nasync function cli() {\n const [, , ...args] = process.argv;\n\n // Use argparse, which is the port of the python library\n const parser = new ArgumentParser({\n prog: \"lmnr\",\n description: \"CLI for Laminar. Use `lmnr <subcommand> --help` for more information.\",\n });\n\n parser.add_argument(\"-v\", \"--version\", { action: \"version\", version: pjson.version });\n\n const subparsers = parser.add_subparsers({\n title: \"subcommands\",\n dest: \"subcommand\",\n });\n\n const parserEval = subparsers.add_parser(\"eval\", {\n description: \"Run an evaluation\",\n help: \"Run an evaluation\",\n });\n\n parserEval.add_argument(\"file\", {\n help: \"A file containing the evaluation to run. If no file is provided, \" +\n \"the evaluation will run all `*.eval.ts|js` files in the `evals` directory.\",\n nargs: \"?\",\n });\n\n parserEval.add_argument(\"--fail-on-error\", {\n help: \"Fail on error. If specified, will fail if encounters a file that cannot be run\",\n action: \"store_true\",\n });\n\n parserEval.set_defaults({\n func: async (args: any) => {\n const files = args.file\n ? [args.file]\n : glob.sync('evals/**/*.eval.{ts,js}')\n\n files.sort();\n\n if (files.length === 0) {\n console.error(\"No evaluation files found. Please provide a file or \" +\n \"ensure there are files in the `evals` directory.\");\n process.exit(1);\n }\n\n if (!args.file) {\n console.log(`Located ${files.length} evaluation files in evals/`);\n }\n\n for (const file of files) {\n console.log(`Loading ${file}...`);\n // TODO: Add various optimizations, e.g. minify, pure, tree shaking, etc.\n const buildOptions = {\n entryPoints: [file],\n outfile: `tmp_out_${file}.js`,\n write: false, // will be loaded in memory as a temp file\n platform: \"node\" as esbuild.Platform,\n bundle: true,\n external: [\"node_modules/*\"],\n };\n\n const result = await esbuild.build(buildOptions);\n\n if (!result.outputFiles) {\n console.error(\"Error when building: No output files found\");\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n const outputFileText = result.outputFiles[0].text;\n\n const evaluation = loadModule({\n filename: args.file,\n moduleText: outputFileText,\n });\n\n // @ts-ignore\n if (!evaluation?.run) {\n console.error(`Evaluation ${file} does not properly call evaluate()`);\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n // @ts-ignore\n await evaluation.run();\n }\n }\n });\n\n parser.set_defaults({\n func: async (args: any) => {\n parser.print_help();\n process.exit(0);\n }\n });\n\n const parsed = parser.parse_args(args);\n await parsed.func(parsed);\n}\n\ncli();\n"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,SAAW;AAAA,QACT,OAAS;AAAA,QACT,MAAQ;AAAA,MACV;AAAA,MACA,KAAO;AAAA,QACL,MAAQ;AAAA,MACV;AAAA,MACA,YAAc;AAAA,QACZ,MAAQ;AAAA,QACR,KAAO;AAAA,MACT;AAAA,MACA,UAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,QAAU;AA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C,gBAAgB;AAAA,QAC7B;AAEA,cAAM,SAAS,MAAc,cAAM,YAAY;AAE/C,YAAI,CAAC,OAAO,aAAa;AACvB,kBAAQ,MAAM,4CAA4C;AAC1D,cAAIA,MAAK,eAAe;AACtB,oBAAQ,KAAK,CAAC;AAAA,UAChB;AACA;AAAA,QACF;AAEA,cAAM,iBAAiB,OAAO,YAAY,CAAC,EAAE;AAE7C,cAAM,aAAa,WAAW;AAAA,UAC5B,UAAUA,MAAK;AAAA,UACf,YAAY;AAAA,QACd,CAAC;AAGD,YAAI,CAAC,YAAY,KAAK;AACpB,kBAAQ,MAAM,cAAc,IAAI,oCAAoC;AACpE,cAAIA,MAAK,eAAe;AACtB,oBAAQ,KAAK,CAAC;AAAA,UAChB;AACA;AAAA,QACF;AAGA,cAAM,WAAW,IAAI;AAAA,MACvB;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO,aAAa;AAAA,IAClB,MAAM,OAAOA,UAAc;AACzB,aAAO,WAAW;AAClB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAED,QAAM,SAAS,OAAO,WAAW,IAAI;AACrC,QAAM,OAAO,KAAK,MAAM;AAC1B;AAEA,IAAI;","names":["args"]}
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/cli.ts"],"sourcesContent":["{\n \"name\": \"@lmnr-ai/lmnr\",\n \"version\": \"0.4.30\",\n \"description\": \"TypeScript SDK for Laminar AI\",\n \"main\": \"dist/index.js\",\n \"types\": \"dist/index.d.ts\",\n \"scripts\": {\n \"build\": \"tsup src/index.ts src/cli.ts --format esm,cjs --dts\",\n \"test\": \"tsx --test test/*.test.ts\"\n },\n \"bin\": {\n \"lmnr\": \"./dist/cli.js\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/lmnr-ai/lmnr-ts.git\"\n },\n \"keywords\": [\n \"laminar\",\n \"lmnr\",\n \"sdk\",\n \"lmnr.ai\"\n ],\n \"author\": \"founders@lmnr.ai\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/lmnr-ai/lmnr-ts/issues\"\n },\n \"homepage\": \"https://github.com/lmnr-ai/lmnr-ts#README\",\n \"devDependencies\": {\n \"@anthropic-ai/sdk\": \"^0.33.1\",\n \"@aws-sdk/client-bedrock-runtime\": \"^3.716.0\",\n \"@azure/openai\": \"^2.0.0\",\n \"@google-cloud/aiplatform\": \"^3.34.0\",\n \"@google-cloud/vertexai\": \"^1.9.2\",\n \"@langchain/core\": \"^0.3.26\",\n \"@pinecone-database/pinecone\": \"^4.0.0\",\n \"@qdrant/js-client-rest\": \"^1.12.0\",\n \"@types/argparse\": \"^2.0.17\",\n \"@types/cli-progress\": \"^3.11.6\",\n \"@types/node\": \"^22.10.2\",\n \"@types/semver\": \"^7.5.8\",\n \"@types/uuid\": \"^10.0.0\",\n \"bufferutil\": \"^4.0.8\",\n \"chromadb\": \"^1.9.4\",\n \"cohere-ai\": \"^7.15.0\",\n \"langchain\": \"^0.3.8\",\n \"llamaindex\": \"^0.8.30\",\n \"openai\": \"^4.77.0\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.7.2\"\n },\n \"dependencies\": {\n \"@grpc/grpc-js\": \"^1.12.5\",\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/core\": \"^1.30.0\",\n \"@opentelemetry/exporter-trace-otlp-grpc\": \"^0.57.0\",\n \"@opentelemetry/exporter-trace-otlp-proto\": \"^0.57.0\",\n \"@opentelemetry/otlp-exporter-base\": \"^0.57.0\",\n \"@opentelemetry/instrumentation\": \"^0.57.0\",\n \"@opentelemetry/sdk-node\": \"^0.57.0\",\n \"@opentelemetry/sdk-trace-base\": \"^1.30.0\",\n \"@opentelemetry/sdk-trace-node\": \"^1.30.0\",\n \"@opentelemetry/semantic-conventions\": \"^1.28.0\",\n \"@traceloop/ai-semantic-conventions\": \"^0.11.6\",\n \"@traceloop/instrumentation-anthropic\": \"^0.11.6\",\n \"@traceloop/instrumentation-azure\": \"^0.11.6\",\n \"@traceloop/instrumentation-bedrock\": \"^0.11.6\",\n \"@traceloop/instrumentation-chromadb\": \"^0.11.6\",\n \"@traceloop/instrumentation-cohere\": \"^0.11.6\",\n \"@traceloop/instrumentation-langchain\": \"^0.11.6\",\n \"@traceloop/instrumentation-llamaindex\": \"^0.11.6\",\n \"@traceloop/instrumentation-openai\": \"^0.11.6\",\n \"@traceloop/instrumentation-pinecone\": \"^0.11.6\",\n \"@traceloop/instrumentation-qdrant\": \"^0.11.6\",\n \"@traceloop/instrumentation-vertexai\": \"^0.11.6\",\n \"argparse\": \"^2.0.1\",\n \"cli-progress\": \"^3.12.0\",\n \"esbuild\": \"^0.24.2\",\n \"glob\": \"^11.0.0\",\n \"uuid\": \"^11.0.3\"\n }\n}\n","#!/usr/bin/env node\n\nimport { ArgumentParser } from \"argparse\";\nimport * as esbuild from \"esbuild\";\nimport * as glob from \"glob\";\n\nconst pjson = require('../package.json');\n\nexport function loadModule({\n filename,\n moduleText,\n}: {\n filename: string;\n moduleText: string;\n}) {\n // TODO: Figure out how to remove all ts-ignores\n // TODO: Cleanup by setting the original values of _evaluation and _set_global_evaluation back\n // @ts-ignore\n globalThis._evaluation = undefined; // @ts-ignore\n globalThis._set_global_evaluation = true; // @ts-ignore\n\n // it needs \"require\" to be passed in\n new Function(\"require\", moduleText)(require);\n\n // Return the modified _evals global variable\n // @ts-ignore\n return globalThis._evaluation;\n}\n\nasync function cli() {\n const [, , ...args] = process.argv;\n\n // Use argparse, which is the port of the python library\n const parser = new ArgumentParser({\n prog: \"lmnr\",\n description: \"CLI for Laminar. Use `lmnr <subcommand> --help` for more information.\",\n });\n\n parser.add_argument(\"-v\", \"--version\", { action: \"version\", version: pjson.version });\n\n const subparsers = parser.add_subparsers({\n title: \"subcommands\",\n dest: \"subcommand\",\n });\n\n const parserEval = subparsers.add_parser(\"eval\", {\n description: \"Run an evaluation\",\n help: \"Run an evaluation\",\n });\n\n parserEval.add_argument(\"file\", {\n help: \"A file containing the evaluation to run. If no file is provided, \" +\n \"the evaluation will run all `*.eval.ts|js` files in the `evals` directory.\",\n nargs: \"?\",\n });\n\n parserEval.add_argument(\"--fail-on-error\", {\n help: \"Fail on error. If specified, will fail if encounters a file that cannot be run\",\n action: \"store_true\",\n });\n\n parserEval.set_defaults({\n func: async (args: any) => {\n const files = args.file\n ? [args.file]\n : glob.sync('evals/**/*.eval.{ts,js}')\n\n files.sort();\n\n if (files.length === 0) {\n console.error(\"No evaluation files found. Please provide a file or \" +\n \"ensure there are files in the `evals` directory.\");\n process.exit(1);\n }\n\n if (!args.file) {\n console.log(`Located ${files.length} evaluation files in evals/`);\n }\n\n for (const file of files) {\n console.log(`Loading ${file}...`);\n // TODO: Add various optimizations, e.g. minify, pure, tree shaking, etc.\n const buildOptions = {\n entryPoints: [file],\n outfile: `tmp_out_${file}.js`,\n write: false, // will be loaded in memory as a temp file\n platform: \"node\" as esbuild.Platform,\n bundle: true,\n external: [\"node_modules/*\"],\n };\n\n const result = await esbuild.build(buildOptions);\n\n if (!result.outputFiles) {\n console.error(\"Error when building: No output files found\");\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n const outputFileText = result.outputFiles[0].text;\n\n const evaluation = loadModule({\n filename: args.file,\n moduleText: outputFileText,\n });\n\n // @ts-ignore\n if (!evaluation?.run) {\n console.error(`Evaluation ${file} does not properly call evaluate()`);\n if (args.fail_on_error) {\n process.exit(1);\n }\n continue;\n }\n\n // @ts-ignore\n await evaluation.run();\n }\n }\n });\n\n parser.set_defaults({\n func: async (args: any) => {\n parser.print_help();\n process.exit(0);\n }\n });\n\n const parsed = parser.parse_args(args);\n await parsed.func(parsed);\n}\n\ncli();\n"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,SAAW;AAA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,WAAW,MAAM,MAAM,6BAA6B;AAAA,MAClE;AAEA,iBAAW,QAAQ,OAAO;AACxB,gBAAQ,IAAI,WAAW,IAAI,KAAK;AAEhC,cAAM,eAAe;AAAA,UACnB,aAAa,CAAC,IAAI;AAAA,UAClB,SAAS,WAAW,IAAI;AAAA,UACxB,OAAO;AAAA;AAAA,UACP,UAAU;AAAA,UACV,QAAQ;AAAA,UACR,UAAU,CAAC,gBAAgB;AAAA,QAC7B;AAEA,cAAM,SAAS,MAAc,cAAM,YAAY;AAE/C,YAAI,CAAC,OAAO,aAAa;AACvB,kBAAQ,MAAM,4CAA4C;AAC1D,cAAIA,MAAK,eAAe;AACtB,oBAAQ,KAAK,CAAC;AAAA,UAChB;AACA;AAAA,QACF;AAEA,cAAM,iBAAiB,OAAO,YAAY,CAAC,EAAE;AAE7C,cAAM,aAAa,WAAW;AAAA,UAC5B,UAAUA,MAAK;AAAA,UACf,YAAY;AAAA,QACd,CAAC;AAGD,YAAI,CAAC,YAAY,KAAK;AACpB,kBAAQ,MAAM,cAAc,IAAI,oCAAoC;AACpE,cAAIA,MAAK,eAAe;AACtB,oBAAQ,KAAK,CAAC;AAAA,UAChB;AACA;AAAA,QACF;AAGA,cAAM,WAAW,IAAI;AAAA,MACvB;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO,aAAa;AAAA,IAClB,MAAM,OAAOA,UAAc;AACzB,aAAO,WAAW;AAClB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AAED,QAAM,SAAS,OAAO,WAAW,IAAI;AACrC,QAAM,OAAO,KAAK,MAAM;AAC1B;AAEA,IAAI;","names":["args"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -175,6 +175,10 @@ interface EvaluatorConfig {
|
|
|
175
175
|
* See {@link https://docs.lmnr.ai/tracing/automatic-instrumentation}
|
|
176
176
|
*/
|
|
177
177
|
instrumentModules?: InitializeOptions['instrumentModules'];
|
|
178
|
+
/**
|
|
179
|
+
* If true, then the spans will not be batched.
|
|
180
|
+
*/
|
|
181
|
+
disableTraceBatch?: boolean;
|
|
178
182
|
}
|
|
179
183
|
/**
|
|
180
184
|
* Datapoint is a single data point in the evaluation. `D` is the type of the input data,
|
|
@@ -256,6 +260,7 @@ declare class Evaluation<D, T, O> {
|
|
|
256
260
|
private groupId?;
|
|
257
261
|
private name?;
|
|
258
262
|
private batchSize;
|
|
263
|
+
private disableTraceBatch;
|
|
259
264
|
constructor({ data, executor, evaluators, humanEvaluators, groupId, name, config }: EvaluationConstructorProps<D, T, O>);
|
|
260
265
|
run(): Promise<void>;
|
|
261
266
|
evaluateInBatches(): Promise<EvaluationDatapoint<D, T, O>[]>;
|
|
@@ -381,6 +386,7 @@ interface LaminarInitializeProps {
|
|
|
381
386
|
instrumentModules?: InitializeOptions["instrumentModules"];
|
|
382
387
|
useExternalTracerProvider?: boolean;
|
|
383
388
|
preserveNextJsSpans?: boolean;
|
|
389
|
+
disableBatch?: boolean;
|
|
384
390
|
}
|
|
385
391
|
declare class Laminar {
|
|
386
392
|
private static baseHttpUrl;
|
|
@@ -388,6 +394,7 @@ declare class Laminar {
|
|
|
388
394
|
private static projectApiKey;
|
|
389
395
|
private static env;
|
|
390
396
|
private static isInitialized;
|
|
397
|
+
private static disableBatch;
|
|
391
398
|
/**
|
|
392
399
|
* Initialize Laminar context across the application.
|
|
393
400
|
* This method must be called before using any other Laminar methods or decorators.
|
|
@@ -435,7 +442,7 @@ declare class Laminar {
|
|
|
435
442
|
*
|
|
436
443
|
* @throws {Error} - If project API key is not set
|
|
437
444
|
*/
|
|
438
|
-
static initialize({ projectApiKey, env, baseUrl, httpPort, grpcPort, instrumentModules, useExternalTracerProvider, preserveNextJsSpans, }: LaminarInitializeProps): void;
|
|
445
|
+
static initialize({ projectApiKey, env, baseUrl, httpPort, grpcPort, instrumentModules, useExternalTracerProvider, preserveNextJsSpans, disableBatch, }: LaminarInitializeProps): void;
|
|
439
446
|
/**
|
|
440
447
|
* Check if Laminar has been initialized. Utility to make sure other methods
|
|
441
448
|
* are called after initialization.
|
package/dist/index.d.ts
CHANGED
|
@@ -175,6 +175,10 @@ interface EvaluatorConfig {
|
|
|
175
175
|
* See {@link https://docs.lmnr.ai/tracing/automatic-instrumentation}
|
|
176
176
|
*/
|
|
177
177
|
instrumentModules?: InitializeOptions['instrumentModules'];
|
|
178
|
+
/**
|
|
179
|
+
* If true, then the spans will not be batched.
|
|
180
|
+
*/
|
|
181
|
+
disableTraceBatch?: boolean;
|
|
178
182
|
}
|
|
179
183
|
/**
|
|
180
184
|
* Datapoint is a single data point in the evaluation. `D` is the type of the input data,
|
|
@@ -256,6 +260,7 @@ declare class Evaluation<D, T, O> {
|
|
|
256
260
|
private groupId?;
|
|
257
261
|
private name?;
|
|
258
262
|
private batchSize;
|
|
263
|
+
private disableTraceBatch;
|
|
259
264
|
constructor({ data, executor, evaluators, humanEvaluators, groupId, name, config }: EvaluationConstructorProps<D, T, O>);
|
|
260
265
|
run(): Promise<void>;
|
|
261
266
|
evaluateInBatches(): Promise<EvaluationDatapoint<D, T, O>[]>;
|
|
@@ -381,6 +386,7 @@ interface LaminarInitializeProps {
|
|
|
381
386
|
instrumentModules?: InitializeOptions["instrumentModules"];
|
|
382
387
|
useExternalTracerProvider?: boolean;
|
|
383
388
|
preserveNextJsSpans?: boolean;
|
|
389
|
+
disableBatch?: boolean;
|
|
384
390
|
}
|
|
385
391
|
declare class Laminar {
|
|
386
392
|
private static baseHttpUrl;
|
|
@@ -388,6 +394,7 @@ declare class Laminar {
|
|
|
388
394
|
private static projectApiKey;
|
|
389
395
|
private static env;
|
|
390
396
|
private static isInitialized;
|
|
397
|
+
private static disableBatch;
|
|
391
398
|
/**
|
|
392
399
|
* Initialize Laminar context across the application.
|
|
393
400
|
* This method must be called before using any other Laminar methods or decorators.
|
|
@@ -435,7 +442,7 @@ declare class Laminar {
|
|
|
435
442
|
*
|
|
436
443
|
* @throws {Error} - If project API key is not set
|
|
437
444
|
*/
|
|
438
|
-
static initialize({ projectApiKey, env, baseUrl, httpPort, grpcPort, instrumentModules, useExternalTracerProvider, preserveNextJsSpans, }: LaminarInitializeProps): void;
|
|
445
|
+
static initialize({ projectApiKey, env, baseUrl, httpPort, grpcPort, instrumentModules, useExternalTracerProvider, preserveNextJsSpans, disableBatch, }: LaminarInitializeProps): void;
|
|
439
446
|
/**
|
|
440
447
|
* Check if Laminar has been initialized. Utility to make sure other methods
|
|
441
448
|
* are called after initialization.
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
Dataset: () => EvaluationDataset,
|
|
34
34
|
HumanEvaluator: () => HumanEvaluator,
|
|
35
35
|
Laminar: () => Laminar,
|
|
@@ -42,7 +42,7 @@ __export(src_exports, {
|
|
|
42
42
|
withLabels: () => withLabels,
|
|
43
43
|
withTracingLevel: () => withTracingLevel
|
|
44
44
|
});
|
|
45
|
-
module.exports = __toCommonJS(
|
|
45
|
+
module.exports = __toCommonJS(index_exports);
|
|
46
46
|
|
|
47
47
|
// src/types.ts
|
|
48
48
|
var TracingLevel = /* @__PURE__ */ ((TracingLevel2) => {
|
|
@@ -673,7 +673,8 @@ var Laminar = class {
|
|
|
673
673
|
grpcPort,
|
|
674
674
|
instrumentModules,
|
|
675
675
|
useExternalTracerProvider,
|
|
676
|
-
preserveNextJsSpans
|
|
676
|
+
preserveNextJsSpans,
|
|
677
|
+
disableBatch
|
|
677
678
|
}) {
|
|
678
679
|
let key = projectApiKey ?? process.env.LMNR_PROJECT_API_KEY;
|
|
679
680
|
if (key === void 0) {
|
|
@@ -701,7 +702,7 @@ var Laminar = class {
|
|
|
701
702
|
exporter,
|
|
702
703
|
silenceInitializationMessage: true,
|
|
703
704
|
instrumentModules,
|
|
704
|
-
disableBatch
|
|
705
|
+
disableBatch,
|
|
705
706
|
useExternalTracerProvider,
|
|
706
707
|
preserveNextJsSpans
|
|
707
708
|
});
|
|
@@ -1151,6 +1152,7 @@ var Laminar = class {
|
|
|
1151
1152
|
};
|
|
1152
1153
|
Laminar.env = {};
|
|
1153
1154
|
Laminar.isInitialized = false;
|
|
1155
|
+
Laminar.disableBatch = false;
|
|
1154
1156
|
|
|
1155
1157
|
// src/evaluations.ts
|
|
1156
1158
|
var import_cli_progress = __toESM(require("cli-progress"));
|
|
@@ -1352,6 +1354,7 @@ var Evaluation = class {
|
|
|
1352
1354
|
}) {
|
|
1353
1355
|
this.isFinished = false;
|
|
1354
1356
|
this.batchSize = DEFAULT_BATCH_SIZE;
|
|
1357
|
+
this.disableTraceBatch = false;
|
|
1355
1358
|
if (Object.keys(evaluators).length === 0) {
|
|
1356
1359
|
throw new Error("No evaluators provided");
|
|
1357
1360
|
}
|
|
@@ -1372,13 +1375,15 @@ var Evaluation = class {
|
|
|
1372
1375
|
this.name = name;
|
|
1373
1376
|
if (config) {
|
|
1374
1377
|
this.batchSize = config.batchSize ?? DEFAULT_BATCH_SIZE;
|
|
1378
|
+
this.disableTraceBatch = config.disableTraceBatch ?? false;
|
|
1375
1379
|
}
|
|
1376
1380
|
Laminar.initialize({
|
|
1377
1381
|
projectApiKey: config?.projectApiKey,
|
|
1378
1382
|
baseUrl: config?.baseUrl,
|
|
1379
1383
|
httpPort: config?.httpPort,
|
|
1380
1384
|
grpcPort: config?.grpcPort,
|
|
1381
|
-
instrumentModules: config?.instrumentModules
|
|
1385
|
+
instrumentModules: config?.instrumentModules,
|
|
1386
|
+
disableBatch: this.disableTraceBatch
|
|
1382
1387
|
});
|
|
1383
1388
|
}
|
|
1384
1389
|
async run() {
|