@orq-ai/node 3.8.0-rc.1 → 3.8.0-rc.2

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 (183) hide show
  1. package/README.md +92 -79
  2. package/bin/mcp-server.js +4626 -785
  3. package/bin/mcp-server.js.map +48 -32
  4. package/docs/sdks/evals/README.md +315 -14
  5. package/funcs/{evalsRunBertScore.d.ts → evalsAll.d.ts} +3 -3
  6. package/funcs/evalsAll.d.ts.map +1 -0
  7. package/funcs/evalsAll.js +120 -0
  8. package/funcs/evalsAll.js.map +1 -0
  9. package/funcs/evalsBertScore.d.ts +14 -0
  10. package/funcs/evalsBertScore.d.ts.map +1 -0
  11. package/funcs/{evalsRunBertScore.js → evalsBertScore.js} +6 -6
  12. package/funcs/evalsBertScore.js.map +1 -0
  13. package/funcs/evalsDelete.d.ts +14 -0
  14. package/funcs/evalsDelete.d.ts.map +1 -0
  15. package/funcs/evalsDelete.js +121 -0
  16. package/funcs/evalsDelete.js.map +1 -0
  17. package/funcs/evalsInvoke.d.ts +14 -0
  18. package/funcs/evalsInvoke.d.ts.map +1 -0
  19. package/funcs/evalsInvoke.js +121 -0
  20. package/funcs/evalsInvoke.js.map +1 -0
  21. package/funcs/evalsUpdate.d.ts +14 -0
  22. package/funcs/evalsUpdate.d.ts.map +1 -0
  23. package/funcs/evalsUpdate.js +121 -0
  24. package/funcs/evalsUpdate.js.map +1 -0
  25. package/jsr.json +1 -1
  26. package/lib/config.d.ts +2 -2
  27. package/lib/config.js +2 -2
  28. package/mcp-server/mcp-server.js +1 -1
  29. package/mcp-server/server.d.ts.map +1 -1
  30. package/mcp-server/server.js +11 -3
  31. package/mcp-server/server.js.map +1 -1
  32. package/mcp-server/tools/{evalsRunBertScore.d.ts → evalsAll.d.ts} +3 -3
  33. package/mcp-server/tools/evalsAll.d.ts.map +1 -0
  34. package/mcp-server/tools/evalsAll.js +62 -0
  35. package/mcp-server/tools/evalsAll.js.map +1 -0
  36. package/mcp-server/tools/evalsBertScore.d.ts +8 -0
  37. package/mcp-server/tools/evalsBertScore.d.ts.map +1 -0
  38. package/mcp-server/tools/{evalsRunBertScore.js → evalsBertScore.js} +7 -7
  39. package/mcp-server/tools/evalsBertScore.js.map +1 -0
  40. package/mcp-server/tools/evalsDelete.d.ts +8 -0
  41. package/mcp-server/tools/evalsDelete.d.ts.map +1 -0
  42. package/mcp-server/tools/evalsDelete.js +61 -0
  43. package/mcp-server/tools/evalsDelete.js.map +1 -0
  44. package/mcp-server/tools/evalsInvoke.d.ts +8 -0
  45. package/mcp-server/tools/evalsInvoke.d.ts.map +1 -0
  46. package/mcp-server/tools/evalsInvoke.js +62 -0
  47. package/mcp-server/tools/evalsInvoke.js.map +1 -0
  48. package/mcp-server/tools/evalsUpdate.d.ts +8 -0
  49. package/mcp-server/tools/evalsUpdate.d.ts.map +1 -0
  50. package/mcp-server/tools/evalsUpdate.js +62 -0
  51. package/mcp-server/tools/evalsUpdate.js.map +1 -0
  52. package/models/errors/deleteeval.d.ts +36 -0
  53. package/models/errors/deleteeval.d.ts.map +1 -0
  54. package/models/errors/deleteeval.js +79 -0
  55. package/models/errors/deleteeval.js.map +1 -0
  56. package/models/errors/evalsbertscore.d.ts +70 -0
  57. package/models/errors/evalsbertscore.d.ts.map +1 -0
  58. package/models/errors/evalsbertscore.js +117 -0
  59. package/models/errors/evalsbertscore.js.map +1 -0
  60. package/models/errors/getevals.d.ts +36 -0
  61. package/models/errors/getevals.d.ts.map +1 -0
  62. package/models/errors/getevals.js +79 -0
  63. package/models/errors/getevals.js.map +1 -0
  64. package/models/errors/index.d.ts +5 -1
  65. package/models/errors/index.d.ts.map +1 -1
  66. package/models/errors/index.js +5 -1
  67. package/models/errors/index.js.map +1 -1
  68. package/models/errors/invokeeval.d.ts +70 -0
  69. package/models/errors/invokeeval.d.ts.map +1 -0
  70. package/models/errors/{runbertscore.js → invokeeval.js} +30 -30
  71. package/models/errors/invokeeval.js.map +1 -0
  72. package/models/errors/updateeval.d.ts +36 -0
  73. package/models/errors/updateeval.d.ts.map +1 -0
  74. package/models/errors/updateeval.js +79 -0
  75. package/models/errors/updateeval.js.map +1 -0
  76. package/models/operations/createcontact.js +2 -2
  77. package/models/operations/createdataset.js +2 -2
  78. package/models/operations/createdatasetitem.js +2 -2
  79. package/models/operations/createdatasource.js +2 -2
  80. package/models/operations/createeval.js +16 -16
  81. package/models/operations/deleteeval.d.ts +29 -0
  82. package/models/operations/deleteeval.d.ts.map +1 -0
  83. package/models/operations/deleteeval.js +69 -0
  84. package/models/operations/deleteeval.js.map +1 -0
  85. package/models/operations/evalsbertscore.d.ts +88 -0
  86. package/models/operations/evalsbertscore.d.ts.map +1 -0
  87. package/models/operations/evalsbertscore.js +129 -0
  88. package/models/operations/evalsbertscore.js.map +1 -0
  89. package/models/operations/fileget.js +2 -2
  90. package/models/operations/filelist.js +2 -2
  91. package/models/operations/fileupload.js +2 -2
  92. package/models/operations/getevals.d.ts +2945 -0
  93. package/models/operations/getevals.d.ts.map +1 -0
  94. package/models/operations/getevals.js +3111 -0
  95. package/models/operations/getevals.js.map +1 -0
  96. package/models/operations/index.d.ts +5 -1
  97. package/models/operations/index.d.ts.map +1 -1
  98. package/models/operations/index.js +5 -1
  99. package/models/operations/index.js.map +1 -1
  100. package/models/operations/invokeeval.d.ts +1205 -0
  101. package/models/operations/invokeeval.d.ts.map +1 -0
  102. package/models/operations/invokeeval.js +1305 -0
  103. package/models/operations/invokeeval.js.map +1 -0
  104. package/models/operations/listcontacts.js +2 -2
  105. package/models/operations/listdatasetdatapoints.js +2 -2
  106. package/models/operations/listdatasets.js +2 -2
  107. package/models/operations/listdatasources.js +2 -2
  108. package/models/operations/retrievecontact.js +2 -2
  109. package/models/operations/retrievedatapoint.js +2 -2
  110. package/models/operations/retrievedataset.js +2 -2
  111. package/models/operations/retrievedatasource.js +2 -2
  112. package/models/operations/updatecontact.js +2 -2
  113. package/models/operations/updatedatapoint.js +2 -2
  114. package/models/operations/updatedataset.js +2 -2
  115. package/models/operations/updatedatasource.js +2 -2
  116. package/models/operations/updateeval.d.ts +1939 -0
  117. package/models/operations/updateeval.d.ts.map +1 -0
  118. package/models/operations/updateeval.js +2025 -0
  119. package/models/operations/updateeval.js.map +1 -0
  120. package/package.json +1 -1
  121. package/sdk/evals.d.ts +17 -1
  122. package/sdk/evals.d.ts.map +1 -1
  123. package/sdk/evals.js +31 -3
  124. package/sdk/evals.js.map +1 -1
  125. package/src/funcs/evalsAll.ts +169 -0
  126. package/src/funcs/{evalsRunBertScore.ts → evalsBertScore.ts} +19 -17
  127. package/src/funcs/evalsDelete.ts +169 -0
  128. package/src/funcs/evalsInvoke.ts +173 -0
  129. package/src/funcs/evalsUpdate.ts +169 -0
  130. package/src/lib/config.ts +2 -2
  131. package/src/mcp-server/mcp-server.ts +1 -1
  132. package/src/mcp-server/server.ts +11 -3
  133. package/src/mcp-server/tools/evalsAll.ts +35 -0
  134. package/src/mcp-server/tools/{evalsRunBertScore.ts → evalsBertScore.ts} +5 -5
  135. package/src/mcp-server/tools/evalsDelete.ts +33 -0
  136. package/src/mcp-server/tools/evalsInvoke.ts +35 -0
  137. package/src/mcp-server/tools/evalsUpdate.ts +35 -0
  138. package/src/models/errors/deleteeval.ts +71 -0
  139. package/src/models/errors/evalsbertscore.ts +137 -0
  140. package/src/models/errors/getevals.ts +71 -0
  141. package/src/models/errors/index.ts +5 -1
  142. package/src/models/errors/invokeeval.ts +137 -0
  143. package/src/models/errors/updateeval.ts +71 -0
  144. package/src/models/operations/createcontact.ts +2 -2
  145. package/src/models/operations/createdataset.ts +2 -2
  146. package/src/models/operations/createdatasetitem.ts +2 -2
  147. package/src/models/operations/createdatasource.ts +2 -2
  148. package/src/models/operations/createeval.ts +16 -16
  149. package/src/models/operations/deleteeval.ts +66 -0
  150. package/src/models/operations/evalsbertscore.ts +197 -0
  151. package/src/models/operations/fileget.ts +2 -2
  152. package/src/models/operations/filelist.ts +2 -2
  153. package/src/models/operations/fileupload.ts +2 -2
  154. package/src/models/operations/getevals.ts +6187 -0
  155. package/src/models/operations/index.ts +5 -1
  156. package/src/models/operations/invokeeval.ts +2492 -0
  157. package/src/models/operations/listcontacts.ts +2 -2
  158. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  159. package/src/models/operations/listdatasets.ts +2 -2
  160. package/src/models/operations/listdatasources.ts +2 -2
  161. package/src/models/operations/retrievecontact.ts +2 -2
  162. package/src/models/operations/retrievedatapoint.ts +2 -2
  163. package/src/models/operations/retrievedataset.ts +2 -2
  164. package/src/models/operations/retrievedatasource.ts +2 -2
  165. package/src/models/operations/updatecontact.ts +2 -2
  166. package/src/models/operations/updatedatapoint.ts +2 -2
  167. package/src/models/operations/updatedataset.ts +2 -2
  168. package/src/models/operations/updatedatasource.ts +2 -2
  169. package/src/models/operations/updateeval.ts +4131 -0
  170. package/src/sdk/evals.ts +65 -5
  171. package/funcs/evalsRunBertScore.d.ts.map +0 -1
  172. package/funcs/evalsRunBertScore.js.map +0 -1
  173. package/mcp-server/tools/evalsRunBertScore.d.ts.map +0 -1
  174. package/mcp-server/tools/evalsRunBertScore.js.map +0 -1
  175. package/models/errors/runbertscore.d.ts +0 -70
  176. package/models/errors/runbertscore.d.ts.map +0 -1
  177. package/models/errors/runbertscore.js.map +0 -1
  178. package/models/operations/runbertscore.d.ts +0 -88
  179. package/models/operations/runbertscore.d.ts.map +0 -1
  180. package/models/operations/runbertscore.js +0 -129
  181. package/models/operations/runbertscore.js.map +0 -1
  182. package/src/models/errors/runbertscore.ts +0 -137
  183. package/src/models/operations/runbertscore.ts +0 -197
