@orq-ai/node 4.17.18 → 4.17.20

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 (69) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/modelmetadata.d.ts +2 -0
  5. package/models/components/modelmetadata.d.ts.map +1 -1
  6. package/models/components/modelmetadata.js +4 -0
  7. package/models/components/modelmetadata.js.map +1 -1
  8. package/models/components/reasoningpart.js +1 -1
  9. package/models/operations/createtool.js +4 -4
  10. package/models/operations/getalltools.js +4 -4
  11. package/models/operations/getv2humanevalsets.js +2 -2
  12. package/models/operations/getv2humanevalsetsid.js +2 -2
  13. package/models/operations/listdeploymentversions.js +1 -1
  14. package/models/operations/patchv2humanevalsetsid.js +2 -2
  15. package/models/operations/postv2humanevalsets.js +2 -2
  16. package/models/operations/retrievetool.js +4 -4
  17. package/models/operations/runagent.js +1 -1
  18. package/models/operations/streamrunagent.js +1 -1
  19. package/models/operations/updatetool.js +4 -4
  20. package/package.json +8 -8
  21. package/packages/orq-rc/src/lib/config.ts +3 -3
  22. package/packages/orq-rc/src/models/components/mcptool.ts +52 -0
  23. package/packages/orq-rc/src/models/components/mcptoolannotations.ts +7 -2
  24. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  25. package/packages/orq-rc/src/models/components/updatedatasetrequest.ts +6 -0
  26. package/packages/orq-rc/src/models/operations/createeval.ts +7 -11
  27. package/packages/orq-rc/src/models/operations/createprompt.ts +1 -0
  28. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  29. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +1 -0
  30. package/packages/orq-rc/src/models/operations/deployments.ts +1 -0
  31. package/packages/orq-rc/src/models/operations/deploymentstream.ts +1 -0
  32. package/packages/orq-rc/src/models/operations/getallprompts.ts +1 -0
  33. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  34. package/packages/orq-rc/src/models/operations/getoneprompt.ts +1 -0
  35. package/packages/orq-rc/src/models/operations/getpromptversion.ts +1 -0
  36. package/packages/orq-rc/src/models/operations/index.ts +0 -5
  37. package/packages/orq-rc/src/models/operations/listdeploymentversions.ts +3 -1
  38. package/packages/orq-rc/src/models/operations/listpromptversions.ts +1 -0
  39. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  40. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  41. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  42. package/packages/orq-rc/src/models/operations/updateprompt.ts +1 -0
  43. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  44. package/packages/orq-rc/src/sdk/sdk.ts +0 -6
  45. package/src/lib/config.ts +2 -2
  46. package/src/models/components/modelmetadata.ts +6 -0
  47. package/src/models/components/reasoningpart.ts +1 -1
  48. package/src/models/operations/createtool.ts +4 -4
  49. package/src/models/operations/getalltools.ts +4 -4
  50. package/src/models/operations/getv2humanevalsets.ts +2 -2
  51. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  52. package/src/models/operations/listdeploymentversions.ts +1 -1
  53. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  54. package/src/models/operations/postv2humanevalsets.ts +2 -2
  55. package/src/models/operations/retrievetool.ts +4 -4
  56. package/src/models/operations/runagent.ts +1 -1
  57. package/src/models/operations/streamrunagent.ts +1 -1
  58. package/src/models/operations/updatetool.ts +4 -4
  59. package/packages/orq-rc/src/funcs/humanReviewSetsCreate.ts +0 -178
  60. package/packages/orq-rc/src/funcs/humanReviewSetsDelete.ts +0 -180
  61. package/packages/orq-rc/src/funcs/humanReviewSetsGet.ts +0 -179
  62. package/packages/orq-rc/src/funcs/humanReviewSetsList.ts +0 -181
  63. package/packages/orq-rc/src/funcs/humanReviewSetsUpdate.ts +0 -180
  64. package/packages/orq-rc/src/models/operations/deletev2humanevalsetsid.ts +0 -36
  65. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +0 -234
  66. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +0 -235
  67. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +0 -415
  68. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +0 -351
  69. package/packages/orq-rc/src/sdk/humanreviewsets.ts +0 -109
