langwatch 0.1.0 → 0.1.3

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.
Files changed (46) hide show
  1. package/copy-types.sh +17 -0
  2. package/dist/chunk-2I4YLOQY.mjs +736 -0
  3. package/dist/chunk-2I4YLOQY.mjs.map +1 -0
  4. package/dist/index.d.mts +352 -4
  5. package/dist/index.d.ts +352 -4
  6. package/dist/index.js +6505 -413
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +571 -359
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/{utils-DDcm0z9v.d.mts → utils-CFtM8VVg.d.mts} +108 -31
  11. package/dist/{utils-DDcm0z9v.d.ts → utils-CFtM8VVg.d.ts} +108 -31
  12. package/dist/utils.d.mts +1 -2
  13. package/dist/utils.d.ts +1 -2
  14. package/dist/utils.js +437 -0
  15. package/dist/utils.js.map +1 -1
  16. package/dist/utils.mjs +3 -1
  17. package/example/README.md +3 -1
  18. package/example/app/(chat)/chat/[id]/page.tsx +1 -1
  19. package/example/app/(chat)/page.tsx +10 -5
  20. package/example/app/guardrails/page.tsx +26 -0
  21. package/example/app/langchain/page.tsx +27 -0
  22. package/example/app/langchain-rag/page.tsx +28 -0
  23. package/example/app/share/[id]/page.tsx +1 -1
  24. package/example/components/chat-list.tsx +1 -1
  25. package/example/components/chat-panel.tsx +1 -1
  26. package/example/components/header.tsx +39 -13
  27. package/example/components/prompt-form.tsx +1 -1
  28. package/example/components/stocks/stock-purchase.tsx +1 -1
  29. package/example/components/stocks/stocks.tsx +1 -1
  30. package/example/lib/chat/guardrails.tsx +181 -0
  31. package/example/lib/chat/langchain-rag.tsx +191 -0
  32. package/example/lib/chat/langchain.tsx +112 -0
  33. package/example/lib/chat/{actions.tsx → vercel-ai.tsx} +1 -1
  34. package/example/package-lock.json +289 -6
  35. package/example/package.json +1 -0
  36. package/package.json +13 -5
  37. package/src/evaluations.ts +219 -0
  38. package/src/index.test.ts +5 -0
  39. package/src/index.ts +190 -7
  40. package/src/langchain.ts +557 -0
  41. package/src/{helpers.ts → typeUtils.ts} +20 -2
  42. package/src/types.ts +7 -3
  43. package/src/utils.ts +25 -2
  44. package/ts-to-zod.config.js +2 -0
  45. package/dist/chunk-AP23NJ57.mjs +0 -296
  46. package/dist/chunk-AP23NJ57.mjs.map +0 -1