@@ -0,0 +1,169 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { OrqCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.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 { APIError } from "../models/errors/apierror.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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Delete an Evaluator
30
+ */
31
+ export function evalsDelete(
32
+ client: OrqCore,
33
+ request: operations.DeleteEvalRequest,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ void,
38
+ | errors.DeleteEvalResponseBody
39
+ | APIError
40
+ | SDKValidationError
41
+ | UnexpectedClientError
42
+ | InvalidRequestError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | ConnectionError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ request,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ async function $do(
56
+ client: OrqCore,
57
+ request: operations.DeleteEvalRequest,
58
+ options?: RequestOptions,
59
+ ): Promise<
60
+ [
61
+ Result<
62
+ void,
63
+ | errors.DeleteEvalResponseBody
64
+ | APIError
65
+ | SDKValidationError
66
+ | UnexpectedClientError
67
+ | InvalidRequestError
68
+ | RequestAbortedError
69
+ | RequestTimeoutError
70
+ | ConnectionError
71
+ >,
72
+ APICall,
73
+ ]
74
+ > {
75
+ const parsed = safeParse(
76
+ request,
77
+ (value) => operations.DeleteEvalRequest$outboundSchema.parse(value),
78
+ "Input validation failed",
79
+ );
80
+ if (!parsed.ok) {
81
+ return [parsed, { status: "invalid" }];
82
+ }
83
+ const payload = parsed.value;
84
+ const body = null;
85
+
86
+ const pathParams = {
87
+ id: encodeSimple("id", payload.id, {
88
+ explode: false,
89
+ charEncoding: "percent",
90
+ }),
91
+ };
92
+
93
+ const path = pathToFunc("/v2/evaluators/{id}")(pathParams);
94
+
95
+ const headers = new Headers(compactMap({
96
+ Accept: "application/json",
97
+ }));
98
+
99
+ const secConfig = await extractSecurity(client._options.apiKey);
100
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
101
+ const requestSecurity = resolveGlobalSecurity(securityInput);
102
+
103
+ const context = {
104
+ options: client._options,
105
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
106
+ operationID: "DeleteEval",
107
+ oAuth2Scopes: [],
108
+
109
+ resolvedSecurity: requestSecurity,
110
+
111
+ securitySource: client._options.apiKey,
112
+ retryConfig: options?.retries
113
+ || client._options.retryConfig
114
+ || { strategy: "none" },
115
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
116
+ };
117
+
118
+ const requestRes = client._createRequest(context, {
119
+ security: requestSecurity,
120
+ method: "DELETE",
121
+ baseURL: options?.serverURL,
122
+ path: path,
123
+ headers: headers,
124
+ body: body,
125
+ userAgent: client._options.userAgent,
126
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
127
+ }, options);
128
+ if (!requestRes.ok) {
129
+ return [requestRes, { status: "invalid" }];
130
+ }
131
+ const req = requestRes.value;
132
+
133
+ const doResult = await client._do(req, {
134
+ context,
135
+ errorCodes: ["404", "4XX", "5XX"],
136
+ retryConfig: context.retryConfig,
137
+ retryCodes: context.retryCodes,
138
+ });
139
+ if (!doResult.ok) {
140
+ return [doResult, { status: "request-error", request: req }];
141
+ }
142
+ const response = doResult.value;
143
+
144
+ const responseFields = {
145
+ HttpMeta: { Response: response, Request: req },
146
+ };
147
+
148
+ const [result] = await M.match<
149
+ void,
150
+ | errors.DeleteEvalResponseBody
151
+ | APIError
152
+ | SDKValidationError
153
+ | UnexpectedClientError
154
+ | InvalidRequestError
155
+ | RequestAbortedError
156
+ | RequestTimeoutError
157
+ | ConnectionError
158
+ >(
159
+ M.nil(204, z.void()),
160
+ M.jsonErr(404, errors.DeleteEvalResponseBody$inboundSchema),
161
+ M.fail("4XX"),
162
+ M.fail("5XX"),
163
+ )(response, { extraFields: responseFields });
164
+ if (!result.ok) {
165
+ return [result, { status: "complete", request: req, response }];
166
+ }
167
+
168
+ return [result, { status: "complete", request: req, response }];
169
+ }
@@ -0,0 +1,173 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { APIError } from "../models/errors/apierror.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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Invoke a Custom Evaluator
29
+ */
30
+ export function evalsInvoke(
31
+ client: OrqCore,
32
+ request: operations.InvokeEvalRequest,
33
+ options?: RequestOptions,
34
+ ): APIPromise<
35
+ Result<
36
+ operations.InvokeEvalResponseBody,
37
+ | errors.InvokeEvalResponseBody
38
+ | errors.InvokeEvalEvalsResponseBody
39
+ | APIError
40
+ | SDKValidationError
41
+ | UnexpectedClientError
42
+ | InvalidRequestError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | ConnectionError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ request,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ async function $do(
56
+ client: OrqCore,
57
+ request: operations.InvokeEvalRequest,
58
+ options?: RequestOptions,
59
+ ): Promise<
60
+ [
61
+ Result<
62
+ operations.InvokeEvalResponseBody,
63
+ | errors.InvokeEvalResponseBody
64
+ | errors.InvokeEvalEvalsResponseBody
65
+ | APIError
66
+ | SDKValidationError
67
+ | UnexpectedClientError
68
+ | InvalidRequestError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | ConnectionError
72
+ >,
73
+ APICall,
74
+ ]
75
+ > {
76
+ const parsed = safeParse(
77
+ request,
78
+ (value) => operations.InvokeEvalRequest$outboundSchema.parse(value),
79
+ "Input validation failed",
80
+ );
81
+ if (!parsed.ok) {
82
+ return [parsed, { status: "invalid" }];
83
+ }
84
+ const payload = parsed.value;
85
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
86
+
87
+ const pathParams = {
88
+ id: encodeSimple("id", payload.id, {
89
+ explode: false,
90
+ charEncoding: "percent",
91
+ }),
92
+ };
93
+
94
+ const path = pathToFunc("/v2/evaluators/{id}/invoke")(pathParams);
95
+
96
+ const headers = new Headers(compactMap({
97
+ "Content-Type": "application/json",
98
+ Accept: "application/json",
99
+ }));
100
+
101
+ const secConfig = await extractSecurity(client._options.apiKey);
102
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
103
+ const requestSecurity = resolveGlobalSecurity(securityInput);
104
+
105
+ const context = {
106
+ options: client._options,
107
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
108
+ operationID: "InvokeEval",
109
+ oAuth2Scopes: [],
110
+
111
+ resolvedSecurity: requestSecurity,
112
+
113
+ securitySource: client._options.apiKey,
114
+ retryConfig: options?.retries
115
+ || client._options.retryConfig
116
+ || { strategy: "none" },
117
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
118
+ };
119
+
120
+ const requestRes = client._createRequest(context, {
121
+ security: requestSecurity,
122
+ method: "POST",
123
+ baseURL: options?.serverURL,
124
+ path: path,
125
+ headers: headers,
126
+ body: body,
127
+ userAgent: client._options.userAgent,
128
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
129
+ }, options);
130
+ if (!requestRes.ok) {
131
+ return [requestRes, { status: "invalid" }];
132
+ }
133
+ const req = requestRes.value;
134
+
135
+ const doResult = await client._do(req, {
136
+ context,
137
+ errorCodes: ["404", "4XX", "500", "5XX"],
138
+ retryConfig: context.retryConfig,
139
+ retryCodes: context.retryCodes,
140
+ });
141
+ if (!doResult.ok) {
142
+ return [doResult, { status: "request-error", request: req }];
143
+ }
144
+ const response = doResult.value;
145
+
146
+ const responseFields = {
147
+ HttpMeta: { Response: response, Request: req },
148
+ };
149
+
150
+ const [result] = await M.match<
151
+ operations.InvokeEvalResponseBody,
152
+ | errors.InvokeEvalResponseBody
153
+ | errors.InvokeEvalEvalsResponseBody
154
+ | APIError
155
+ | SDKValidationError
156
+ | UnexpectedClientError
157
+ | InvalidRequestError
158
+ | RequestAbortedError
159
+ | RequestTimeoutError
160
+ | ConnectionError
161
+ >(
162
+ M.json(200, operations.InvokeEvalResponseBody$inboundSchema),
163
+ M.jsonErr(404, errors.InvokeEvalResponseBody$inboundSchema),
164
+ M.jsonErr(500, errors.InvokeEvalEvalsResponseBody$inboundSchema),
165
+ M.fail("4XX"),
166
+ M.fail("5XX"),
167
+ )(response, { extraFields: responseFields });
168
+ if (!result.ok) {
169
+ return [result, { status: "complete", request: req, response }];
170
+ }
171
+
172
+ return [result, { status: "complete", request: req, response }];
173
+ }
@@ -0,0 +1,169 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { APIError } from "../models/errors/apierror.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 { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { APICall, APIPromise } from "../types/async.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Update an Evaluator
29
+ */
30
+ export function evalsUpdate(
31
+ client: OrqCore,
32
+ request: operations.UpdateEvalRequest,
33
+ options?: RequestOptions,
34
+ ): APIPromise<
35
+ Result<
36
+ operations.UpdateEvalResponseBody,
37
+ | errors.UpdateEvalResponseBody
38
+ | APIError
39
+ | SDKValidationError
40
+ | UnexpectedClientError
41
+ | InvalidRequestError
42
+ | RequestAbortedError
43
+ | RequestTimeoutError
44
+ | ConnectionError
45
+ >
46
+ > {
47
+ return new APIPromise($do(
48
+ client,
49
+ request,
50
+ options,
51
+ ));
52
+ }
53
+
54
+ async function $do(
55
+ client: OrqCore,
56
+ request: operations.UpdateEvalRequest,
57
+ options?: RequestOptions,
58
+ ): Promise<
59
+ [
60
+ Result<
61
+ operations.UpdateEvalResponseBody,
62
+ | errors.UpdateEvalResponseBody
63
+ | APIError
64
+ | SDKValidationError
65
+ | UnexpectedClientError
66
+ | InvalidRequestError
67
+ | RequestAbortedError
68
+ | RequestTimeoutError
69
+ | ConnectionError
70
+ >,
71
+ APICall,
72
+ ]
73
+ > {
74
+ const parsed = safeParse(
75
+ request,
76
+ (value) => operations.UpdateEvalRequest$outboundSchema.parse(value),
77
+ "Input validation failed",
78
+ );
79
+ if (!parsed.ok) {
80
+ return [parsed, { status: "invalid" }];
81
+ }
82
+ const payload = parsed.value;
83
+ const body = encodeJSON("body", payload.RequestBody, { explode: true });
84
+
85
+ const pathParams = {
86
+ id: encodeSimple("id", payload.id, {
87
+ explode: false,
88
+ charEncoding: "percent",
89
+ }),
90
+ };
91
+
92
+ const path = pathToFunc("/v2/evaluators/{id}")(pathParams);
93
+
94
+ const headers = new Headers(compactMap({
95
+ "Content-Type": "application/json",
96
+ Accept: "application/json",
97
+ }));
98
+
99
+ const secConfig = await extractSecurity(client._options.apiKey);
100
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
101
+ const requestSecurity = resolveGlobalSecurity(securityInput);
102
+
103
+ const context = {
104
+ options: client._options,
105
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
106
+ operationID: "UpdateEval",
107
+ oAuth2Scopes: [],
108
+
109
+ resolvedSecurity: requestSecurity,
110
+
111
+ securitySource: client._options.apiKey,
112
+ retryConfig: options?.retries
113
+ || client._options.retryConfig
114
+ || { strategy: "none" },
115
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
116
+ };
117
+
118
+ const requestRes = client._createRequest(context, {
119
+ security: requestSecurity,
120
+ method: "PATCH",
121
+ baseURL: options?.serverURL,
122
+ path: path,
123
+ headers: headers,
124
+ body: body,
125
+ userAgent: client._options.userAgent,
126
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
127
+ }, options);
128
+ if (!requestRes.ok) {
129
+ return [requestRes, { status: "invalid" }];
130
+ }
131
+ const req = requestRes.value;
132
+
133
+ const doResult = await client._do(req, {
134
+ context,
135
+ errorCodes: ["404", "4XX", "5XX"],
136
+ retryConfig: context.retryConfig,
137
+ retryCodes: context.retryCodes,
138
+ });
139
+ if (!doResult.ok) {
140
+ return [doResult, { status: "request-error", request: req }];
141
+ }
142
+ const response = doResult.value;
143
+
144
+ const responseFields = {
145
+ HttpMeta: { Response: response, Request: req },
146
+ };
147
+
148
+ const [result] = await M.match<
149
+ operations.UpdateEvalResponseBody,
150
+ | errors.UpdateEvalResponseBody
151
+ | APIError
152
+ | SDKValidationError
153
+ | UnexpectedClientError
154
+ | InvalidRequestError
155
+ | RequestAbortedError
156
+ | RequestTimeoutError
157
+ | ConnectionError
158
+ >(
159
+ M.json(200, operations.UpdateEvalResponseBody$inboundSchema),
160
+ M.jsonErr(404, errors.UpdateEvalResponseBody$inboundSchema),
161
+ M.fail("4XX"),
162
+ M.fail("5XX"),
163
+ )(response, { extraFields: responseFields });
164
+ if (!result.ok) {
165
+ return [result, { status: "complete", request: req, response }];
166
+ }
167
+
168
+ return [result, { status: "complete", request: req, response }];
169
+ }
package/src/lib/config.ts CHANGED
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
68
68
  export const SDK_METADATA = {
69
69
  language: "typescript",
70
70
  openapiDocVersion: "2.0",
71
- sdkVersion: "3.8.0-rc.1",
71
+ sdkVersion: "3.8.0-rc.2",
72
72
  genVersion: "2.620.2",
73
- userAgent: "speakeasy-sdk/typescript 3.8.0-rc.1 2.620.2 2.0 @orq-ai/node",
73
+ userAgent: "speakeasy-sdk/typescript 3.8.0-rc.2 2.620.2 2.0 @orq-ai/node",
74
74
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "3.8.0-rc.1",
22
+ currentVersion: "3.8.0-rc.2",
23
23
  },
24
24
  });
