langsmith 0.3.63 → 0.3.65
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/client.cjs +29 -5
- package/dist/client.d.ts +10 -2
- package/dist/client.js +30 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/jest/index.d.ts +72 -192
- package/dist/run_trees.cjs +8 -4
- package/dist/run_trees.d.ts +1 -0
- package/dist/run_trees.js +8 -4
- package/dist/traceable.cjs +4 -1
- package/dist/traceable.js +4 -1
- package/dist/utils/env.cjs +5 -1
- package/dist/utils/env.js +5 -1
- package/dist/utils/error.cjs +14 -0
- package/dist/utils/error.js +14 -0
- package/dist/utils/jestlike/index.cjs +17 -3
- package/dist/utils/jestlike/index.d.ts +37 -97
- package/dist/utils/jestlike/index.js +17 -3
- package/dist/utils/jestlike/types.d.ts +13 -0
- package/dist/vitest/index.d.mts +36 -96
- package/dist/vitest/index.d.ts +36 -96
- package/dist/vitest/utils/wrapper.d.ts +36 -96
- package/dist/wrappers/openai.cjs +11 -6
- package/dist/wrappers/openai.d.ts +1 -1
- package/dist/wrappers/openai.js +11 -6
- package/package.json +1 -1
package/dist/vitest/index.d.ts
CHANGED
|
@@ -1,147 +1,87 @@
|
|
|
1
1
|
import type { LangSmithJestlikeWrapperParams } from "../utils/jestlike/types.js";
|
|
2
2
|
import { wrapVitest } from "./utils/wrapper.js";
|
|
3
|
-
declare const test: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
4
|
-
|
|
5
|
-
referenceOutputs?: O;
|
|
6
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
7
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
8
|
-
inputs: I;
|
|
9
|
-
referenceOutputs?: O;
|
|
10
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
3
|
+
declare const test: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
4
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
11
5
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
6
|
+
id?: string;
|
|
12
7
|
inputs: I;
|
|
13
8
|
referenceOutputs?: O;
|
|
14
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
15
|
-
inputs: I;
|
|
16
|
-
referenceOutputs?: O;
|
|
17
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
9
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
18
10
|
};
|
|
19
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
20
|
-
inputs: I;
|
|
21
|
-
referenceOutputs?: O;
|
|
22
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
11
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
23
12
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
13
|
+
id?: string;
|
|
24
14
|
inputs: I;
|
|
25
15
|
referenceOutputs?: O;
|
|
26
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
27
|
-
inputs: I;
|
|
28
|
-
referenceOutputs?: O;
|
|
29
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
16
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
30
17
|
};
|
|
31
|
-
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
32
|
-
inputs: I;
|
|
33
|
-
referenceOutputs?: O;
|
|
34
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
18
|
+
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
35
19
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
20
|
+
id?: string;
|
|
36
21
|
inputs: I;
|
|
37
22
|
referenceOutputs?: O;
|
|
38
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
39
|
-
|
|
40
|
-
referenceOutputs?: O;
|
|
41
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
42
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
43
|
-
inputs: I;
|
|
44
|
-
referenceOutputs?: O;
|
|
45
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
23
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
24
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
46
25
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
26
|
+
id?: string;
|
|
47
27
|
inputs: I;
|
|
48
28
|
referenceOutputs?: O;
|
|
49
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
50
|
-
inputs: I;
|
|
51
|
-
referenceOutputs?: O;
|
|
52
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
29
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
53
30
|
};
|
|
54
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
55
|
-
inputs: I;
|
|
56
|
-
referenceOutputs?: O;
|
|
57
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
31
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
58
32
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
33
|
+
id?: string;
|
|
59
34
|
inputs: I;
|
|
60
35
|
referenceOutputs?: O;
|
|
61
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
62
|
-
inputs: I;
|
|
63
|
-
referenceOutputs?: O;
|
|
64
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
36
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
65
37
|
};
|
|
66
38
|
};
|
|
67
39
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
40
|
+
id?: string;
|
|
68
41
|
inputs: I;
|
|
69
42
|
referenceOutputs?: O;
|
|
70
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
74
|
-
}, it: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
75
|
-
inputs: I;
|
|
76
|
-
referenceOutputs?: O;
|
|
77
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
78
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
79
|
-
inputs: I;
|
|
80
|
-
referenceOutputs?: O;
|
|
81
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
43
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
44
|
+
}, it: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
45
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
82
46
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
47
|
+
id?: string;
|
|
83
48
|
inputs: I;
|
|
84
49
|
referenceOutputs?: O;
|
|
85
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
86
|
-
inputs: I;
|
|
87
|
-
referenceOutputs?: O;
|
|
88
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
50
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
89
51
|
};
|
|
90
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
91
|
-
inputs: I;
|
|
92
|
-
referenceOutputs?: O;
|
|
93
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
52
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
94
53
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
54
|
+
id?: string;
|
|
95
55
|
inputs: I;
|
|
96
56
|
referenceOutputs?: O;
|
|
97
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
98
|
-
inputs: I;
|
|
99
|
-
referenceOutputs?: O;
|
|
100
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
57
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
101
58
|
};
|
|
102
|
-
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
103
|
-
inputs: I;
|
|
104
|
-
referenceOutputs?: O;
|
|
105
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
59
|
+
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
106
60
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
61
|
+
id?: string;
|
|
107
62
|
inputs: I;
|
|
108
63
|
referenceOutputs?: O;
|
|
109
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
110
|
-
|
|
111
|
-
referenceOutputs?: O;
|
|
112
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
113
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
114
|
-
inputs: I;
|
|
115
|
-
referenceOutputs?: O;
|
|
116
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
64
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
65
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
117
66
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
67
|
+
id?: string;
|
|
118
68
|
inputs: I;
|
|
119
69
|
referenceOutputs?: O;
|
|
120
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
121
|
-
inputs: I;
|
|
122
|
-
referenceOutputs?: O;
|
|
123
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
70
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
124
71
|
};
|
|
125
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
126
|
-
inputs: I;
|
|
127
|
-
referenceOutputs?: O;
|
|
128
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
72
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: LangSmithJestlikeWrapperParams<I, O>, testFn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
129
73
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
74
|
+
id?: string;
|
|
130
75
|
inputs: I;
|
|
131
76
|
referenceOutputs?: O;
|
|
132
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
133
|
-
inputs: I;
|
|
134
|
-
referenceOutputs?: O;
|
|
135
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
77
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
136
78
|
};
|
|
137
79
|
};
|
|
138
80
|
each: <I extends import("../schemas.js").KVMap, O extends import("../schemas.js").KVMap>(table: ({
|
|
81
|
+
id?: string;
|
|
139
82
|
inputs: I;
|
|
140
83
|
referenceOutputs?: O;
|
|
141
|
-
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
142
|
-
inputs: I;
|
|
143
|
-
referenceOutputs?: O;
|
|
144
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
84
|
+
} & Record<string, any>)[], config?: import("../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
145
85
|
}, describe: import("../utils/jestlike/types.js").LangSmithJestlikeDescribeWrapper & {
|
|
146
86
|
only: import("../utils/jestlike/types.js").LangSmithJestlikeDescribeWrapper;
|
|
147
87
|
skip: import("../utils/jestlike/types.js").LangSmithJestlikeDescribeWrapper;
|
|
@@ -70,149 +70,89 @@ export declare const wrapVitest: (originalVitestMethods: Record<string, unknown>
|
|
|
70
70
|
logFeedback: typeof logFeedback;
|
|
71
71
|
logOutputs: typeof logOutputs;
|
|
72
72
|
wrapEvaluator: typeof wrapEvaluator;
|
|
73
|
-
test: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
74
|
-
|
|
75
|
-
referenceOutputs?: O;
|
|
76
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
77
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
78
|
-
inputs: I;
|
|
79
|
-
referenceOutputs?: O;
|
|
80
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
73
|
+
test: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
74
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
81
75
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
76
|
+
id?: string;
|
|
82
77
|
inputs: I;
|
|
83
78
|
referenceOutputs?: O;
|
|
84
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
85
|
-
inputs: I;
|
|
86
|
-
referenceOutputs?: O;
|
|
87
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
79
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
88
80
|
};
|
|
89
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
90
|
-
inputs: I;
|
|
91
|
-
referenceOutputs?: O;
|
|
92
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
81
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
93
82
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
83
|
+
id?: string;
|
|
94
84
|
inputs: I;
|
|
95
85
|
referenceOutputs?: O;
|
|
96
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
97
|
-
inputs: I;
|
|
98
|
-
referenceOutputs?: O;
|
|
99
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
86
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
100
87
|
};
|
|
101
|
-
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
102
|
-
inputs: I;
|
|
103
|
-
referenceOutputs?: O;
|
|
104
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
88
|
+
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
105
89
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
90
|
+
id?: string;
|
|
106
91
|
inputs: I;
|
|
107
92
|
referenceOutputs?: O;
|
|
108
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
109
|
-
|
|
110
|
-
referenceOutputs?: O;
|
|
111
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
112
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
113
|
-
inputs: I;
|
|
114
|
-
referenceOutputs?: O;
|
|
115
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
93
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
94
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
116
95
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
96
|
+
id?: string;
|
|
117
97
|
inputs: I;
|
|
118
98
|
referenceOutputs?: O;
|
|
119
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
120
|
-
inputs: I;
|
|
121
|
-
referenceOutputs?: O;
|
|
122
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
99
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
123
100
|
};
|
|
124
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
125
|
-
inputs: I;
|
|
126
|
-
referenceOutputs?: O;
|
|
127
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
101
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
128
102
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
103
|
+
id?: string;
|
|
129
104
|
inputs: I;
|
|
130
105
|
referenceOutputs?: O;
|
|
131
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
132
|
-
inputs: I;
|
|
133
|
-
referenceOutputs?: O;
|
|
134
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
106
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
135
107
|
};
|
|
136
108
|
};
|
|
137
109
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
110
|
+
id?: string;
|
|
138
111
|
inputs: I;
|
|
139
112
|
referenceOutputs?: O;
|
|
140
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
141
|
-
inputs: I;
|
|
142
|
-
referenceOutputs?: O;
|
|
143
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
113
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
144
114
|
};
|
|
145
|
-
it: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
146
|
-
|
|
147
|
-
referenceOutputs?: O;
|
|
148
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
149
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
150
|
-
inputs: I;
|
|
151
|
-
referenceOutputs?: O;
|
|
152
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
115
|
+
it: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
116
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
153
117
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
118
|
+
id?: string;
|
|
154
119
|
inputs: I;
|
|
155
120
|
referenceOutputs?: O;
|
|
156
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
157
|
-
inputs: I;
|
|
158
|
-
referenceOutputs?: O;
|
|
159
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
121
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
160
122
|
};
|
|
161
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
162
|
-
inputs: I;
|
|
163
|
-
referenceOutputs?: O;
|
|
164
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
123
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
165
124
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
125
|
+
id?: string;
|
|
166
126
|
inputs: I;
|
|
167
127
|
referenceOutputs?: O;
|
|
168
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
169
|
-
inputs: I;
|
|
170
|
-
referenceOutputs?: O;
|
|
171
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
128
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
172
129
|
};
|
|
173
|
-
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
174
|
-
inputs: I;
|
|
175
|
-
referenceOutputs?: O;
|
|
176
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
130
|
+
concurrent: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
177
131
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
132
|
+
id?: string;
|
|
178
133
|
inputs: I;
|
|
179
134
|
referenceOutputs?: O;
|
|
180
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
181
|
-
|
|
182
|
-
referenceOutputs?: O;
|
|
183
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
184
|
-
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (data: {
|
|
185
|
-
inputs: I;
|
|
186
|
-
referenceOutputs?: O;
|
|
187
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
135
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
136
|
+
only: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
188
137
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
138
|
+
id?: string;
|
|
189
139
|
inputs: I;
|
|
190
140
|
referenceOutputs?: O;
|
|
191
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
192
|
-
inputs: I;
|
|
193
|
-
referenceOutputs?: O;
|
|
194
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
141
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
195
142
|
};
|
|
196
|
-
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: (
|
|
197
|
-
inputs: I;
|
|
198
|
-
referenceOutputs?: O;
|
|
199
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void) & {
|
|
143
|
+
skip: (<I extends Record<string, any> = Record<string, any>, O extends Record<string, any> = Record<string, any>>(name: string, lsParams: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperParams<I, O>, testFn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void) & {
|
|
200
144
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
145
|
+
id?: string;
|
|
201
146
|
inputs: I;
|
|
202
147
|
referenceOutputs?: O;
|
|
203
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
204
|
-
inputs: I;
|
|
205
|
-
referenceOutputs?: O;
|
|
206
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
148
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
207
149
|
};
|
|
208
150
|
};
|
|
209
151
|
each: <I extends import("../../schemas.js").KVMap, O extends import("../../schemas.js").KVMap>(table: ({
|
|
152
|
+
id?: string;
|
|
210
153
|
inputs: I;
|
|
211
154
|
referenceOutputs?: O;
|
|
212
|
-
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: (
|
|
213
|
-
inputs: I;
|
|
214
|
-
referenceOutputs?: O;
|
|
215
|
-
} & Record<string, any>) => unknown | Promise<unknown>, timeout?: number) => void;
|
|
155
|
+
} & Record<string, any>)[], config?: import("../../utils/jestlike/types.js").LangSmithJestlikeWrapperConfig) => (name: string, fn: import("../../utils/jestlike/types.js").LangSmithJestlikeTestFunction<I, O>, timeout?: number) => void;
|
|
216
156
|
};
|
|
217
157
|
describe: import("../../utils/jestlike/types.js").LangSmithJestlikeDescribeWrapper & {
|
|
218
158
|
only: import("../../utils/jestlike/types.js").LangSmithJestlikeDescribeWrapper;
|
package/dist/wrappers/openai.cjs
CHANGED
|
@@ -197,11 +197,16 @@ const wrapOpenAI = (openai, options) => {
|
|
|
197
197
|
(0, traceable_js_1.isTraceableFunction)(openai.completions.create)) {
|
|
198
198
|
throw new Error("This instance of OpenAI client has been already wrapped once.");
|
|
199
199
|
}
|
|
200
|
+
// Attempt to determine if this is an Azure OpenAI client
|
|
201
|
+
const isAzureOpenAI = openai.constructor?.name === "AzureOpenAI";
|
|
202
|
+
const provider = isAzureOpenAI ? "azure" : "openai";
|
|
203
|
+
const chatName = isAzureOpenAI ? "AzureChatOpenAI" : "ChatOpenAI";
|
|
204
|
+
const completionsName = isAzureOpenAI ? "AzureOpenAI" : "OpenAI";
|
|
200
205
|
// Some internal OpenAI methods call each other, so we need to preserve original
|
|
201
206
|
// OpenAI methods.
|
|
202
207
|
const tracedOpenAIClient = { ...openai };
|
|
203
208
|
const chatCompletionParseMetadata = {
|
|
204
|
-
name:
|
|
209
|
+
name: chatName,
|
|
205
210
|
run_type: "llm",
|
|
206
211
|
aggregator: chatAggregator,
|
|
207
212
|
argsConfigPath: [1, "langsmithExtra"],
|
|
@@ -213,7 +218,7 @@ const wrapOpenAI = (openai, options) => {
|
|
|
213
218
|
const ls_stop = (typeof params.stop === "string" ? [params.stop] : params.stop) ??
|
|
214
219
|
undefined;
|
|
215
220
|
return {
|
|
216
|
-
ls_provider:
|
|
221
|
+
ls_provider: provider,
|
|
217
222
|
ls_model_type: "chat",
|
|
218
223
|
ls_model_name: params.model,
|
|
219
224
|
ls_max_tokens: params.max_completion_tokens ?? params.max_tokens ?? undefined,
|
|
@@ -247,7 +252,7 @@ const wrapOpenAI = (openai, options) => {
|
|
|
247
252
|
tracedOpenAIClient.completions = {
|
|
248
253
|
...openai.completions,
|
|
249
254
|
create: (0, traceable_js_1.traceable)(openai.completions.create.bind(openai.completions), {
|
|
250
|
-
name:
|
|
255
|
+
name: completionsName,
|
|
251
256
|
run_type: "llm",
|
|
252
257
|
aggregator: textAggregator,
|
|
253
258
|
argsConfigPath: [1, "langsmithExtra"],
|
|
@@ -259,7 +264,7 @@ const wrapOpenAI = (openai, options) => {
|
|
|
259
264
|
const ls_stop = (typeof params.stop === "string" ? [params.stop] : params.stop) ??
|
|
260
265
|
undefined;
|
|
261
266
|
return {
|
|
262
|
-
ls_provider:
|
|
267
|
+
ls_provider: provider,
|
|
263
268
|
ls_model_type: "llm",
|
|
264
269
|
ls_model_name: params.model,
|
|
265
270
|
ls_max_tokens: params.max_tokens ?? undefined,
|
|
@@ -282,7 +287,7 @@ const wrapOpenAI = (openai, options) => {
|
|
|
282
287
|
if (tracedOpenAIClient.responses &&
|
|
283
288
|
typeof tracedOpenAIClient.responses.create === "function") {
|
|
284
289
|
tracedOpenAIClient.responses.create = (0, traceable_js_1.traceable)(openai.responses.create.bind(openai.responses), {
|
|
285
|
-
name:
|
|
290
|
+
name: chatName,
|
|
286
291
|
run_type: "llm",
|
|
287
292
|
aggregator: responsesAggregator,
|
|
288
293
|
argsConfigPath: [1, "langsmithExtra"],
|
|
@@ -292,7 +297,7 @@ const wrapOpenAI = (openai, options) => {
|
|
|
292
297
|
// Handle responses API parameters
|
|
293
298
|
const params = payload;
|
|
294
299
|
return {
|
|
295
|
-
ls_provider:
|
|
300
|
+
ls_provider: provider,
|
|
296
301
|
ls_model_type: "llm",
|
|
297
302
|
ls_model_name: params.model || "unknown",
|
|
298
303
|
};
|
package/dist/wrappers/openai.js
CHANGED
|
@@ -194,11 +194,16 @@ export const wrapOpenAI = (openai, options) => {
|
|
|
194
194
|
isTraceableFunction(openai.completions.create)) {
|
|
195
195
|
throw new Error("This instance of OpenAI client has been already wrapped once.");
|
|
196
196
|
}
|
|
197
|
+
// Attempt to determine if this is an Azure OpenAI client
|
|
198
|
+
const isAzureOpenAI = openai.constructor?.name === "AzureOpenAI";
|
|
199
|
+
const provider = isAzureOpenAI ? "azure" : "openai";
|
|
200
|
+
const chatName = isAzureOpenAI ? "AzureChatOpenAI" : "ChatOpenAI";
|
|
201
|
+
const completionsName = isAzureOpenAI ? "AzureOpenAI" : "OpenAI";
|
|
197
202
|
// Some internal OpenAI methods call each other, so we need to preserve original
|
|
198
203
|
// OpenAI methods.
|
|
199
204
|
const tracedOpenAIClient = { ...openai };
|
|
200
205
|
const chatCompletionParseMetadata = {
|
|
201
|
-
name:
|
|
206
|
+
name: chatName,
|
|
202
207
|
run_type: "llm",
|
|
203
208
|
aggregator: chatAggregator,
|
|
204
209
|
argsConfigPath: [1, "langsmithExtra"],
|
|
@@ -210,7 +215,7 @@ export const wrapOpenAI = (openai, options) => {
|
|
|
210
215
|
const ls_stop = (typeof params.stop === "string" ? [params.stop] : params.stop) ??
|
|
211
216
|
undefined;
|
|
212
217
|
return {
|
|
213
|
-
ls_provider:
|
|
218
|
+
ls_provider: provider,
|
|
214
219
|
ls_model_type: "chat",
|
|
215
220
|
ls_model_name: params.model,
|
|
216
221
|
ls_max_tokens: params.max_completion_tokens ?? params.max_tokens ?? undefined,
|
|
@@ -244,7 +249,7 @@ export const wrapOpenAI = (openai, options) => {
|
|
|
244
249
|
tracedOpenAIClient.completions = {
|
|
245
250
|
...openai.completions,
|
|
246
251
|
create: traceable(openai.completions.create.bind(openai.completions), {
|
|
247
|
-
name:
|
|
252
|
+
name: completionsName,
|
|
248
253
|
run_type: "llm",
|
|
249
254
|
aggregator: textAggregator,
|
|
250
255
|
argsConfigPath: [1, "langsmithExtra"],
|
|
@@ -256,7 +261,7 @@ export const wrapOpenAI = (openai, options) => {
|
|
|
256
261
|
const ls_stop = (typeof params.stop === "string" ? [params.stop] : params.stop) ??
|
|
257
262
|
undefined;
|
|
258
263
|
return {
|
|
259
|
-
ls_provider:
|
|
264
|
+
ls_provider: provider,
|
|
260
265
|
ls_model_type: "llm",
|
|
261
266
|
ls_model_name: params.model,
|
|
262
267
|
ls_max_tokens: params.max_tokens ?? undefined,
|
|
@@ -279,7 +284,7 @@ export const wrapOpenAI = (openai, options) => {
|
|
|
279
284
|
if (tracedOpenAIClient.responses &&
|
|
280
285
|
typeof tracedOpenAIClient.responses.create === "function") {
|
|
281
286
|
tracedOpenAIClient.responses.create = traceable(openai.responses.create.bind(openai.responses), {
|
|
282
|
-
name:
|
|
287
|
+
name: chatName,
|
|
283
288
|
run_type: "llm",
|
|
284
289
|
aggregator: responsesAggregator,
|
|
285
290
|
argsConfigPath: [1, "langsmithExtra"],
|
|
@@ -289,7 +294,7 @@ export const wrapOpenAI = (openai, options) => {
|
|
|
289
294
|
// Handle responses API parameters
|
|
290
295
|
const params = payload;
|
|
291
296
|
return {
|
|
292
|
-
ls_provider:
|
|
297
|
+
ls_provider: provider,
|
|
293
298
|
ls_model_type: "llm",
|
|
294
299
|
ls_model_name: params.model || "unknown",
|
|
295
300
|
};
|