@@ -6,6 +6,7 @@
6
6
  "": {
7
7
  "dependencies": {
8
8
  "@ai-sdk/openai": "^0.0.9",
9
+ "@langchain/openai": "^0.1.3",
9
10
  "@radix-ui/react-alert-dialog": "^1.0.5",
10
11
  "@radix-ui/react-dialog": "^1.0.5",
11
12
  "@radix-ui/react-dropdown-menu": "^2.0.6",
@@ -69,11 +70,12 @@
69
70
  },
70
71
  "..": {
71
72
  "name": "langwatch",
72
- "version": "0.1.0",
73
+ "version": "0.1.2",
73
74
  "license": "Apache-2.0",
74
75
  "dependencies": {
76
+ "@langchain/core": "^0.2.7",
75
77
  "ai": "^3.1.23",
76
- "llm-cost": "^1.0.4",
78
+ "javascript-stringify": "^2.1.0",
77
79
  "nanoid": "^5.0.7",
78
80
  "openai": "^4.47.3",
79
81
  "zod": "^3.22.4",
@@ -86,8 +88,9 @@
86
88
  "@types/eslint__js": "^8.42.3",
87
89
  "@types/node": "^16.0.0",
88
90
  "dotenv": "^16.4.5",
91
+ "esbuild": "^0.21.5",
89
92
  "eslint": "^8.57.0",
90
- "ts-to-zod": "^3.4.1",
93
+ "ts-to-zod": "3.8.5",
91
94
  "tsup": "^8.1.0",
92
95
  "typescript": "^4.9.5",
93
96
  "typescript-eslint": "^7.11.0",
@@ -505,6 +508,90 @@
505
508
  "@jridgewell/sourcemap-codec": "^1.4.14"
506
509
  }
507
510
  },
511
+ "node_modules/@langchain/core": {
512
+ "version": "0.2.7",
513
+ "resolved": "https://registry.npmjs.org/@langchain/core/-/core-0.2.7.tgz",
514
+ "integrity": "sha512-FdFiNWhszFuUyAhYdY+l5DtPnAnWCAjXMnkLmUJ1J54NeUiUm7gy26Hnd4bkvaOQJ8ddHH/EX03ZwdoYfLv1jw==",
515
+ "dependencies": {
516
+ "ansi-styles": "^5.0.0",
517
+ "camelcase": "6",
518
+ "decamelize": "1.2.0",
519
+ "js-tiktoken": "^1.0.12",
520
+ "langsmith": "~0.1.30",
521
+ "ml-distance": "^4.0.0",
522
+ "mustache": "^4.2.0",
523
+ "p-queue": "^6.6.2",
524
+ "p-retry": "4",
525
+ "uuid": "^9.0.0",
526
+ "zod": "^3.22.4",
527
+ "zod-to-json-schema": "^3.22.3"
528
+ },
529
+ "engines": {
530
+ "node": ">=18"
531
+ }
532
+ },
533
+ "node_modules/@langchain/core/node_modules/ansi-styles": {
534
+ "version": "5.2.0",
535
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
536
+ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
537
+ "engines": {
538
+ "node": ">=10"
539
+ },
540
+ "funding": {
541
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
542
+ }
543
+ },
544
+ "node_modules/@langchain/core/node_modules/commander": {
545
+ "version": "10.0.1",
546
+ "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz",
547
+ "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==",
548
+ "engines": {
549
+ "node": ">=14"
550
+ }
551
+ },
552
+ "node_modules/@langchain/core/node_modules/langsmith": {
553
+ "version": "0.1.32",
554
+ "resolved": "https://registry.npmjs.org/langsmith/-/langsmith-0.1.32.tgz",
555
+ "integrity": "sha512-EUWHIH6fiOCGRYdzgwGoXwJxCMyUrL+bmUcxoVmkXoXoAGDOVinz8bqJLKbxotsQWqM64NKKsW85OTIutgNaMQ==",
556
+ "dependencies": {
557
+ "@types/uuid": "^9.0.1",
558
+ "commander": "^10.0.1",
559
+ "p-queue": "^6.6.2",
560
+ "p-retry": "4",
561
+ "uuid": "^9.0.0"
562
+ },
563
+ "peerDependencies": {
564
+ "@langchain/core": "*",
565
+ "langchain": "*",
566
+ "openai": "*"
567
+ },
568
+ "peerDependenciesMeta": {
569
+ "@langchain/core": {
570
+ "optional": true
571
+ },
572
+ "langchain": {
573
+ "optional": true
574
+ },
575
+ "openai": {
576
+ "optional": true
577
+ }
578
+ }
579
+ },
580
+ "node_modules/@langchain/openai": {
581
+ "version": "0.1.3",
582
+ "resolved": "https://registry.npmjs.org/@langchain/openai/-/openai-0.1.3.tgz",
583
+ "integrity": "sha512-riv/JC9x2A8b7GcHu8sx+mlZJ8KAwSSi231IPTlcciYnKozmrQ5H0vrtiD31fxiDbaRsk7tyCpkSBIOQEo7CyQ==",
584
+ "dependencies": {
585
+ "@langchain/core": ">=0.2.5 <0.3.0",
586
+ "js-tiktoken": "^1.0.12",
587
+ "openai": "^4.49.1",
588
+ "zod": "^3.22.4",
589
+ "zod-to-json-schema": "^3.22.3"
590
+ },
591
+ "engines": {
592
+ "node": ">=18"
593
+ }
594
+ },
508
595
  "node_modules/@next/env": {
509
596
  "version": "14.2.3",
510
597
  "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.3.tgz",
@@ -1681,11 +1768,21 @@
1681
1768
  "@types/react": "*"
1682
1769
  }
1683
1770
  },