25
25
 
@@ -37,6 +37,8 @@ import { tool$deploymentsList } from "./tools/deploymentsList.js";
37
37
  import { tool$deploymentsMetricsCreate } from "./tools/deploymentsMetricsCreate.js";
38
38
  import { tool$deploymentsStream } from "./tools/deploymentsStream.js";
39
39
  import { tool$evalsAgeAppropriate } from "./tools/evalsAgeAppropriate.js";
40
+ import { tool$evalsAll } from "./tools/evalsAll.js";
41
+ import { tool$evalsBertScore } from "./tools/evalsBertScore.js";
40
42
  import { tool$evalsBleuScore } from "./tools/evalsBleuScore.js";
41
43
  import { tool$evalsBotDetection } from "./tools/evalsBotDetection.js";
42
44
  import { tool$evalsContains } from "./tools/evalsContains.js";
@@ -47,10 +49,12 @@ import { tool$evalsContainsNone } from "./tools/evalsContainsNone.js";
47
49
  import { tool$evalsContainsUrl } from "./tools/evalsContainsUrl.js";
48
50
  import { tool$evalsContainsValidLink } from "./tools/evalsContainsValidLink.js";
49
51
  import { tool$evalsCreate } from "./tools/evalsCreate.js";
52
+ import { tool$evalsDelete } from "./tools/evalsDelete.js";
50
53
  import { tool$evalsEndsWith } from "./tools/evalsEndsWith.js";
