@orq-ai/node 4.16.0-rc.32 → 4.16.0-rc.34
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/README.md +42 -40
- package/funcs/evalsGet.d.ts +1 -1
- package/funcs/evalsGet.js +1 -1
- package/funcs/tracesGetConversation.d.ts +18 -0
- package/funcs/tracesGetConversation.d.ts.map +1 -0
- package/funcs/tracesGetConversation.js +125 -0
- package/funcs/tracesGetConversation.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/evaluatorresponsefunction.d.ts +20 -0
- package/models/components/evaluatorresponsefunction.d.ts.map +1 -1
- package/models/components/evaluatorresponsefunction.js +14 -1
- package/models/components/evaluatorresponsefunction.js.map +1 -1
- package/models/components/evaluatorresponsehttp.d.ts +19 -0
- package/models/components/evaluatorresponsehttp.d.ts.map +1 -1
- package/models/components/evaluatorresponsehttp.js +14 -1
- package/models/components/evaluatorresponsehttp.js.map +1 -1
- package/models/components/evaluatorresponsejsonschema.d.ts +20 -0
- package/models/components/evaluatorresponsejsonschema.d.ts.map +1 -1
- package/models/components/evaluatorresponsejsonschema.js +14 -1
- package/models/components/evaluatorresponsejsonschema.js.map +1 -1
- package/models/components/evaluatorresponsellm.d.ts +19 -0
- package/models/components/evaluatorresponsellm.d.ts.map +1 -1
- package/models/components/evaluatorresponsellm.js +15 -1
- package/models/components/evaluatorresponsellm.js.map +1 -1
- package/models/components/evaluatorresponsepython.d.ts +20 -0
- package/models/components/evaluatorresponsepython.d.ts.map +1 -1
- package/models/components/evaluatorresponsepython.js +14 -1
- package/models/components/evaluatorresponsepython.js.map +1 -1
- package/models/components/evaluatorresponseragas.d.ts +19 -0
- package/models/components/evaluatorresponseragas.d.ts.map +1 -1
- package/models/components/evaluatorresponseragas.js +14 -1
- package/models/components/evaluatorresponseragas.js.map +1 -1
- package/models/components/evaluatorresponsetypescript.d.ts +20 -0
- package/models/components/evaluatorresponsetypescript.d.ts.map +1 -1
- package/models/components/evaluatorresponsetypescript.js +14 -1
- package/models/components/evaluatorresponsetypescript.js.map +1 -1
- package/models/components/gettraceconversationresponse.d.ts +22 -0
- package/models/components/gettraceconversationresponse.d.ts.map +1 -0
- package/models/components/gettraceconversationresponse.js +65 -0
- package/models/components/gettraceconversationresponse.js.map +1 -0
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createrouterresponse.d.ts +0 -5
- package/models/operations/createrouterresponse.d.ts.map +1 -1
- package/models/operations/createrouterresponse.js +0 -1
- package/models/operations/createrouterresponse.js.map +1 -1
- package/models/operations/createtool.js +4 -4
- package/models/operations/getalltools.js +4 -4
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +4 -4
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievetool.js +4 -4
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/tracesgetconversation.d.ts +17 -0
- package/models/operations/tracesgetconversation.d.ts.map +1 -0
- package/models/operations/tracesgetconversation.js +56 -0
- package/models/operations/tracesgetconversation.js.map +1 -0
- package/models/operations/updatetool.js +4 -4
- package/package.json +7 -7
- package/sdk/evals.d.ts +1 -1
- package/sdk/evals.js +1 -1
- package/sdk/traces.d.ts +7 -0
- package/sdk/traces.d.ts.map +1 -1
- package/sdk/traces.js +10 -0
- package/sdk/traces.js.map +1 -1
- package/src/funcs/evalsGet.ts +1 -1
- package/src/funcs/tracesGetConversation.ts +174 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/evaluatorresponsefunction.ts +28 -0
- package/src/models/components/evaluatorresponsehttp.ts +27 -0
- package/src/models/components/evaluatorresponsejsonschema.ts +29 -0
- package/src/models/components/evaluatorresponsellm.ts +24 -0
- package/src/models/components/evaluatorresponsepython.ts +28 -0
- package/src/models/components/evaluatorresponseragas.ts +27 -0
- package/src/models/components/evaluatorresponsetypescript.ts +29 -0
- package/src/models/components/gettraceconversationresponse.ts +63 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createrouterresponse.ts +0 -6
- package/src/models/operations/createtool.ts +4 -4
- package/src/models/operations/getalltools.ts +4 -4
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +4 -4
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievetool.ts +4 -4
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/tracesgetconversation.ts +45 -0
- package/src/models/operations/updatetool.ts +4 -4
- package/src/sdk/evals.ts +1 -1
- package/src/sdk/traces.ts +18 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get trace conversation
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Return ordered OpenResponses items from the selected model-call span. Prefers spans with output outside evaluator subtrees unless `span_id` is given.
|
|
34
|
+
*/
|
|
35
|
+
export function tracesGetConversation(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.TracesGetConversationRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.GetTraceConversationResponse,
|
|
42
|
+
| OrqError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: OrqCore,
|
|
61
|
+
request: operations.TracesGetConversationRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.GetTraceConversationResponse,
|
|
67
|
+
| OrqError
|
|
68
|
+
| ResponseValidationError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
| RequestAbortedError
|
|
71
|
+
| RequestTimeoutError
|
|
72
|
+
| InvalidRequestError
|
|
73
|
+
| UnexpectedClientError
|
|
74
|
+
| SDKValidationError
|
|
75
|
+
>,
|
|
76
|
+
APICall,
|
|
77
|
+
]
|
|
78
|
+
> {
|
|
79
|
+
const parsed = safeParse(
|
|
80
|
+
request,
|
|
81
|
+
(value) =>
|
|
82
|
+
operations.TracesGetConversationRequest$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = null;
|
|
90
|
+
|
|
91
|
+
const pathParams = {
|
|
92
|
+
trace_id: encodeSimple("trace_id", payload.trace_id, {
|
|
93
|
+
explode: false,
|
|
94
|
+
charEncoding: "percent",
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
const path = pathToFunc("/v3/traces/{trace_id}/conversation")(pathParams);
|
|
98
|
+
|
|
99
|
+
const query = encodeFormQuery({
|
|
100
|
+
"span_id": payload.span_id,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const headers = new Headers(compactMap({
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
108
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
109
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
+
|
|
111
|
+
const context = {
|
|
112
|
+
options: client._options,
|
|
113
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
+
operationID: "TracesGetConversation",
|
|
115
|
+
oAuth2Scopes: null,
|
|
116
|
+
|
|
117
|
+
resolvedSecurity: requestSecurity,
|
|
118
|
+
|
|
119
|
+
securitySource: client._options.apiKey,
|
|
120
|
+
retryConfig: options?.retries
|
|
121
|
+
|| client._options.retryConfig
|
|
122
|
+
|| { strategy: "none" },
|
|
123
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const requestRes = client._createRequest(context, {
|
|
127
|
+
security: requestSecurity,
|
|
128
|
+
method: "GET",
|
|
129
|
+
baseURL: options?.serverURL,
|
|
130
|
+
path: path,
|
|
131
|
+
headers: headers,
|
|
132
|
+
query: query,
|
|
133
|
+
body: body,
|
|
134
|
+
userAgent: client._options.userAgent,
|
|
135
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
136
|
+
}, options);
|
|
137
|
+
if (!requestRes.ok) {
|
|
138
|
+
return [requestRes, { status: "invalid" }];
|
|
139
|
+
}
|
|
140
|
+
const req = requestRes.value;
|
|
141
|
+
|
|
142
|
+
const doResult = await client._do(req, {
|
|
143
|
+
context,
|
|
144
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
145
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
146
|
+
retryConfig: context.retryConfig,
|
|
147
|
+
retryCodes: context.retryCodes,
|
|
148
|
+
});
|
|
149
|
+
if (!doResult.ok) {
|
|
150
|
+
return [doResult, { status: "request-error", request: req }];
|
|
151
|
+
}
|
|
152
|
+
const response = doResult.value;
|
|
153
|
+
|
|
154
|
+
const [result] = await M.match<
|
|
155
|
+
components.GetTraceConversationResponse,
|
|
156
|
+
| OrqError
|
|
157
|
+
| ResponseValidationError
|
|
158
|
+
| ConnectionError
|
|
159
|
+
| RequestAbortedError
|
|
160
|
+
| RequestTimeoutError
|
|
161
|
+
| InvalidRequestError
|
|
162
|
+
| UnexpectedClientError
|
|
163
|
+
| SDKValidationError
|
|
164
|
+
>(
|
|
165
|
+
M.json(200, components.GetTraceConversationResponse$inboundSchema),
|
|
166
|
+
M.fail("4XX"),
|
|
167
|
+
M.fail("5XX"),
|
|
168
|
+
)(response, req);
|
|
169
|
+
if (!result.ok) {
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "2.0",
|
|
61
|
-
sdkVersion: "4.16.0-rc.
|
|
62
|
-
genVersion: "2.
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 4.16.0-rc.
|
|
61
|
+
sdkVersion: "4.16.0-rc.34",
|
|
62
|
+
genVersion: "2.943.0",
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 4.16.0-rc.34 2.943.0 2.0 @orq-ai/node",
|
|
64
64
|
} as const;
|
|
@@ -5,9 +5,26 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The type of output expected from the evaluator
|
|
14
|
+
*/
|
|
15
|
+
export const EvaluatorResponseFunctionOutputType = {
|
|
16
|
+
Boolean: "boolean",
|
|
17
|
+
Categorical: "categorical",
|
|
18
|
+
Number: "number",
|
|
19
|
+
String: "string",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The type of output expected from the evaluator
|
|
23
|
+
*/
|
|
24
|
+
export type EvaluatorResponseFunctionOutputType = ClosedEnum<
|
|
25
|
+
typeof EvaluatorResponseFunctionOutputType
|
|
26
|
+
>;
|
|
27
|
+
|
|
11
28
|
export type ThirtyTwo = {
|
|
12
29
|
type: "grammar_diversity";
|
|
13
30
|
};
|
|
@@ -194,6 +211,10 @@ export type EvaluatorResponseFunction = {
|
|
|
194
211
|
projectId?: string | undefined;
|
|
195
212
|
guardrailConfig?: any | undefined;
|
|
196
213
|
type: "function_eval";
|
|
214
|
+
/**
|
|
215
|
+
* The type of output expected from the evaluator
|
|
216
|
+
*/
|
|
217
|
+
outputType: EvaluatorResponseFunctionOutputType;
|
|
197
218
|
functionParams:
|
|
198
219
|
| FunctionParams1
|
|
199
220
|
| FunctionParams2
|
|
@@ -230,6 +251,11 @@ export type EvaluatorResponseFunction = {
|
|
|
230
251
|
key: string;
|
|
231
252
|
};
|
|
232
253
|
|
|
254
|
+
/** @internal */
|
|
255
|
+
export const EvaluatorResponseFunctionOutputType$inboundSchema: z.ZodNativeEnum<
|
|
256
|
+
typeof EvaluatorResponseFunctionOutputType
|
|
257
|
+
> = z.nativeEnum(EvaluatorResponseFunctionOutputType);
|
|
258
|
+
|
|
233
259
|
/** @internal */
|
|
234
260
|
export const ThirtyTwo$inboundSchema: z.ZodType<
|
|
235
261
|
ThirtyTwo,
|
|
@@ -872,6 +898,7 @@ export const EvaluatorResponseFunction$inboundSchema: z.ZodType<
|
|
|
872
898
|
project_id: z.string().optional(),
|
|
873
899
|
guardrail_config: z.any().optional(),
|
|
874
900
|
type: z.literal("function_eval"),
|
|
901
|
+
output_type: EvaluatorResponseFunctionOutputType$inboundSchema,
|
|
875
902
|
function_params: z.union([
|
|
876
903
|
z.lazy(() => FunctionParams1$inboundSchema),
|
|
877
904
|
z.lazy(() => FunctionParams2$inboundSchema),
|
|
@@ -913,6 +940,7 @@ export const EvaluatorResponseFunction$inboundSchema: z.ZodType<
|
|
|
913
940
|
"updated_by_id": "updatedById",
|
|
914
941
|
"project_id": "projectId",
|
|
915
942
|
"guardrail_config": "guardrailConfig",
|
|
943
|
+
"output_type": "outputType",
|
|
916
944
|
"function_params": "functionParams",
|
|
917
945
|
});
|
|
918
946
|
});
|
|
@@ -9,6 +9,22 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The type of output expected from the evaluator
|
|
14
|
+
*/
|
|
15
|
+
export const EvaluatorResponseHttpOutputType = {
|
|
16
|
+
Boolean: "boolean",
|
|
17
|
+
Categorical: "categorical",
|
|
18
|
+
Number: "number",
|
|
19
|
+
String: "string",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The type of output expected from the evaluator
|
|
23
|
+
*/
|
|
24
|
+
export type EvaluatorResponseHttpOutputType = ClosedEnum<
|
|
25
|
+
typeof EvaluatorResponseHttpOutputType
|
|
26
|
+
>;
|
|
27
|
+
|
|
12
28
|
export const Method = {
|
|
13
29
|
Get: "GET",
|
|
14
30
|
Post: "POST",
|
|
@@ -27,6 +43,10 @@ export type EvaluatorResponseHttp = {
|
|
|
27
43
|
projectId?: string | undefined;
|
|
28
44
|
guardrailConfig?: any | undefined;
|
|
29
45
|
type: "http_eval";
|
|
46
|
+
/**
|
|
47
|
+
* The type of output expected from the evaluator
|
|
48
|
+
*/
|
|
49
|
+
outputType: EvaluatorResponseHttpOutputType;
|
|
30
50
|
url: string;
|
|
31
51
|
method: Method;
|
|
32
52
|
headers: { [k: string]: string };
|
|
@@ -34,6 +54,11 @@ export type EvaluatorResponseHttp = {
|
|
|
34
54
|
key: string;
|
|
35
55
|
};
|
|
36
56
|
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const EvaluatorResponseHttpOutputType$inboundSchema: z.ZodNativeEnum<
|
|
59
|
+
typeof EvaluatorResponseHttpOutputType
|
|
60
|
+
> = z.nativeEnum(EvaluatorResponseHttpOutputType);
|
|
61
|
+
|
|
37
62
|
/** @internal */
|
|
38
63
|
export const Method$inboundSchema: z.ZodNativeEnum<typeof Method> = z
|
|
39
64
|
.nativeEnum(Method);
|
|
@@ -52,6 +77,7 @@ export const EvaluatorResponseHttp$inboundSchema: z.ZodType<
|
|
|
52
77
|
project_id: z.string().optional(),
|
|
53
78
|
guardrail_config: z.any().optional(),
|
|
54
79
|
type: z.literal("http_eval"),
|
|
80
|
+
output_type: EvaluatorResponseHttpOutputType$inboundSchema,
|
|
55
81
|
url: z.string(),
|
|
56
82
|
method: Method$inboundSchema,
|
|
57
83
|
headers: z.record(z.string()),
|
|
@@ -63,6 +89,7 @@ export const EvaluatorResponseHttp$inboundSchema: z.ZodType<
|
|
|
63
89
|
"updated_by_id": "updatedById",
|
|
64
90
|
"project_id": "projectId",
|
|
65
91
|
"guardrail_config": "guardrailConfig",
|
|
92
|
+
"output_type": "outputType",
|
|
66
93
|
});
|
|
67
94
|
});
|
|
68
95
|
|
|
@@ -5,9 +5,26 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The type of output expected from the evaluator
|
|
14
|
+
*/
|
|
15
|
+
export const EvaluatorResponseJsonSchemaOutputType = {
|
|
16
|
+
Boolean: "boolean",
|
|
17
|
+
Categorical: "categorical",
|
|
18
|
+
Number: "number",
|
|
19
|
+
String: "string",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The type of output expected from the evaluator
|
|
23
|
+
*/
|
|
24
|
+
export type EvaluatorResponseJsonSchemaOutputType = ClosedEnum<
|
|
25
|
+
typeof EvaluatorResponseJsonSchemaOutputType
|
|
26
|
+
>;
|
|
27
|
+
|
|
11
28
|
export type EvaluatorResponseJsonSchema = {
|
|
12
29
|
id: string;
|
|
13
30
|
description: string;
|
|
@@ -20,10 +37,20 @@ export type EvaluatorResponseJsonSchema = {
|
|
|
20
37
|
projectId?: string | undefined;
|
|
21
38
|
guardrailConfig?: any | undefined;
|
|
22
39
|
type: "json_schema";
|
|
40
|
+
/**
|
|
41
|
+
* The type of output expected from the evaluator
|
|
42
|
+
*/
|
|
43
|
+
outputType: EvaluatorResponseJsonSchemaOutputType;
|
|
23
44
|
schema: string;
|
|
24
45
|
key: string;
|
|
25
46
|
};
|
|
26
47
|
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const EvaluatorResponseJsonSchemaOutputType$inboundSchema:
|
|
50
|
+
z.ZodNativeEnum<typeof EvaluatorResponseJsonSchemaOutputType> = z.nativeEnum(
|
|
51
|
+
EvaluatorResponseJsonSchemaOutputType,
|
|
52
|
+
);
|
|
53
|
+
|
|
27
54
|
/** @internal */
|
|
28
55
|
export const EvaluatorResponseJsonSchema$inboundSchema: z.ZodType<
|
|
29
56
|
EvaluatorResponseJsonSchema,
|
|
@@ -38,6 +65,7 @@ export const EvaluatorResponseJsonSchema$inboundSchema: z.ZodType<
|
|
|
38
65
|
project_id: z.string().optional(),
|
|
39
66
|
guardrail_config: z.any().optional(),
|
|
40
67
|
type: z.literal("json_schema"),
|
|
68
|
+
output_type: EvaluatorResponseJsonSchemaOutputType$inboundSchema,
|
|
41
69
|
schema: z.string(),
|
|
42
70
|
key: z.string(),
|
|
43
71
|
}).transform((v) => {
|
|
@@ -46,6 +74,7 @@ export const EvaluatorResponseJsonSchema$inboundSchema: z.ZodType<
|
|
|
46
74
|
"updated_by_id": "updatedById",
|
|
47
75
|
"project_id": "projectId",
|
|
48
76
|
"guardrail_config": "guardrailConfig",
|
|
77
|
+
"output_type": "outputType",
|
|
49
78
|
});
|
|
50
79
|
});
|
|
51
80
|
|
|
@@ -9,6 +9,20 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The type of output expected from the evaluator
|
|
14
|
+
*/
|
|
15
|
+
export const OutputType = {
|
|
16
|
+
Boolean: "boolean",
|
|
17
|
+
Categorical: "categorical",
|
|
18
|
+
Number: "number",
|
|
19
|
+
String: "string",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The type of output expected from the evaluator
|
|
23
|
+
*/
|
|
24
|
+
export type OutputType = ClosedEnum<typeof OutputType>;
|
|
25
|
+
|
|
12
26
|
export type CategoricalLabels = {
|
|
13
27
|
value: string;
|
|
14
28
|
description?: string | undefined;
|
|
@@ -74,6 +88,10 @@ export type EvaluatorResponseLlm = {
|
|
|
74
88
|
projectId?: string | undefined;
|
|
75
89
|
guardrailConfig?: any | undefined;
|
|
76
90
|
type: "llm_eval";
|
|
91
|
+
/**
|
|
92
|
+
* The type of output expected from the evaluator
|
|
93
|
+
*/
|
|
94
|
+
outputType: OutputType;
|
|
77
95
|
repetitions?: number | null | undefined;
|
|
78
96
|
prompt: string;
|
|
79
97
|
categories?: Array<string> | null | undefined;
|
|
@@ -85,6 +103,10 @@ export type EvaluatorResponseLlm = {
|
|
|
85
103
|
jury?: Jury | undefined;
|
|
86
104
|
};
|
|
87
105
|
|
|
106
|
+
/** @internal */
|
|
107
|
+
export const OutputType$inboundSchema: z.ZodNativeEnum<typeof OutputType> = z
|
|
108
|
+
.nativeEnum(OutputType);
|
|
109
|
+
|
|
88
110
|
/** @internal */
|
|
89
111
|
export const CategoricalLabels$inboundSchema: z.ZodType<
|
|
90
112
|
CategoricalLabels,
|
|
@@ -277,6 +299,7 @@ export const EvaluatorResponseLlm$inboundSchema: z.ZodType<
|
|
|
277
299
|
project_id: z.string().optional(),
|
|
278
300
|
guardrail_config: z.any().optional(),
|
|
279
301
|
type: z.literal("llm_eval"),
|
|
302
|
+
output_type: OutputType$inboundSchema,
|
|
280
303
|
repetitions: z.nullable(z.number().int()).optional(),
|
|
281
304
|
prompt: z.string(),
|
|
282
305
|
categories: z.nullable(z.array(z.string())).optional(),
|
|
@@ -294,6 +317,7 @@ export const EvaluatorResponseLlm$inboundSchema: z.ZodType<
|
|
|
294
317
|
"updated_by_id": "updatedById",
|
|
295
318
|
"project_id": "projectId",
|
|
296
319
|
"guardrail_config": "guardrailConfig",
|
|
320
|
+
"output_type": "outputType",
|
|
297
321
|
"categorical_labels": "categoricalLabels",
|
|
298
322
|
"dataset_id": "datasetId",
|
|
299
323
|
});
|
|
@@ -5,9 +5,26 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The type of output expected from the evaluator
|
|
14
|
+
*/
|
|
15
|
+
export const EvaluatorResponsePythonOutputType = {
|
|
16
|
+
Boolean: "boolean",
|
|
17
|
+
Categorical: "categorical",
|
|
18
|
+
Number: "number",
|
|
19
|
+
String: "string",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The type of output expected from the evaluator
|
|
23
|
+
*/
|
|
24
|
+
export type EvaluatorResponsePythonOutputType = ClosedEnum<
|
|
25
|
+
typeof EvaluatorResponsePythonOutputType
|
|
26
|
+
>;
|
|
27
|
+
|
|
11
28
|
export type EvaluatorResponsePython = {
|
|
12
29
|
id: string;
|
|
13
30
|
description: string;
|
|
@@ -21,9 +38,18 @@ export type EvaluatorResponsePython = {
|
|
|
21
38
|
guardrailConfig?: any | undefined;
|
|
22
39
|
code: string;
|
|
23
40
|
type: "python_eval";
|
|
41
|
+
/**
|
|
42
|
+
* The type of output expected from the evaluator
|
|
43
|
+
*/
|
|
44
|
+
outputType: EvaluatorResponsePythonOutputType;
|
|
24
45
|
key: string;
|
|
25
46
|
};
|
|
26
47
|
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const EvaluatorResponsePythonOutputType$inboundSchema: z.ZodNativeEnum<
|
|
50
|
+
typeof EvaluatorResponsePythonOutputType
|
|
51
|
+
> = z.nativeEnum(EvaluatorResponsePythonOutputType);
|
|
52
|
+
|
|
27
53
|
/** @internal */
|
|
28
54
|
export const EvaluatorResponsePython$inboundSchema: z.ZodType<
|
|
29
55
|
EvaluatorResponsePython,
|
|
@@ -39,6 +65,7 @@ export const EvaluatorResponsePython$inboundSchema: z.ZodType<
|
|
|
39
65
|
guardrail_config: z.any().optional(),
|
|
40
66
|
code: z.string(),
|
|
41
67
|
type: z.literal("python_eval"),
|
|
68
|
+
output_type: EvaluatorResponsePythonOutputType$inboundSchema,
|
|
42
69
|
key: z.string(),
|
|
43
70
|
}).transform((v) => {
|
|
44
71
|
return remap$(v, {
|
|
@@ -46,6 +73,7 @@ export const EvaluatorResponsePython$inboundSchema: z.ZodType<
|
|
|
46
73
|
"updated_by_id": "updatedById",
|
|
47
74
|
"project_id": "projectId",
|
|
48
75
|
"guardrail_config": "guardrailConfig",
|
|
76
|
+
"output_type": "outputType",
|
|
49
77
|
});
|
|
50
78
|
});
|
|
51
79
|
|
|
@@ -9,6 +9,22 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The type of output expected from the evaluator
|
|
14
|
+
*/
|
|
15
|
+
export const EvaluatorResponseRagasOutputType = {
|
|
16
|
+
Boolean: "boolean",
|
|
17
|
+
Categorical: "categorical",
|
|
18
|
+
Number: "number",
|
|
19
|
+
String: "string",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The type of output expected from the evaluator
|
|
23
|
+
*/
|
|
24
|
+
export type EvaluatorResponseRagasOutputType = ClosedEnum<
|
|
25
|
+
typeof EvaluatorResponseRagasOutputType
|
|
26
|
+
>;
|
|
27
|
+
|
|
12
28
|
export const RagasMetric = {
|
|
13
29
|
ContextPrecision: "context_precision",
|
|
14
30
|
ContextRecall: "context_recall",
|
|
@@ -37,11 +53,20 @@ export type EvaluatorResponseRagas = {
|
|
|
37
53
|
projectId?: string | undefined;
|
|
38
54
|
guardrailConfig?: any | undefined;
|
|
39
55
|
type: "ragas";
|
|
56
|
+
/**
|
|
57
|
+
* The type of output expected from the evaluator
|
|
58
|
+
*/
|
|
59
|
+
outputType: EvaluatorResponseRagasOutputType;
|
|
40
60
|
ragasMetric: RagasMetric;
|
|
41
61
|
key: string;
|
|
42
62
|
model: string;
|
|
43
63
|
};
|
|
44
64
|
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const EvaluatorResponseRagasOutputType$inboundSchema: z.ZodNativeEnum<
|
|
67
|
+
typeof EvaluatorResponseRagasOutputType
|
|
68
|
+
> = z.nativeEnum(EvaluatorResponseRagasOutputType);
|
|
69
|
+
|
|
45
70
|
/** @internal */
|
|
46
71
|
export const RagasMetric$inboundSchema: z.ZodNativeEnum<typeof RagasMetric> = z
|
|
47
72
|
.nativeEnum(RagasMetric);
|
|
@@ -60,6 +85,7 @@ export const EvaluatorResponseRagas$inboundSchema: z.ZodType<
|
|
|
60
85
|
project_id: z.string().optional(),
|
|
61
86
|
guardrail_config: z.any().optional(),
|
|
62
87
|
type: z.literal("ragas"),
|
|
88
|
+
output_type: EvaluatorResponseRagasOutputType$inboundSchema,
|
|
63
89
|
ragas_metric: RagasMetric$inboundSchema,
|
|
64
90
|
key: z.string(),
|
|
65
91
|
model: z.string(),
|
|
@@ -69,6 +95,7 @@ export const EvaluatorResponseRagas$inboundSchema: z.ZodType<
|
|
|
69
95
|
"updated_by_id": "updatedById",
|
|
70
96
|
"project_id": "projectId",
|
|
71
97
|
"guardrail_config": "guardrailConfig",
|
|
98
|
+
"output_type": "outputType",
|
|
72
99
|
"ragas_metric": "ragasMetric",
|
|
73
100
|
});
|
|
74
101
|
});
|
|
@@ -5,9 +5,26 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The type of output expected from the evaluator
|
|
14
|
+
*/
|
|
15
|
+
export const EvaluatorResponseTypescriptOutputType = {
|
|
16
|
+
Boolean: "boolean",
|
|
17
|
+
Categorical: "categorical",
|
|
18
|
+
Number: "number",
|
|
19
|
+
String: "string",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* The type of output expected from the evaluator
|
|
23
|
+
*/
|
|
24
|
+
export type EvaluatorResponseTypescriptOutputType = ClosedEnum<
|
|
25
|
+
typeof EvaluatorResponseTypescriptOutputType
|
|
26
|
+
>;
|
|
27
|
+
|
|
11
28
|
export type EvaluatorResponseTypescript = {
|
|
12
29
|
id: string;
|
|
13
30
|
description: string;
|
|
@@ -21,9 +38,19 @@ export type EvaluatorResponseTypescript = {
|
|
|
21
38
|
guardrailConfig?: any | undefined;
|
|
22
39
|
code: string;
|
|
23
40
|
type: "typescript_eval";
|
|
41
|
+
/**
|
|
42
|
+
* The type of output expected from the evaluator
|
|
43
|
+
*/
|
|
44
|
+
outputType: EvaluatorResponseTypescriptOutputType;
|
|
24
45
|
key: string;
|
|
25
46
|
};
|
|
26
47
|
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const EvaluatorResponseTypescriptOutputType$inboundSchema:
|
|
50
|
+
z.ZodNativeEnum<typeof EvaluatorResponseTypescriptOutputType> = z.nativeEnum(
|
|
51
|
+
EvaluatorResponseTypescriptOutputType,
|
|
52
|
+
);
|
|
53
|
+
|
|
27
54
|
/** @internal */
|
|
28
55
|
export const EvaluatorResponseTypescript$inboundSchema: z.ZodType<
|
|
29
56
|
EvaluatorResponseTypescript,
|
|
@@ -39,6 +66,7 @@ export const EvaluatorResponseTypescript$inboundSchema: z.ZodType<
|
|
|
39
66
|
guardrail_config: z.any().optional(),
|
|
40
67
|
code: z.string(),
|
|
41
68
|
type: z.literal("typescript_eval"),
|
|
69
|
+
output_type: EvaluatorResponseTypescriptOutputType$inboundSchema,
|
|
42
70
|
key: z.string(),
|
|
43
71
|
}).transform((v) => {
|
|
44
72
|
return remap$(v, {
|
|
@@ -46,6 +74,7 @@ export const EvaluatorResponseTypescript$inboundSchema: z.ZodType<
|
|
|
46
74
|
"updated_by_id": "updatedById",
|
|
47
75
|
"project_id": "projectId",
|
|
48
76
|
"guardrail_config": "guardrailConfig",
|
|
77
|
+
"output_type": "outputType",
|
|
49
78
|
});
|
|
50
79
|
});
|
|
51
80
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type Items = {};
|
|
12
|
+
|
|
13
|
+
export type GetTraceConversationResponse = {
|
|
14
|
+
traceId?: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Span the items were read from; empty when the trace holds no model call. Read its detail with GetTraceSpan.
|
|
17
|
+
*/
|
|
18
|
+
spanId?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Ordered OpenResponses items, including recorded instructions as a leading system message.
|
|
21
|
+
*/
|
|
22
|
+
items?: Array<Items> | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const Items$inboundSchema: z.ZodType<Items, z.ZodTypeDef, unknown> = z
|
|
27
|
+
.object({});
|
|
28
|
+
|
|
29
|
+
export function itemsFromJSON(
|
|
30
|
+
jsonString: string,
|
|
31
|
+
): SafeParseResult<Items, SDKValidationError> {
|
|
32
|
+
return safeParse(
|
|
33
|
+
jsonString,
|
|
34
|
+
(x) => Items$inboundSchema.parse(JSON.parse(x)),
|
|
35
|
+
`Failed to parse 'Items' from JSON`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const GetTraceConversationResponse$inboundSchema: z.ZodType<
|
|
41
|
+
GetTraceConversationResponse,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.object({
|
|
45
|
+
trace_id: z.string().optional(),
|
|
46
|
+
span_id: z.string().optional(),
|
|
47
|
+
items: z.array(z.lazy(() => Items$inboundSchema)).optional(),
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
"trace_id": "traceId",
|
|
51
|
+
"span_id": "spanId",
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export function getTraceConversationResponseFromJSON(
|
|
56
|
+
jsonString: string,
|
|
57
|
+
): SafeParseResult<GetTraceConversationResponse, SDKValidationError> {
|
|
58
|
+
return safeParse(
|
|
59
|
+
jsonString,
|
|
60
|
+
(x) => GetTraceConversationResponse$inboundSchema.parse(JSON.parse(x)),
|
|
61
|
+
`Failed to parse 'GetTraceConversationResponse' from JSON`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -249,6 +249,7 @@ export * from "./getskillresponse.js";
|
|
|
249
249
|
export * from "./getsmartrouterresponse.js";
|
|
250
250
|
export * from "./getthreadcountrequest.js";
|
|
251
251
|
export * from "./getthreadcountresponse.js";
|
|
252
|
+
export * from "./gettraceconversationresponse.js";
|
|
252
253
|
export * from "./gettraceresponse.js";
|
|
253
254
|
export * from "./gettracespanresponse.js";
|
|
254
255
|
export * from "./getuploadfileurlresponse.js";
|