langsmith 0.1.26 → 0.1.28

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 (48) hide show
  1. package/dist/env.cjs +17 -0
  2. package/dist/env.d.ts +1 -0
  3. package/dist/env.js +13 -0
  4. package/dist/evaluation/_runner.cjs +1 -0
  5. package/dist/evaluation/_runner.js +1 -0
  6. package/dist/evaluation/langchain.cjs +52 -0
  7. package/dist/evaluation/langchain.d.ts +19 -0
  8. package/dist/evaluation/langchain.js +48 -0
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/langchain.cjs +126 -0
  13. package/dist/langchain.d.ts +30 -0
  14. package/dist/langchain.js +121 -0
  15. package/dist/run_trees.cjs +37 -24
  16. package/dist/run_trees.d.ts +1 -1
  17. package/dist/run_trees.js +36 -23
  18. package/dist/schemas.d.ts +1 -1
  19. package/dist/singletons/traceable.cjs +62 -0
  20. package/dist/singletons/traceable.d.ts +23 -0
  21. package/dist/singletons/traceable.js +57 -0
  22. package/dist/singletons/types.cjs +2 -0
  23. package/dist/singletons/types.d.ts +38 -0
  24. package/dist/singletons/types.js +1 -0
  25. package/dist/traceable.cjs +24 -102
  26. package/dist/traceable.d.ts +4 -47
  27. package/dist/traceable.js +8 -86
  28. package/dist/utils/asserts.cjs +47 -0
  29. package/dist/utils/asserts.d.ts +7 -0
  30. package/dist/utils/asserts.js +37 -0
  31. package/dist/utils/warn.cjs +11 -0
  32. package/dist/utils/warn.d.ts +1 -0
  33. package/dist/utils/warn.js +7 -0
  34. package/dist/wrappers/openai.cjs +1 -1
  35. package/dist/wrappers/openai.js +1 -1
  36. package/evaluation/langchain.cjs +1 -0
  37. package/evaluation/langchain.d.cts +1 -0
  38. package/evaluation/langchain.d.ts +1 -0
  39. package/evaluation/langchain.js +1 -0
  40. package/langchain.cjs +1 -0
  41. package/langchain.d.cts +1 -0
  42. package/langchain.d.ts +1 -0
  43. package/langchain.js +1 -0
  44. package/package.json +56 -5
  45. package/singletons/traceable.cjs +1 -0
  46. package/singletons/traceable.d.cts +1 -0
  47. package/singletons/traceable.d.ts +1 -0
  48. package/singletons/traceable.js +1 -0