51
54
  import { tool$evalsExactMatch } from "./tools/evalsExactMatch.js";
52
55
  import { tool$evalsFactCheckingKnowledgeBase } from "./tools/evalsFactCheckingKnowledgeBase.js";
53
56
  import { tool$evalsGrammar } from "./tools/evalsGrammar.js";
57
+ import { tool$evalsInvoke } from "./tools/evalsInvoke.js";
54
58
  import { tool$evalsLengthBetween } from "./tools/evalsLengthBetween.js";
55
59
  import { tool$evalsLengthGreaterThan } from "./tools/evalsLengthGreaterThan.js";
56
60
  import { tool$evalsLengthLessThan } from "./tools/evalsLengthLessThan.js";
@@ -65,11 +69,11 @@ import { tool$evalsRagasHarmfulness } from "./tools/evalsRagasHarmfulness.js";
65
69
  import { tool$evalsRagasMaliciousness } from "./tools/evalsRagasMaliciousness.js";
66
70
  import { tool$evalsRagasResponseRelevancy } from "./tools/evalsRagasResponseRelevancy.js";
67
71
  import { tool$evalsRagasSummarization } from "./tools/evalsRagasSummarization.js";
68
- import { tool$evalsRunBertScore } from "./tools/evalsRunBertScore.js";
69
72
  import { tool$evalsSentimentClassification } from "./tools/evalsSentimentClassification.js";