@@ -257,7 +257,7 @@ export const PostV2HumanEvalSetsResponseBody2$inboundSchema: z.ZodType<
257
257
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
258
258
  .optional(),
259
259
  updated: z.string().datetime({ offset: true }).default(
260
- "2026-10-28T22:15:11.890Z",
260
+ "2026-10-30T13:59:58.768Z",
261
261
  ).transform(v => new Date(v)),
262
262
  filter_type: z.literal("name"),
263
263
  filter_value: z.string(),
@@ -302,7 +302,7 @@ export const PostV2HumanEvalSetsResponseBody1$inboundSchema: z.ZodType<
302
302
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
303
303
  .optional(),
304
304
  updated: z.string().datetime({ offset: true }).default(
305
- "2026-10-28T22:15:11.890Z",
305
+ "2026-10-30T13:59:58.768Z",
306
306
  ).transform(v => new Date(v)),
307
307
  filter_type: z.literal("span_type"),
308
308
  filter_values: z.array(z.string()),
@@ -624,7 +624,7 @@ export const RetrieveToolResponseBodyCodeExecutionTool$inboundSchema: z.ZodType<
624
624
  z.ZodTypeDef,
625
625
  unknown
626
626
  > = z.object({
627
- _id: z.string().default("tool_01M6299X057JEBBFQQ1J10Z515"),
627
+ _id: z.string().default("tool_01M66HRNY2F61DPD7BTKBEPTHK"),
628
628
  path: z.string(),
629
629
  key: z.string(),
630
630
  display_name: z.string().optional(),
@@ -820,7 +820,7 @@ export const RetrieveToolResponseBodyHTTPTool$inboundSchema: z.ZodType<
820
820
  z.ZodTypeDef,
821
821
  unknown
822
822
  > = z.object({
823
- _id: z.string().default("tool_01M6299X04H4KGAB67NWFVAQYZ"),
823
+ _id: z.string().default("tool_01M66HRNXZEZD7WDG2AATP3C3Y"),
824
824
  path: z.string(),
825
825
  key: z.string(),
826
826
  display_name: z.string().optional(),
@@ -916,7 +916,7 @@ export const RetrieveToolResponseBodyJSONSchemaTool$inboundSchema: z.ZodType<
916
916
  z.ZodTypeDef,
917
917
  unknown
918
918
  > = z.object({
919
- _id: z.string().default("tool_01M6299X04CNXJE5TE197FGVHV"),
919
+ _id: z.string().default("tool_01M66HRNXYS06XRB3ADXDGTMZR"),
920
920
  path: z.string(),
921
921
  key: z.string(),
922
922
  display_name: z.string().optional(),
@@ -1022,7 +1022,7 @@ export const RetrieveToolResponseBodyFunctionTool$inboundSchema: z.ZodType<
1022
1022
  z.ZodTypeDef,
1023
1023
  unknown
1024
1024
  > = z.object({
1025
- _id: z.string().default("tool_01M6299X04FRXJ89HYP2FDQDAB"),
1025
+ _id: z.string().default("tool_01M66HRNXXZNF4ZSGAVQYVX14G"),
1026
1026
  path: z.string(),
1027
1027
  key: z.string(),
1028
1028
  display_name: z.string().optional(),
@@ -3906,7 +3906,7 @@ export const Tools$outboundSchema: z.ZodType<
3906
3906
  z.ZodTypeDef,
3907
3907
  Tools
3908
3908
  > = z.object({
3909
- id: z.string().default("01M6299WYGHQPY999XFD2552YM"),
3909
+ id: z.string().default("01M66HRNTM209VMJJCN653VY3V"),
3910
3910
  name: z.string(),
3911
3911
  description: z.string().optional(),
3912
3912
  schema: z.lazy(() => AgentToolInputRunSchema$outboundSchema),
@@ -3965,7 +3965,7 @@ export const AgentToolInputRunTools$outboundSchema: z.ZodType<
3965
3965
  z.ZodTypeDef,
3966
3966
  AgentToolInputRunTools
3967
3967
  > = z.object({
3968
- id: z.string().default("01M6299WYVCPZD1G7J98TBTSBT"),
3968
+ id: z.string().default("01M66HRNVDZ7FYQCRPNYCMFQC4"),
3969
3969
  name: z.string(),
3970
3970
  description: z.string().optional(),
3971
3971
  schema: z.lazy(() =>
@@ -1764,7 +1764,7 @@ export const UpdateToolResponseBodyCodeExecutionTool$inboundSchema: z.ZodType<
1764
1764
  z.ZodTypeDef,
1765
1765
  unknown
1766
1766
  > = z.object({
1767
- _id: z.string().default("tool_01M6299X00C4ZGWCXYK78CQ0N2"),
1767
+ _id: z.string().default("tool_01M66HRNXPNBRG74JNCN7QRG7Q"),
1768
1768
  path: z.string(),
1769
1769
  key: z.string(),
1770
1770
  display_name: z.string().optional(),
@@ -1959,7 +1959,7 @@ export const UpdateToolResponseBodyHTTPTool$inboundSchema: z.ZodType<
1959
1959
  z.ZodTypeDef,
1960
1960
  unknown
1961
1961
  > = z.object({
1962
- _id: z.string().default("tool_01M6299X00CCGB0QG4B9AJZFH7"),
1962
+ _id: z.string().default("tool_01M66HRNXNFJSAYVYX0D1HGREN"),
1963
1963
  path: z.string(),
1964
1964
  key: z.string(),
1965
1965
  display_name: z.string().optional(),
@@ -2054,7 +2054,7 @@ export const UpdateToolResponseBodyJSONSchemaTool$inboundSchema: z.ZodType<
2054
2054
  z.ZodTypeDef,
2055
2055
  unknown
2056
2056
  > = z.object({
2057
- _id: z.string().default("tool_01M6299WZZPB75FA06JK4QKXVD"),
2057
+ _id: z.string().default("tool_01M66HRNXN843518S1TP9MCPCK"),
2058
2058
  path: z.string(),
2059
2059
  key: z.string(),
2060
2060
  display_name: z.string().optional(),
@@ -2157,7 +2157,7 @@ export const UpdateToolResponseBodyFunctionTool$inboundSchema: z.ZodType<
2157
2157
  z.ZodTypeDef,
2158
2158
  unknown
2159
2159
  > = z.object({
2160
- _id: z.string().default("tool_01M6299WZZT26Q132PY2M5AE1G"),
2160
+ _id: z.string().default("tool_01M66HRNXMYW0B4GJ07FHY2HS4"),
2161
2161
  path: z.string(),
2162
2162
  key: z.string(),
2163
2163
  display_name: z.string().optional(),
@@ -1,178 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { OrqCore } from "../core.js";
6
- import { encodeJSON } 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 {
15
- ConnectionError,
16
- InvalidRequestError,
17
- RequestAbortedError,
18
- RequestTimeoutError,
19
- UnexpectedClientError,
20
- } from "../models/errors/httpclienterrors.js";
21
- import * as errors from "../models/errors/index.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
- * Create a human review set
31
- *
32
- * @remarks
33
- * Deprecated: Human Review Sets are replaced by project-level human reviews (Annotations) and will be removed in release 4.18.
34
- *
35
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
36
- */
37
- export function humanReviewSetsCreate(
38
- client: OrqCore,
39
- request?: operations.PostV2HumanEvalSetsRequestBody | undefined,
40
- options?: RequestOptions,
41
- ): APIPromise<
42
- Result<
43
- operations.PostV2HumanEvalSetsResponseBody,
44
- | errors.ErrorResponse
45
- | OrqError
46
- | ResponseValidationError
47
- | ConnectionError
48
- | RequestAbortedError
49
- | RequestTimeoutError
50
- | InvalidRequestError
51
- | UnexpectedClientError
52
- | SDKValidationError
53
- >
54
- > {
55
- return new APIPromise($do(
56
- client,
57
- request,
58
- options,
59
- ));
60
- }
61
-
62
- async function $do(
63
- client: OrqCore,
64
- request?: operations.PostV2HumanEvalSetsRequestBody | undefined,
65
- options?: RequestOptions,
66
- ): Promise<
67
- [
68
- Result<
69
- operations.PostV2HumanEvalSetsResponseBody,
70
- | errors.ErrorResponse
71
- | OrqError
72
- | ResponseValidationError
73
- | ConnectionError
74
- | RequestAbortedError
75
- | RequestTimeoutError
76
- | InvalidRequestError
77
- | UnexpectedClientError
78
- | SDKValidationError
79
- >,
80
- APICall,
81
- ]
82
- > {
83
- const parsed = safeParse(
84
- request,
85
- (value) =>
86
- operations.PostV2HumanEvalSetsRequestBody$outboundSchema.optional().parse(
87
- value,
88
- ),
89
- "Input validation failed",
90
- );
91
- if (!parsed.ok) {
92
- return [parsed, { status: "invalid" }];
93
- }
94
- const payload = parsed.value;
95
- const body = payload === undefined
96
- ? null
97
- : encodeJSON("body", payload, { explode: true });
98
-
99
- const path = pathToFunc("/v2/human-eval-sets")();
100
-
101
- const headers = new Headers(compactMap({
102
- "Content-Type": "application/json",
103
- Accept: "application/json",
104
- }));
105
-
106
- const secConfig = await extractSecurity(client._options.apiKey);
107
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
108
- const requestSecurity = resolveGlobalSecurity(securityInput);
109
-
110
- const context = {
111
- options: client._options,
112
- baseURL: options?.serverURL ?? client._baseURL ?? "",
113
- operationID: "post_/v2/human-eval-sets",
114
- oAuth2Scopes: null,
115
-
116
- resolvedSecurity: requestSecurity,
117
-
118
- securitySource: client._options.apiKey,
119
- retryConfig: options?.retries
120
- || client._options.retryConfig
121
- || { strategy: "none" },
122
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
123
- };
124
-
125
- const requestRes = client._createRequest(context, {
126
- security: requestSecurity,
127
- method: "POST",
128
- baseURL: options?.serverURL,
129
- path: path,
130
- headers: headers,
131
- body: body,
132
- userAgent: client._options.userAgent,
133
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
134
- }, options);
135
- if (!requestRes.ok) {
136
- return [requestRes, { status: "invalid" }];
137
- }
138
- const req = requestRes.value;
139
-
140
- const doResult = await client._do(req, {
141
- context,
142
- isErrorStatusCode: (statusCode: number) =>
143
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
144
- retryConfig: context.retryConfig,
145
- retryCodes: context.retryCodes,
146
- });
147
- if (!doResult.ok) {
148
- return [doResult, { status: "request-error", request: req }];
149
- }
150
- const response = doResult.value;
151
-
152
- const responseFields = {
153
- HttpMeta: { Response: response, Request: req },
154
- };
155
-
156
- const [result] = await M.match<
157
- operations.PostV2HumanEvalSetsResponseBody,
158
- | errors.ErrorResponse
159
- | OrqError
160
- | ResponseValidationError
161
- | ConnectionError
162
- | RequestAbortedError
163
- | RequestTimeoutError
164
- | InvalidRequestError
165
- | UnexpectedClientError
166
- | SDKValidationError
167
- >(
168
- M.json(200, operations.PostV2HumanEvalSetsResponseBody$inboundSchema),
169
- M.jsonErr(401, errors.ErrorResponse$inboundSchema),
170
- M.fail("4XX"),
171
- M.fail("5XX"),
172
- )(response, req, { extraFields: responseFields });
173
- if (!result.ok) {
174
- return [result, { status: "complete", request: req, response }];
175
- }
176
-
177
- return [result, { status: "complete", request: req, response }];
178
- }
@@ -1,180 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { OrqCore } from "../core.js";
7
- import { encodeSimple } from "../lib/encodings.js";
8
- import { matchStatusCode } from "../lib/http.js";
9
- import * as M from "../lib/matchers.js";
10
- import { compactMap } from "../lib/primitives.js";
11
- import { safeParse } from "../lib/schemas.js";
12
- import { RequestOptions } from "../lib/sdks.js";
13
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
14
- import { pathToFunc } from "../lib/url.js";
15
- import {
16
- ConnectionError,
17
- InvalidRequestError,
18
- RequestAbortedError,
19
- RequestTimeoutError,
20
- UnexpectedClientError,
21
- } from "../models/errors/httpclienterrors.js";
22
- import * as errors from "../models/errors/index.js";
23
- import { OrqError } from "../models/errors/orqerror.js";
24
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
- import * as operations from "../models/operations/index.js";
27
- import { APICall, APIPromise } from "../types/async.js";
28
- import { Result } from "../types/fp.js";
29
-
30
- /**
31
- * Delete a human review set
32
- *
33
- * @remarks
34
- * Deprecated: Human Review Sets are replaced by project-level human reviews (Annotations) and will be removed in release 4.18.
35
- *
36
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
37
- */
38
- export function humanReviewSetsDelete(
39
- client: OrqCore,
40
- request: operations.DeleteV2HumanEvalSetsIdRequest,
41
- options?: RequestOptions,
42
- ): APIPromise<
43
- Result<
44
- void,
45
- | errors.ErrorResponse
46
- | OrqError
47
- | ResponseValidationError
48
- | ConnectionError
49
- | RequestAbortedError
50
- | RequestTimeoutError
51
- | InvalidRequestError
52
- | UnexpectedClientError
53
- | SDKValidationError
54
- >
55
- > {
56
- return new APIPromise($do(
57
- client,
58
- request,
59
- options,
60
- ));
61
- }
62
-
63
- async function $do(
64
- client: OrqCore,
65
- request: operations.DeleteV2HumanEvalSetsIdRequest,
66
- options?: RequestOptions,
67
- ): Promise<
68
- [
69
- Result<
70
- void,
71
- | errors.ErrorResponse
72
- | OrqError
73
- | ResponseValidationError
74
- | ConnectionError
75
- | RequestAbortedError
76
- | RequestTimeoutError
77
- | InvalidRequestError
78
- | UnexpectedClientError
79
- | SDKValidationError
80
- >,
81
- APICall,
82
- ]
83
- > {
84
- const parsed = safeParse(
85
- request,
86
- (value) =>
87
- operations.DeleteV2HumanEvalSetsIdRequest$outboundSchema.parse(value),
88
- "Input validation failed",
89
- );
90
- if (!parsed.ok) {
91
- return [parsed, { status: "invalid" }];
92
- }
93
- const payload = parsed.value;
94
- const body = null;
95
-
96
- const pathParams = {
97
- id: encodeSimple("id", payload.id, {
98
- explode: false,
99
- charEncoding: "percent",
100
- }),
101
- };
102
- const path = pathToFunc("/v2/human-eval-sets/{id}")(pathParams);
103
-
104
- const headers = new Headers(compactMap({
105
- Accept: "application/json",
106
- }));
107
-
108
- const secConfig = await extractSecurity(client._options.apiKey);
109
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
110
- const requestSecurity = resolveGlobalSecurity(securityInput);
111
-
112
- const context = {
113
- options: client._options,
114
- baseURL: options?.serverURL ?? client._baseURL ?? "",
115
- operationID: "delete_/v2/human-eval-sets/{id}",
116
- oAuth2Scopes: null,
117
-
118
- resolvedSecurity: requestSecurity,
119
-
120
- securitySource: client._options.apiKey,
121
- retryConfig: options?.retries
122
- || client._options.retryConfig
123
- || { strategy: "none" },
124
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
125
- };
126
-
127
- const requestRes = client._createRequest(context, {
128
- security: requestSecurity,
129
- method: "DELETE",
130
- baseURL: options?.serverURL,
131
- path: path,
132
- headers: headers,
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 responseFields = {
155
- HttpMeta: { Response: response, Request: req },
156
- };
157
-
158
- const [result] = await M.match<
159
- void,
160
- | errors.ErrorResponse
161
- | OrqError
162
- | ResponseValidationError
163
- | ConnectionError
164
- | RequestAbortedError
165
- | RequestTimeoutError
166
- | InvalidRequestError
167
- | UnexpectedClientError
168
- | SDKValidationError
169
- >(
170
- M.nil(200, z.void()),
171
- M.jsonErr(401, errors.ErrorResponse$inboundSchema),
172
- M.fail("4XX"),
173
- M.fail("5XX"),
174
- )(response, req, { extraFields: responseFields });
175
- if (!result.ok) {
176
- return [result, { status: "complete", request: req, response }];
177
- }
178
-
179
- return [result, { status: "complete", request: req, response }];
180
- }
@@ -1,179 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { OrqCore } from "../core.js";
6
- import { 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 {
15
- ConnectionError,
16
- InvalidRequestError,
17
- RequestAbortedError,
18
- RequestTimeoutError,
19
- UnexpectedClientError,
20
- } from "../models/errors/httpclienterrors.js";
21
- import * as errors from "../models/errors/index.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 a human review set by ID
31
- *
32
- * @remarks
33
- * Deprecated: Human Review Sets are replaced by project-level human reviews (Annotations) and will be removed in release 4.18.
34
- *
35
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
36
- */
37
- export function humanReviewSetsGet(
38
- client: OrqCore,
39
- request: operations.GetV2HumanEvalSetsIdRequest,
40
- options?: RequestOptions,
41
- ): APIPromise<
42
- Result<
43
- operations.GetV2HumanEvalSetsIdResponseBody,
44
- | errors.ErrorResponse
45
- | OrqError
46
- | ResponseValidationError
47
- | ConnectionError
48
- | RequestAbortedError
49
- | RequestTimeoutError
50
- | InvalidRequestError
51
- | UnexpectedClientError
52
- | SDKValidationError
53
- >
54
- > {
55
- return new APIPromise($do(
56
- client,
57
- request,
58
- options,
59
- ));
60
- }
61
-
62
- async function $do(
63
- client: OrqCore,
64
- request: operations.GetV2HumanEvalSetsIdRequest,
65
- options?: RequestOptions,
66
- ): Promise<
67
- [
68
- Result<
69
- operations.GetV2HumanEvalSetsIdResponseBody,
70
- | errors.ErrorResponse
71
- | OrqError
72
- | ResponseValidationError
73
- | ConnectionError
74
- | RequestAbortedError
75
- | RequestTimeoutError
76
- | InvalidRequestError
77
- | UnexpectedClientError
78
- | SDKValidationError
79
- >,
80
- APICall,
81
- ]
82
- > {
83
- const parsed = safeParse(
84
- request,
85
- (value) =>
86
- operations.GetV2HumanEvalSetsIdRequest$outboundSchema.parse(value),
87
- "Input validation failed",
88
- );
89
- if (!parsed.ok) {
90
- return [parsed, { status: "invalid" }];
91
- }
92
- const payload = parsed.value;
93
- const body = null;
94
-
95
- const pathParams = {
96
- id: encodeSimple("id", payload.id, {
97
- explode: false,
98
- charEncoding: "percent",
99
- }),
100
- };
101
- const path = pathToFunc("/v2/human-eval-sets/{id}")(pathParams);
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: "get_/v2/human-eval-sets/{id}",
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
- body: body,
133
- userAgent: client._options.userAgent,
134
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
135
- }, options);
136
- if (!requestRes.ok) {
137
- return [requestRes, { status: "invalid" }];
138
- }
139
- const req = requestRes.value;
140
-
141
- const doResult = await client._do(req, {
142
- context,
143
- isErrorStatusCode: (statusCode: number) =>
144
- matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
145
- retryConfig: context.retryConfig,
146
- retryCodes: context.retryCodes,
147
- });
148
- if (!doResult.ok) {
149
- return [doResult, { status: "request-error", request: req }];
150
- }
151
- const response = doResult.value;
152
-
153
- const responseFields = {
154
- HttpMeta: { Response: response, Request: req },
155
- };
156
-
157
- const [result] = await M.match<
158
- operations.GetV2HumanEvalSetsIdResponseBody,
159
- | errors.ErrorResponse
160
- | OrqError
161
- | ResponseValidationError
162
- | ConnectionError
163
- | RequestAbortedError
164
- | RequestTimeoutError
165
- | InvalidRequestError
166
- | UnexpectedClientError
167
- | SDKValidationError
168
- >(
169
- M.json(200, operations.GetV2HumanEvalSetsIdResponseBody$inboundSchema),
170
- M.jsonErr([401, 404], errors.ErrorResponse$inboundSchema),
171
- M.fail("4XX"),
172
- M.fail("5XX"),
173
- )(response, req, { extraFields: responseFields });
174
- if (!result.ok) {
175
- return [result, { status: "complete", request: req, response }];
176
- }
177
-
178
- return [result, { status: "complete", request: req, response }];
179
- }