1771
+ "node_modules/@types/retry": {
1772
+ "version": "0.12.0",
1773
+ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz",
1774
+ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="
1775
+ },
1684
1776
  "node_modules/@types/unist": {
1685
1777
  "version": "2.0.10",
1686
1778
  "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.10.tgz",
1687
1779
  "integrity": "sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA=="
1688
1780
  },
1781
+ "node_modules/@types/uuid": {
1782
+ "version": "9.0.8",
1783
+ "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.8.tgz",
1784
+ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
1785
+ },
1689
1786
  "node_modules/@typescript-eslint/parser": {
1690
1787
  "version": "6.21.0",
1691
1788
  "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz",
@@ -2478,6 +2575,11 @@
2478
2575
  "url": "https://github.com/sponsors/sindresorhus"
2479
2576
  }
2480
2577
  },
2578
+ "node_modules/binary-search": {
2579
+ "version": "1.3.6",
2580
+ "resolved": "https://registry.npmjs.org/binary-search/-/binary-search-1.3.6.tgz",
2581
+ "integrity": "sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA=="
2582
+ },
2481
2583
  "node_modules/brace-expansion": {
2482
2584
  "version": "2.0.1",
2483
2585
  "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
@@ -2570,6 +2672,17 @@
2570
2672
  "node": ">=6"
2571
2673
  }
2572
2674
  },
2675
+ "node_modules/camelcase": {
2676
+ "version": "6.3.0",
2677
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
2678
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
2679
+ "engines": {
2680
+ "node": ">=10"
2681
+ },
2682
+ "funding": {
2683
+ "url": "https://github.com/sponsors/sindresorhus"
2684
+ }
2685
+ },
2573
2686
  "node_modules/camelcase-css": {
2574
2687
  "version": "2.0.1",
2575
2688
  "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz",
@@ -3032,6 +3145,14 @@
3032
3145
  }
3033
3146
  }
3034
3147
  },
3148
+ "node_modules/decamelize": {
3149
+ "version": "1.2.0",
3150
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
3151
+ "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
3152
+ "engines": {
3153
+ "node": ">=0.10.0"
3154
+ }
3155
+ },
3035
3156
  "node_modules/decode-named-character-reference": {
3036
3157
  "version": "1.0.2",
3037
3158
  "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz",
@@ -3947,6 +4068,11 @@
3947
4068
  "node": ">=6"
3948
4069
  }
3949
4070
  },
4071
+ "node_modules/eventemitter3": {
4072
+ "version": "4.0.7",
4073
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
4074
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
4075
+ },
3950
4076
  "node_modules/eventsource-parser": {
3951
4077
  "version": "1.1.2",
3952
4078
  "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-1.1.2.tgz",
@@ -4729,6 +4855,11 @@
4729
4855
  "url": "https://github.com/sponsors/wooorm"
4730
4856
  }
4731
4857
  },
4858
+ "node_modules/is-any-array": {
4859
+ "version": "2.0.1",
4860
+ "resolved": "https://registry.npmjs.org/is-any-array/-/is-any-array-2.0.1.tgz",
4861
+ "integrity": "sha512-UtilS7hLRu++wb/WBAw9bNuP1Eg04Ivn1vERJck8zJthEvXCBEBpGR/33u/xLKWEQf95803oalHrVDptcAvFdQ=="
4862
+ },
4732
4863
  "node_modules/is-array-buffer": {
4733
4864
  "version": "3.0.4",
4734
4865
  "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz",
@@ -5216,6 +5347,33 @@
5216
5347
  "url": "https://github.com/sponsors/panva"
5217
5348
  }
5218
5349
  },