70
73
  import { tool$evalsSummarization } from "./tools/evalsSummarization.js";
71
74
  import { tool$evalsToneOfVoice } from "./tools/evalsToneOfVoice.js";
72
75
  import { tool$evalsTranslation } from "./tools/evalsTranslation.js";
76
+ import { tool$evalsUpdate } from "./tools/evalsUpdate.js";
73
77
  import { tool$evalsValidJson } from "./tools/evalsValidJson.js";
74
78
  import { tool$feedbackCreate } from "./tools/feedbackCreate.js";
75
79
  import { tool$filesCreate } from "./tools/filesCreate.js";
@@ -114,7 +118,7 @@ export function createMCPServer(deps: {
114
118
  }) {
115
119
  const server = new McpServer({
116
120
  name: "Orq",
117
- version: "3.8.0-rc.1",
121
+ version: "3.8.0-rc.2",
118
122
  });
119
123
 
120
124
  const client = new OrqCore({
@@ -198,8 +202,11 @@ export function createMCPServer(deps: {
198
202
  tool(tool$knowledgeUpdateChunk);
199
203
  tool(tool$knowledgeDeleteChunk);
200
204
  tool(tool$knowledgeRetrieveChunk);
205
+ tool(tool$evalsAll);
201
206
  tool(tool$evalsCreate);
202
- tool(tool$evalsRunBertScore);
207
+ tool(tool$evalsUpdate);
208
+ tool(tool$evalsDelete);
209
+ tool(tool$evalsBertScore);
203
210
  tool(tool$evalsBleuScore);
204
211
  tool(tool$evalsContainsAll);
205
212
  tool(tool$evalsContainsAny);
@@ -233,6 +240,7 @@ export function createMCPServer(deps: {
233
240
  tool(tool$evalsRagasMaliciousness);
234
241
  tool(tool$evalsRagasResponseRelevancy);
235
242
  tool(tool$evalsRagasSummarization);
243
+ tool(tool$evalsInvoke);
236
244
  tool(tool$deploymentsMetricsCreate);
237
245
 
238
246
  return server;
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { evalsAll } from "../../funcs/evalsAll.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.GetEvalsRequest$inboundSchema.optional(),
11
+ };
12
+
13
+ export const tool$evalsAll: ToolDefinition<typeof args> = {
14
+ name: "evals-all",
15
+ description: `Get all Evaluators`,
16
+ args,
17
+ tool: async (client, args, ctx) => {
18
+ const [result, apiCall] = await evalsAll(
19
+ client,
20
+ args.request,
21
+ { fetchOptions: { signal: ctx.signal } },
22
+ ).$inspect();
23
+
24
+ if (!result.ok) {
25
+ return {
26
+ content: [{ type: "text", text: result.error.message }],
27
+ isError: true,
28
+ };
29
+ }
30
+
31
+ const value = result.value;
32
+
33
+ return formatResult(value, apiCall);
34
+ },
35
+ };
@@ -2,20 +2,20 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { evalsRunBertScore } from "../../funcs/evalsRunBertScore.js";
5
+ import { evalsBertScore } from "../../funcs/evalsBertScore.js";
6
6
  import * as operations from "../../models/operations/index.js";
7
7
  import { formatResult, ToolDefinition } from "../tools.js";
8
8
 
9
9
  const args = {
10
- request: operations.RunBertScoreRequestBody$inboundSchema.optional(),
10
+ request: operations.EvalsBertScoreRequestBody$inboundSchema.optional(),
11
11
  };
12
12
 
13
- export const tool$evalsRunBertScore: ToolDefinition<typeof args> = {
14
- name: "evals-run-bert-score",
13
+ export const tool$evalsBertScore: ToolDefinition<typeof args> = {
14
+ name: "evals-bert-score",
15
15
  description: `Run BertScore Evaluator`,
16
16
  args,
17
17
  tool: async (client, args, ctx) => {
18
- const [result, apiCall] = await evalsRunBertScore(
18
+ const [result, apiCall] = await evalsBertScore(
19
19
  client,
20
20
  args.request,
21
21
  { fetchOptions: { signal: ctx.signal } },
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { evalsDelete } from "../../funcs/evalsDelete.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.DeleteEvalRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$evalsDelete: ToolDefinition<typeof args> = {
14
+ name: "evals-delete",
15
+ description: `Delete an Evaluator`,
16
+ args,
17
+ tool: async (client, args, ctx) => {
18
+ const [result, apiCall] = await evalsDelete(
19
+ client,
20
+ args.request,
21
+ { fetchOptions: { signal: ctx.signal } },
22
+ ).$inspect();
23
+
24
+ if (!result.ok) {
25
+ return {
26
+ content: [{ type: "text", text: result.error.message }],
27
+ isError: true,
28
+ };
29
+ }
30
+
31
+ return formatResult(void 0, apiCall);
32
+ },
33
+ };