@@ -0,0 +1,37 @@
1
+ export function isPromiseMethod(x) {
2
+ if (x === "then" || x === "catch" || x === "finally") {
3
+ return true;
4
+ }
5
+ return false;
6
+ }
7
+ export function isKVMap(x) {
8
+ if (typeof x !== "object" || x == null) {
9
+ return false;
10
+ }
11
+ const prototype = Object.getPrototypeOf(x);
12
+ return ((prototype === null ||
13
+ prototype === Object.prototype ||
14
+ Object.getPrototypeOf(prototype) === null) &&
15
+ !(Symbol.toStringTag in x) &&
16
+ !(Symbol.iterator in x));
17
+ }
18
+ export const isAsyncIterable = (x) => x != null &&
19
+ typeof x === "object" &&
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ typeof x[Symbol.asyncIterator] === "function";
22
+ export const isIteratorLike = (x) => x != null &&
23
+ typeof x === "object" &&
24
+ "next" in x &&
25
+ typeof x.next === "function";
26
+ const GeneratorFunction = function* () { }.constructor;
27
+ export const isGenerator = (x) =>
28
+ // eslint-disable-next-line no-instanceof/no-instanceof
29
+ x != null && typeof x === "function" && x instanceof GeneratorFunction;
30
+ export const isThenable = (x) => x != null &&
31
+ typeof x === "object" &&
32
+ "then" in x &&
33
+ typeof x.then === "function";
34
+ export const isReadableStream = (x) => x != null &&
35
+ typeof x === "object" &&
36
+ "getReader" in x &&
37
+ typeof x.getReader === "function";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.warnOnce = void 0;
4
+ const warnedMessages = {};
5
+ function warnOnce(message) {
6
+ if (!warnedMessages[message]) {
7
+ console.warn(message);
8
+ warnedMessages[message] = true;
9
+ }
10
+ }
11
+ exports.warnOnce = warnOnce;
@@ -0,0 +1 @@
1
+ export declare function warnOnce(message: string): void;
@@ -0,0 +1,7 @@
1
+ const warnedMessages = {};
2
+ export function warnOnce(message) {
3
+ if (!warnedMessages[message]) {
4
+ console.warn(message);
5
+ warnedMessages[message] = true;
6
+ }
7
+ }
@@ -179,7 +179,7 @@ const wrapOpenAI = (openai, options) => {
179
179
  undefined;
180
180
  return {
181
181
  ls_provider: "openai",
182
- ls_model_type: "chat",
182
+ ls_model_type: "text",
183
183
  ls_model_name: params.model,
184
184
  ls_max_tokens: params.max_tokens ?? undefined,
185
185
  ls_temperature: params.temperature ?? undefined,
@@ -176,7 +176,7 @@ export const wrapOpenAI = (openai, options) => {
176
176
  undefined;
177
177
  return {
178
178
  ls_provider: "openai",
179
- ls_model_type: "chat",
179
+ ls_model_type: "text",
180
180
  ls_model_name: params.model,
181
181
  ls_max_tokens: params.max_tokens ?? undefined,
182
182
  ls_temperature: params.temperature ?? undefined,
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/evaluation/langchain.cjs');
@@ -0,0 +1 @@
1
+ export * from '../dist/evaluation/langchain.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/evaluation/langchain.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/evaluation/langchain.js'
package/langchain.cjs ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/langchain.cjs');
@@ -0,0 +1 @@
1
+ export * from './dist/langchain.js'
package/langchain.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/langchain.js'
package/langchain.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/langchain.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
5
5
  "packageManager": "yarn@1.22.19",
6
6
  "files": [
@@ -21,10 +21,18 @@
21
21
  "evaluation.js",
22
22
  "evaluation.d.ts",
23
23
  "evaluation.d.cts",
24
+ "evaluation/langchain.cjs",
25
+ "evaluation/langchain.js",
26
+ "evaluation/langchain.d.ts",
27
+ "evaluation/langchain.d.cts",
24
28
  "schemas.cjs",
25
29
  "schemas.js",
26
30
  "schemas.d.ts",
27
31
  "schemas.d.cts",
32
+ "langchain.cjs",
33
+ "langchain.js",
34
+ "langchain.d.ts",
35
+ "langchain.d.cts",
28
36
  "wrappers.cjs",
29
37
  "wrappers.js",
30
38
  "wrappers.d.ts",
@@ -33,6 +41,10 @@
33
41
  "wrappers/openai.js",
34
42
  "wrappers/openai.d.ts",
35
43
  "wrappers/openai.d.cts",
44
+ "singletons/traceable.cjs",
45
+ "singletons/traceable.js",
46
+ "singletons/traceable.d.ts",
47
+ "singletons/traceable.d.cts",
36
48
  "index.cjs",
37
49
  "index.js",
38
50
  "index.d.ts",
@@ -87,8 +99,9 @@
87
99
  "@babel/preset-env": "^7.22.4",
88
100
  "@faker-js/faker": "^8.4.1",
89
101
  "@jest/globals": "^29.5.0",
90
- "@langchain/core": "^0.1.32",
91
- "@langchain/langgraph": "^0.0.8",
102
+ "langchain": "^0.2.0",
103
+ "@langchain/core": "^0.2.0",
104
+ "@langchain/langgraph": "^0.0.19",
92
105
  "@tsconfig/recommended": "^1.0.2",
93
106
  "@types/jest": "^29.5.1",
94
107
  "@typescript-eslint/eslint-plugin": "^5.59.8",
@@ -109,13 +122,24 @@
109
122
  "typescript": "^5.4.5"
110
123
  },
111
124
  "peerDependencies": {
112
- "openai": "*"
125
+ "openai": "*",
126
+ "langchain": "*",
127
+ "@langchain/core": "*"
113
128
  },
114
129
  "peerDependenciesMeta": {
115
130
  "openai": {
116
131
  "optional": true
132
+ },
133
+ "langchain": {
134
+ "optional": true
135
+ },
136
+ "@langchain/core": {
137
+ "optional": true
117
138
  }
118
139
  },
140
+ "resolutions": {
141
+ "@langchain/core": "0.2.0"
142
+ },
119
143
  "lint-staged": {
120
144
  "**/*.{ts,tsx}": [
121
145
  "prettier --write --ignore-unknown",
@@ -168,6 +192,15 @@
168
192
  "import": "./evaluation.js",
169
193
  "require": "./evaluation.cjs"
170
194
  },
195
+ "./evaluation/langchain": {
196
+ "types": {
197
+ "import": "./evaluation/langchain.d.ts",
198
+ "require": "./evaluation/langchain.d.cts",
199
+ "default": "./evaluation/langchain.d.ts"
200
+ },
201
+ "import": "./evaluation/langchain.js",
202
+ "require": "./evaluation/langchain.cjs"
203
+ },
171
204
  "./schemas": {
172
205
  "types": {
173
206
  "import": "./schemas.d.ts",
@@ -177,6 +210,15 @@
177
210
  "import": "./schemas.js",
178
211
  "require": "./schemas.cjs"
179
212
  },
213
+ "./langchain": {
214
+ "types": {
215
+ "import": "./langchain.d.ts",
216
+ "require": "./langchain.d.cts",
217
+ "default": "./langchain.d.ts"
218
+ },
219
+ "import": "./langchain.js",
220
+ "require": "./langchain.cjs"
221
+ },
180
222
  "./wrappers": {
181
223
  "types": {
182
224
  "import": "./wrappers.d.ts",
@@ -195,6 +237,15 @@
195
237
  "import": "./wrappers/openai.js",
196
238
  "require": "./wrappers/openai.cjs"
197
239
  },
240
+ "./singletons/traceable": {
241
+ "types": {
242
+ "import": "./singletons/traceable.d.ts",
243
+ "require": "./singletons/traceable.d.cts",
244
+ "default": "./singletons/traceable.d.ts"
245
+ },
246
+ "import": "./singletons/traceable.js",
247
+ "require": "./singletons/traceable.cjs"
248
+ },
198
249
  "./package.json": "./package.json"
199
250
  }
200
- }
251
+ }
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/singletons/traceable.cjs');
@@ -0,0 +1 @@
1
+ export * from '../dist/singletons/traceable.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/singletons/traceable.js'
@@ -0,0 +1 @@
1
+ export * from '../dist/singletons/traceable.js'