5350
+ "node_modules/js-tiktoken": {
5351
+ "version": "1.0.12",
5352
+ "resolved": "https://registry.npmjs.org/js-tiktoken/-/js-tiktoken-1.0.12.tgz",
5353
+ "integrity": "sha512-L7wURW1fH9Qaext0VzaUDpFGVQgjkdE3Dgsy9/+yXyGEpBKnylTd0mU0bfbNkKDlXRb6TEsZkwuflu1B8uQbJQ==",
5354
+ "dependencies": {
5355
+ "base64-js": "^1.5.1"
5356
+ }
5357
+ },
5358
+ "node_modules/js-tiktoken/node_modules/base64-js": {
5359
+ "version": "1.5.1",
5360
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
5361
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
5362
+ "funding": [
5363
+ {
5364
+ "type": "github",
5365
+ "url": "https://github.com/sponsors/feross"
5366
+ },
5367
+ {
5368
+ "type": "patreon",
5369
+ "url": "https://www.patreon.com/feross"
5370
+ },
5371
+ {
5372
+ "type": "consulting",
5373
+ "url": "https://feross.org/support"
5374
+ }
5375
+ ]
5376
+ },
5219
5377
  "node_modules/js-tokens": {
5220
5378
  "version": "4.0.0",
5221
5379
  "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -6366,6 +6524,46 @@
6366
6524
  "node": ">=16 || 14 >=14.17"
6367
6525
  }
6368
6526
  },
6527
+ "node_modules/ml-array-mean": {
6528
+ "version": "1.1.6",
6529
+ "resolved": "https://registry.npmjs.org/ml-array-mean/-/ml-array-mean-1.1.6.tgz",
6530
+ "integrity": "sha512-MIdf7Zc8HznwIisyiJGRH9tRigg3Yf4FldW8DxKxpCCv/g5CafTw0RRu51nojVEOXuCQC7DRVVu5c7XXO/5joQ==",
6531
+ "dependencies": {
6532
+ "ml-array-sum": "^1.1.6"
6533
+ }
6534
+ },
6535
+ "node_modules/ml-array-sum": {
6536
+ "version": "1.1.6",
6537
+ "resolved": "https://registry.npmjs.org/ml-array-sum/-/ml-array-sum-1.1.6.tgz",
6538
+ "integrity": "sha512-29mAh2GwH7ZmiRnup4UyibQZB9+ZLyMShvt4cH4eTK+cL2oEMIZFnSyB3SS8MlsTh6q/w/yh48KmqLxmovN4Dw==",
6539
+ "dependencies": {
6540
+ "is-any-array": "^2.0.0"
6541
+ }
6542
+ },
6543
+ "node_modules/ml-distance": {
6544
+ "version": "4.0.1",
6545
+ "resolved": "https://registry.npmjs.org/ml-distance/-/ml-distance-4.0.1.tgz",
6546
+ "integrity": "sha512-feZ5ziXs01zhyFUUUeZV5hwc0f5JW0Sh0ckU1koZe/wdVkJdGxcP06KNQuF0WBTj8FttQUzcvQcpcrOp/XrlEw==",
6547
+ "dependencies": {
6548
+ "ml-array-mean": "^1.1.6",
6549
+ "ml-distance-euclidean": "^2.0.0",
6550
+ "ml-tree-similarity": "^1.0.0"
6551
+ }
6552
+ },
6553
+ "node_modules/ml-distance-euclidean": {
6554
+ "version": "2.0.0",
6555
+ "resolved": "https://registry.npmjs.org/ml-distance-euclidean/-/ml-distance-euclidean-2.0.0.tgz",
6556
+ "integrity": "sha512-yC9/2o8QF0A3m/0IXqCTXCzz2pNEzvmcE/9HFKOZGnTjatvBbsn4lWYJkxENkA4Ug2fnYl7PXQxnPi21sgMy/Q=="
6557
+ },
6558
+ "node_modules/ml-tree-similarity": {
6559
+ "version": "1.0.0",
6560
+ "resolved": "https://registry.npmjs.org/ml-tree-similarity/-/ml-tree-similarity-1.0.0.tgz",
6561
+ "integrity": "sha512-XJUyYqjSuUQkNQHMscr6tcjldsOoAekxADTplt40QKfwW6nd++1wHWV9AArl0Zvw/TIHgNaZZNvr8QGvE8wLRg==",
6562
+ "dependencies": {
6563
+ "binary-search": "^1.3.5",
6564
+ "num-sort": "^2.0.0"
6565
+ }
6566
+ },
6369
6567
  "node_modules/mri": {
6370
6568
  "version": "1.2.0",
6371
6569
  "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
@@ -6379,6 +6577,14 @@
6379
6577
  "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
6380
6578
  "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
6381
6579
  },
6580
+ "node_modules/mustache": {
6581
+ "version": "4.2.0",
6582
+ "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
6583
+ "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
6584
+ "bin": {
6585
+ "mustache": "bin/mustache"
6586
+ }
6587
+ },
6382
6588
  "node_modules/mz": {
6383
6589
  "version": "2.7.0",
6384
6590
  "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
@@ -6595,6 +6801,17 @@
6595
6801
  "node": ">=0.10.0"
6596
6802
  }
6597
6803
  },
6804
+ "node_modules/num-sort": {
6805
+ "version": "2.1.0",
6806
+ "resolved": "https://registry.npmjs.org/num-sort/-/num-sort-2.1.0.tgz",
6807
+ "integrity": "sha512-1MQz1Ed8z2yckoBeSfkQHHO9K1yDRxxtotKSJ9yvcTUUxSvfvzEq5GwBrjjHEpMlq/k5gvXdmJ1SbYxWtpNoVg==",
6808
+ "engines": {
6809
+ "node": ">=8"
6810
+ },
6811
+ "funding": {
6812
+ "url": "https://github.com/sponsors/sindresorhus"
6813
+ }
6814
+ },
6598
6815
  "node_modules/oauth4webapi": {
6599
6816
  "version": "2.10.4",
6600
6817
  "resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-2.10.4.tgz",
@@ -6746,9 +6963,9 @@
6746
6963
  }
6747
6964
  },
6748
6965
  "node_modules/openai": {
6749
- "version": "4.47.3",
6750
- "resolved": "https://registry.npmjs.org/openai/-/openai-4.47.3.tgz",
6751
- "integrity": "sha512-470d4ibH5kizXflCzgur22GpM4nOjrg7WQ9jTOa3dNKEn248oBy4+pjOyfcFR4V4YUn/YlDNjp6h83PbviCCKQ==",
6966
+ "version": "4.51.0",
6967
+ "resolved": "https://registry.npmjs.org/openai/-/openai-4.51.0.tgz",
6968
+ "integrity": "sha512-UKuWc3/qQyklqhHM8CbdXCv0Z0obap6T0ECdcO5oATQxAbKE5Ky3YCXFQY207z+eGG6ez4U9wvAcuMygxhmStg==",
6752
6969
  "dependencies": {
6753
6970
  "@types/node": "^18.11.18",
6754
6971
  "@types/node-fetch": "^2.6.4",
@@ -6788,6 +7005,14 @@
6788
7005
  "node": ">= 0.8.0"
6789
7006
  }
6790
7007
  },
7008
+ "node_modules/p-finally": {
7009
+ "version": "1.0.0",
7010
+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
7011
+ "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
7012
+ "engines": {
7013
+ "node": ">=4"
7014
+ }
7015
+ },
6791
7016
  "node_modules/p-limit": {
6792
7017
  "version": "3.1.0",
6793
7018
  "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
@@ -6818,6 +7043,44 @@
6818
7043
  "url": "https://github.com/sponsors/sindresorhus"
6819
7044
  }
6820
7045
  },
7046
+ "node_modules/p-queue": {
7047
+ "version": "6.6.2",
7048
+ "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz",
7049
+ "integrity": "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ==",
7050
+ "dependencies": {
7051
+ "eventemitter3": "^4.0.4",
7052
+ "p-timeout": "^3.2.0"
7053
+ },
7054
+ "engines": {
7055
+ "node": ">=8"
7056
+ },
7057
+ "funding": {
7058
+ "url": "https://github.com/sponsors/sindresorhus"
7059
+ }
7060
+ },
7061
+ "node_modules/p-retry": {
7062
+ "version": "4.6.2",
7063
+ "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-4.6.2.tgz",
7064
+ "integrity": "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==",
7065
+ "dependencies": {
7066
+ "@types/retry": "0.12.0",
7067
+ "retry": "^0.13.1"
7068
+ },
7069
+ "engines": {
7070
+ "node": ">=8"
7071
+ }
7072
+ },
7073
+ "node_modules/p-timeout": {
7074
+ "version": "3.2.0",
7075
+ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz",
7076
+ "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==",
7077
+ "dependencies": {
7078
+ "p-finally": "^1.0.0"
7079
+ },
7080
+ "engines": {
7081
+ "node": ">=8"
7082
+ }
7083
+ },
6821
7084
  "node_modules/pako": {
6822
7085
  "version": "0.2.9",
6823
7086
  "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
@@ -7612,6 +7875,14 @@
7612
7875
  "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
7613
7876
  }
7614
7877
  },
7878
+ "node_modules/retry": {
7879
+ "version": "0.13.1",
7880
+ "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",
7881
+ "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==",
7882
+ "engines": {
7883
+ "node": ">= 4"
7884
+ }
7885
+ },
7615
7886
  "node_modules/reusify": {
7616
7887
  "version": "1.0.4",
7617
7888
  "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
@@ -8893,6 +9164,18 @@
8893
9164
  "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
8894
9165
  "dev": true
8895
9166
  },
9167
+ "node_modules/uuid": {
9168
+ "version": "9.0.1",
9169
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
9170
+ "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
9171
+ "funding": [
9172
+ "https://github.com/sponsors/broofa",
9173
+ "https://github.com/sponsors/ctavan"
9174
+ ],
9175
+ "bin": {
9176
+ "uuid": "dist/bin/uuid"
9177
+ }
9178
+ },
8896
9179
  "node_modules/uvu": {
8897
9180
  "version": "0.5.6",
8898
9181
  "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz",
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@ai-sdk/openai": "^0.0.9",
17
+ "@langchain/openai": "^0.1.3",
17
18
  "@radix-ui/react-alert-dialog": "^1.0.5",
18
19
  "@radix-ui/react-dialog": "^1.0.5",
19
20
  "@radix-ui/react-dropdown-menu": "^2.0.6",
package/package.json CHANGED
@@ -1,19 +1,25 @@
1
1
  {
2
2
  "name": "langwatch",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js"
12
+ }
13
+ },
8
14
  "repository": {
9
15
  "type": "git",
10
16
  "url": "https://github.com/langwatch/langwatch.git",
11
17
  "directory": "typescript-sdk"
12
18
  },
13
19
  "scripts": {
14
- "prepare": "cp ../langwatch/src/server/tracer/types.ts src/server/types/tracer.ts && ts-to-zod src/server/types/tracer.ts src/server/types/tracer.generated.ts",
20
+ "prepare": "./copy-types.sh",
15
21
  "test": "vitest",
16
- "build": "npm run prepare && tsup",
22
+ "build": "npm run prepare && tsup && esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
17
23
  "prepublish": "npm run build"
18
24
  },
19
25
  "author": "",
@@ -28,16 +34,18 @@
28
34
  "@types/eslint__js": "^8.42.3",
29
35
  "@types/node": "^16.0.0",
30
36
  "dotenv": "^16.4.5",
37
+ "esbuild": "^0.21.5",
31
38
  "eslint": "^8.57.0",
32
- "ts-to-zod": "^3.4.1",
39
+ "ts-to-zod": "3.8.5",
33
40
  "tsup": "^8.1.0",
34
41
  "typescript": "^4.9.5",
35
42
  "typescript-eslint": "^7.11.0",
36
43
  "vitest": "^0.5.0"
37
44
  },
38
45
  "dependencies": {
46
+ "@langchain/core": "^0.2.7",
39
47
  "ai": "^3.1.23",
40
- "llm-cost": "^1.0.4",
48
+ "javascript-stringify": "^2.1.0",
41
49
  "nanoid": "^5.0.7",
42
50
  "openai": "^4.47.3",
43
51
  "zod": "^3.22.4",