@orq-ai/node 3.9.0-rc.0 → 3.9.0-rc.1
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 +93 -81
- package/bin/mcp-server.js +1003 -400
- package/bin/mcp-server.js.map +42 -30
- package/docs/sdks/evals/README.md +213 -0
- package/funcs/evalsRagasContextEntitiesRecall.d.ts +15 -0
- package/funcs/evalsRagasContextEntitiesRecall.d.ts.map +1 -0
- package/funcs/evalsRagasContextEntitiesRecall.js +118 -0
- package/funcs/evalsRagasContextEntitiesRecall.js.map +1 -0
- package/funcs/evalsRagasContextRecall.d.ts +15 -0
- package/funcs/evalsRagasContextRecall.d.ts.map +1 -0
- package/funcs/evalsRagasContextRecall.js +118 -0
- package/funcs/evalsRagasContextRecall.js.map +1 -0
- package/funcs/evalsRagasNoiseSensitivity.d.ts +15 -0
- package/funcs/evalsRagasNoiseSensitivity.d.ts.map +1 -0
- package/funcs/evalsRagasNoiseSensitivity.js +118 -0
- package/funcs/evalsRagasNoiseSensitivity.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +7 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/evalsRagasContextEntitiesRecall.d.ts +8 -0
- package/mcp-server/tools/evalsRagasContextEntitiesRecall.d.ts.map +1 -0
- package/mcp-server/tools/evalsRagasContextEntitiesRecall.js +63 -0
- package/mcp-server/tools/evalsRagasContextEntitiesRecall.js.map +1 -0
- package/mcp-server/tools/evalsRagasContextRecall.d.ts +8 -0
- package/mcp-server/tools/evalsRagasContextRecall.d.ts.map +1 -0
- package/mcp-server/tools/evalsRagasContextRecall.js +63 -0
- package/mcp-server/tools/evalsRagasContextRecall.js.map +1 -0
- package/mcp-server/tools/evalsRagasNoiseSensitivity.d.ts +8 -0
- package/mcp-server/tools/evalsRagasNoiseSensitivity.d.ts.map +1 -0
- package/mcp-server/tools/evalsRagasNoiseSensitivity.js +63 -0
- package/mcp-server/tools/evalsRagasNoiseSensitivity.js.map +1 -0
- package/models/errors/evalsragascontextentitiesrecall.d.ts +79 -0
- package/models/errors/evalsragascontextentitiesrecall.d.ts.map +1 -0
- package/models/errors/evalsragascontextentitiesrecall.js +132 -0
- package/models/errors/evalsragascontextentitiesrecall.js.map +1 -0
- package/models/errors/evalsragascontextrecall.d.ts +79 -0
- package/models/errors/evalsragascontextrecall.d.ts.map +1 -0
- package/models/errors/evalsragascontextrecall.js +132 -0
- package/models/errors/evalsragascontextrecall.js.map +1 -0
- package/models/errors/evalsragasnoisesensitivity.d.ts +79 -0
- package/models/errors/evalsragasnoisesensitivity.d.ts.map +1 -0
- package/models/errors/evalsragasnoisesensitivity.js +132 -0
- package/models/errors/evalsragasnoisesensitivity.js.map +1 -0
- package/models/errors/index.d.ts +3 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +3 -0
- package/models/errors/index.js.map +1 -1
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +2 -2
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +16 -16
- package/models/operations/evalsragascontextentitiesrecall.d.ts +67 -0
- package/models/operations/evalsragascontextentitiesrecall.d.ts.map +1 -0
- package/models/operations/evalsragascontextentitiesrecall.js +100 -0
- package/models/operations/evalsragascontextentitiesrecall.js.map +1 -0
- package/models/operations/evalsragascontextrecall.d.ts +77 -0
- package/models/operations/evalsragascontextrecall.d.ts.map +1 -0
- package/models/operations/evalsragascontextrecall.js +104 -0
- package/models/operations/evalsragascontextrecall.js.map +1 -0
- package/models/operations/evalsragasnoisesensitivity.d.ts +77 -0
- package/models/operations/evalsragasnoisesensitivity.d.ts.map +1 -0
- package/models/operations/evalsragasnoisesensitivity.js +104 -0
- package/models/operations/evalsragasnoisesensitivity.js.map +1 -0
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getevals.d.ts +3 -0
- package/models/operations/getevals.d.ts.map +1 -1
- package/models/operations/getevals.js +29 -28
- package/models/operations/getevals.js.map +1 -1
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +2 -2
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +2 -2
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +2 -2
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +16 -16
- package/package.json +1 -1
- package/sdk/evals.d.ts +12 -0
- package/sdk/evals.d.ts.map +1 -1
- package/sdk/evals.js +21 -0
- package/sdk/evals.js.map +1 -1
- package/src/funcs/evalsRagasContextEntitiesRecall.ts +183 -0
- package/src/funcs/evalsRagasContextRecall.ts +177 -0
- package/src/funcs/evalsRagasNoiseSensitivity.ts +180 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +7 -1
- package/src/mcp-server/tools/evalsRagasContextEntitiesRecall.ts +37 -0
- package/src/mcp-server/tools/evalsRagasContextRecall.ts +36 -0
- package/src/mcp-server/tools/evalsRagasNoiseSensitivity.ts +36 -0
- package/src/models/errors/evalsragascontextentitiesrecall.ts +167 -0
- package/src/models/errors/evalsragascontextrecall.ts +162 -0
- package/src/models/errors/evalsragasnoisesensitivity.ts +164 -0
- package/src/models/errors/index.ts +3 -0
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +2 -2
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/evalsragascontextentitiesrecall.ts +164 -0
- package/src/models/operations/evalsragascontextrecall.ts +164 -0
- package/src/models/operations/evalsragasnoisesensitivity.ts +166 -0
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getevals.ts +29 -28
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +2 -2
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +2 -2
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +16 -16
- package/src/sdk/evals.ts +45 -0
|
@@ -0,0 +1,177 @@
|
|
|
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 * 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 {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.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
|
+
* Run Context Recall Evaluator
|
|
30
|
+
*/
|
|
31
|
+
export function evalsRagasContextRecall(
|
|
32
|
+
client: OrqCore,
|
|
33
|
+
request?: operations.EvalsRagasContextRecallRequestBody | undefined,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
operations.EvalsRagasContextRecallResponseBody,
|
|
38
|
+
| errors.EvalsRagasContextRecallResponseBody
|
|
39
|
+
| errors.EvalsRagasContextRecallEvalsResponseBody
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request?: operations.EvalsRagasContextRecallRequestBody | undefined,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.EvalsRagasContextRecallResponseBody,
|
|
65
|
+
| errors.EvalsRagasContextRecallResponseBody
|
|
66
|
+
| errors.EvalsRagasContextRecallEvalsResponseBody
|
|
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.EvalsRagasContextRecallRequestBody$outboundSchema.optional()
|
|
83
|
+
.parse(value),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = payload === undefined
|
|
91
|
+
? null
|
|
92
|
+
: encodeJSON("body", payload, { explode: true });
|
|
93
|
+
|
|
94
|
+
const path = pathToFunc("/v2/evaluators/ragas_context_recall")();
|
|
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: "EvalsRagasContextRecall",
|
|
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.EvalsRagasContextRecallResponseBody,
|
|
152
|
+
| errors.EvalsRagasContextRecallResponseBody
|
|
153
|
+
| errors.EvalsRagasContextRecallEvalsResponseBody
|
|
154
|
+
| OrqError
|
|
155
|
+
| ResponseValidationError
|
|
156
|
+
| ConnectionError
|
|
157
|
+
| RequestAbortedError
|
|
158
|
+
| RequestTimeoutError
|
|
159
|
+
| InvalidRequestError
|
|
160
|
+
| UnexpectedClientError
|
|
161
|
+
| SDKValidationError
|
|
162
|
+
>(
|
|
163
|
+
M.json(200, operations.EvalsRagasContextRecallResponseBody$inboundSchema),
|
|
164
|
+
M.jsonErr(404, errors.EvalsRagasContextRecallResponseBody$inboundSchema),
|
|
165
|
+
M.jsonErr(
|
|
166
|
+
500,
|
|
167
|
+
errors.EvalsRagasContextRecallEvalsResponseBody$inboundSchema,
|
|
168
|
+
),
|
|
169
|
+
M.fail("4XX"),
|
|
170
|
+
M.fail("5XX"),
|
|
171
|
+
)(response, req, { extraFields: responseFields });
|
|
172
|
+
if (!result.ok) {
|
|
173
|
+
return [result, { status: "complete", request: req, response }];
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return [result, { status: "complete", request: req, response }];
|
|
177
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
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 * 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 {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.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
|
+
* Run Noise Sensitivity Evaluator
|
|
30
|
+
*/
|
|
31
|
+
export function evalsRagasNoiseSensitivity(
|
|
32
|
+
client: OrqCore,
|
|
33
|
+
request?: operations.EvalsRagasNoiseSensitivityRequestBody | undefined,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
operations.EvalsRagasNoiseSensitivityResponseBody,
|
|
38
|
+
| errors.EvalsRagasNoiseSensitivityResponseBody
|
|
39
|
+
| errors.EvalsRagasNoiseSensitivityEvalsResponseBody
|
|
40
|
+
| OrqError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: OrqCore,
|
|
59
|
+
request?: operations.EvalsRagasNoiseSensitivityRequestBody | undefined,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.EvalsRagasNoiseSensitivityResponseBody,
|
|
65
|
+
| errors.EvalsRagasNoiseSensitivityResponseBody
|
|
66
|
+
| errors.EvalsRagasNoiseSensitivityEvalsResponseBody
|
|
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.EvalsRagasNoiseSensitivityRequestBody$outboundSchema.optional()
|
|
83
|
+
.parse(value),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = payload === undefined
|
|
91
|
+
? null
|
|
92
|
+
: encodeJSON("body", payload, { explode: true });
|
|
93
|
+
|
|
94
|
+
const path = pathToFunc("/v2/evaluators/ragas_noise_sensitivity")();
|
|
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: "EvalsRagasNoiseSensitivity",
|
|
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.EvalsRagasNoiseSensitivityResponseBody,
|
|
152
|
+
| errors.EvalsRagasNoiseSensitivityResponseBody
|
|
153
|
+
| errors.EvalsRagasNoiseSensitivityEvalsResponseBody
|
|
154
|
+
| OrqError
|
|
155
|
+
| ResponseValidationError
|
|
156
|
+
| ConnectionError
|
|
157
|
+
| RequestAbortedError
|
|
158
|
+
| RequestTimeoutError
|
|
159
|
+
| InvalidRequestError
|
|
160
|
+
| UnexpectedClientError
|
|
161
|
+
| SDKValidationError
|
|
162
|
+
>(
|
|
163
|
+
M.json(
|
|
164
|
+
200,
|
|
165
|
+
operations.EvalsRagasNoiseSensitivityResponseBody$inboundSchema,
|
|
166
|
+
),
|
|
167
|
+
M.jsonErr(404, errors.EvalsRagasNoiseSensitivityResponseBody$inboundSchema),
|
|
168
|
+
M.jsonErr(
|
|
169
|
+
500,
|
|
170
|
+
errors.EvalsRagasNoiseSensitivityEvalsResponseBody$inboundSchema,
|
|
171
|
+
),
|
|
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
|
+
}
|
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.9.0-rc.
|
|
71
|
+
sdkVersion: "3.9.0-rc.1",
|
|
72
72
|
genVersion: "2.632.2",
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 3.9.0-rc.
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 3.9.0-rc.1 2.632.2 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -62,11 +62,14 @@ import { tool$evalsLocalization } from "./tools/evalsLocalization.js";
|
|
|
62
62
|
import { tool$evalsPii } from "./tools/evalsPii.js";
|
|
63
63
|
import { tool$evalsRagasCoherence } from "./tools/evalsRagasCoherence.js";
|
|
64
64
|
import { tool$evalsRagasConciseness } from "./tools/evalsRagasConciseness.js";
|
|
65
|
+
import { tool$evalsRagasContextEntitiesRecall } from "./tools/evalsRagasContextEntitiesRecall.js";
|
|
65
66
|
import { tool$evalsRagasContextPrecision } from "./tools/evalsRagasContextPrecision.js";
|
|
67
|
+
import { tool$evalsRagasContextRecall } from "./tools/evalsRagasContextRecall.js";
|
|
66
68
|
import { tool$evalsRagasCorrectness } from "./tools/evalsRagasCorrectness.js";
|
|
67
69
|
import { tool$evalsRagasFaithfulness } from "./tools/evalsRagasFaithfulness.js";
|
|
68
70
|
import { tool$evalsRagasHarmfulness } from "./tools/evalsRagasHarmfulness.js";
|
|
69
71
|
import { tool$evalsRagasMaliciousness } from "./tools/evalsRagasMaliciousness.js";
|
|
72
|
+
import { tool$evalsRagasNoiseSensitivity } from "./tools/evalsRagasNoiseSensitivity.js";
|
|
70
73
|
import { tool$evalsRagasResponseRelevancy } from "./tools/evalsRagasResponseRelevancy.js";
|
|
71
74
|
import { tool$evalsRagasSummarization } from "./tools/evalsRagasSummarization.js";
|
|
72
75
|
import { tool$evalsSentimentClassification } from "./tools/evalsSentimentClassification.js";
|
|
@@ -118,7 +121,7 @@ export function createMCPServer(deps: {
|
|
|
118
121
|
}) {
|
|
119
122
|
const server = new McpServer({
|
|
120
123
|
name: "Orq",
|
|
121
|
-
version: "3.9.0-rc.
|
|
124
|
+
version: "3.9.0-rc.1",
|
|
122
125
|
});
|
|
123
126
|
|
|
124
127
|
const client = new OrqCore({
|
|
@@ -234,10 +237,13 @@ export function createMCPServer(deps: {
|
|
|
234
237
|
tool(tool$evalsRagasCoherence);
|
|
235
238
|
tool(tool$evalsRagasConciseness);
|
|
236
239
|
tool(tool$evalsRagasContextPrecision);
|
|
240
|
+
tool(tool$evalsRagasContextRecall);
|
|
241
|
+
tool(tool$evalsRagasContextEntitiesRecall);
|
|
237
242
|
tool(tool$evalsRagasCorrectness);
|
|
238
243
|
tool(tool$evalsRagasFaithfulness);
|
|
239
244
|
tool(tool$evalsRagasHarmfulness);
|
|
240
245
|
tool(tool$evalsRagasMaliciousness);
|
|
246
|
+
tool(tool$evalsRagasNoiseSensitivity);
|
|
241
247
|
tool(tool$evalsRagasResponseRelevancy);
|
|
242
248
|
tool(tool$evalsRagasSummarization);
|
|
243
249
|
tool(tool$evalsInvoke);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { evalsRagasContextEntitiesRecall } from "../../funcs/evalsRagasContextEntitiesRecall.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.EvalsRagasContextEntitiesRecallRequestBody$inboundSchema
|
|
11
|
+
.optional(),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$evalsRagasContextEntitiesRecall: ToolDefinition<typeof args> =
|
|
15
|
+
{
|
|
16
|
+
name: "evals-ragas-context-entities-recall",
|
|
17
|
+
description: `Run Context Entities Recall Evaluator`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await evalsRagasContextEntitiesRecall(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { evalsRagasContextRecall } from "../../funcs/evalsRagasContextRecall.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.EvalsRagasContextRecallRequestBody$inboundSchema
|
|
11
|
+
.optional(),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$evalsRagasContextRecall: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "evals-ragas-context-recall",
|
|
16
|
+
description: `Run Context Recall Evaluator`,
|
|
17
|
+
args,
|
|
18
|
+
tool: async (client, args, ctx) => {
|
|
19
|
+
const [result, apiCall] = await evalsRagasContextRecall(
|
|
20
|
+
client,
|
|
21
|
+
args.request,
|
|
22
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
23
|
+
).$inspect();
|
|
24
|
+
|
|
25
|
+
if (!result.ok) {
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: "text", text: result.error.message }],
|
|
28
|
+
isError: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const value = result.value;
|
|
33
|
+
|
|
34
|
+
return formatResult(value, apiCall);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { evalsRagasNoiseSensitivity } from "../../funcs/evalsRagasNoiseSensitivity.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.EvalsRagasNoiseSensitivityRequestBody$inboundSchema
|
|
11
|
+
.optional(),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$evalsRagasNoiseSensitivity: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "evals-ragas-noise-sensitivity",
|
|
16
|
+
description: `Run Noise Sensitivity Evaluator`,
|
|
17
|
+
args,
|
|
18
|
+
tool: async (client, args, ctx) => {
|
|
19
|
+
const [result, apiCall] = await evalsRagasNoiseSensitivity(
|
|
20
|
+
client,
|
|
21
|
+
args.request,
|
|
22
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
23
|
+
).$inspect();
|
|
24
|
+
|
|
25
|
+
if (!result.ok) {
|
|
26
|
+
return {
|
|
27
|
+
content: [{ type: "text", text: result.error.message }],
|
|
28
|
+
isError: true,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const value = result.value;
|
|
33
|
+
|
|
34
|
+
return formatResult(value, apiCall);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { OrqError } from "./orqerror.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal server error
|
|
10
|
+
*/
|
|
11
|
+
export type EvalsRagasContextEntitiesRecallEvalsResponseBodyData = {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Internal server error
|
|
17
|
+
*/
|
|
18
|
+
export class EvalsRagasContextEntitiesRecallEvalsResponseBody extends OrqError {
|
|
19
|
+
/** The original data that was passed to this error instance. */
|
|
20
|
+
data$: EvalsRagasContextEntitiesRecallEvalsResponseBodyData;
|
|
21
|
+
|
|
22
|
+
constructor(
|
|
23
|
+
err: EvalsRagasContextEntitiesRecallEvalsResponseBodyData,
|
|
24
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
25
|
+
) {
|
|
26
|
+
const message = "message" in err && typeof err.message === "string"
|
|
27
|
+
? err.message
|
|
28
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
29
|
+
super(message, httpMeta);
|
|
30
|
+
this.data$ = err;
|
|
31
|
+
|
|
32
|
+
this.name = "EvalsRagasContextEntitiesRecallEvalsResponseBody";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Evaluator not found
|
|
38
|
+
*/
|
|
39
|
+
export type EvalsRagasContextEntitiesRecallResponseBodyData = {
|
|
40
|
+
message: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Evaluator not found
|
|
45
|
+
*/
|
|
46
|
+
export class EvalsRagasContextEntitiesRecallResponseBody extends OrqError {
|
|
47
|
+
/** The original data that was passed to this error instance. */
|
|
48
|
+
data$: EvalsRagasContextEntitiesRecallResponseBodyData;
|
|
49
|
+
|
|
50
|
+
constructor(
|
|
51
|
+
err: EvalsRagasContextEntitiesRecallResponseBodyData,
|
|
52
|
+
httpMeta: { response: Response; request: Request; body: string },
|
|
53
|
+
) {
|
|
54
|
+
const message = "message" in err && typeof err.message === "string"
|
|
55
|
+
? err.message
|
|
56
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
57
|
+
super(message, httpMeta);
|
|
58
|
+
this.data$ = err;
|
|
59
|
+
|
|
60
|
+
this.name = "EvalsRagasContextEntitiesRecallResponseBody";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const EvalsRagasContextEntitiesRecallEvalsResponseBody$inboundSchema:
|
|
66
|
+
z.ZodType<
|
|
67
|
+
EvalsRagasContextEntitiesRecallEvalsResponseBody,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
unknown
|
|
70
|
+
> = z.object({
|
|
71
|
+
message: z.string(),
|
|
72
|
+
request$: z.instanceof(Request),
|
|
73
|
+
response$: z.instanceof(Response),
|
|
74
|
+
body$: z.string(),
|
|
75
|
+
})
|
|
76
|
+
.transform((v) => {
|
|
77
|
+
return new EvalsRagasContextEntitiesRecallEvalsResponseBody(v, {
|
|
78
|
+
request: v.request$,
|
|
79
|
+
response: v.response$,
|
|
80
|
+
body: v.body$,
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/** @internal */
|
|
85
|
+
export type EvalsRagasContextEntitiesRecallEvalsResponseBody$Outbound = {
|
|
86
|
+
message: string;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** @internal */
|
|
90
|
+
export const EvalsRagasContextEntitiesRecallEvalsResponseBody$outboundSchema:
|
|
91
|
+
z.ZodType<
|
|
92
|
+
EvalsRagasContextEntitiesRecallEvalsResponseBody$Outbound,
|
|
93
|
+
z.ZodTypeDef,
|
|
94
|
+
EvalsRagasContextEntitiesRecallEvalsResponseBody
|
|
95
|
+
> = z.instanceof(EvalsRagasContextEntitiesRecallEvalsResponseBody)
|
|
96
|
+
.transform(v => v.data$)
|
|
97
|
+
.pipe(z.object({
|
|
98
|
+
message: z.string(),
|
|
99
|
+
}));
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
104
|
+
*/
|
|
105
|
+
export namespace EvalsRagasContextEntitiesRecallEvalsResponseBody$ {
|
|
106
|
+
/** @deprecated use `EvalsRagasContextEntitiesRecallEvalsResponseBody$inboundSchema` instead. */
|
|
107
|
+
export const inboundSchema =
|
|
108
|
+
EvalsRagasContextEntitiesRecallEvalsResponseBody$inboundSchema;
|
|
109
|
+
/** @deprecated use `EvalsRagasContextEntitiesRecallEvalsResponseBody$outboundSchema` instead. */
|
|
110
|
+
export const outboundSchema =
|
|
111
|
+
EvalsRagasContextEntitiesRecallEvalsResponseBody$outboundSchema;
|
|
112
|
+
/** @deprecated use `EvalsRagasContextEntitiesRecallEvalsResponseBody$Outbound` instead. */
|
|
113
|
+
export type Outbound =
|
|
114
|
+
EvalsRagasContextEntitiesRecallEvalsResponseBody$Outbound;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export const EvalsRagasContextEntitiesRecallResponseBody$inboundSchema:
|
|
119
|
+
z.ZodType<
|
|
120
|
+
EvalsRagasContextEntitiesRecallResponseBody,
|
|
121
|
+
z.ZodTypeDef,
|
|
122
|
+
unknown
|
|
123
|
+
> = z.object({
|
|
124
|
+
message: z.string(),
|
|
125
|
+
request$: z.instanceof(Request),
|
|
126
|
+
response$: z.instanceof(Response),
|
|
127
|
+
body$: z.string(),
|
|
128
|
+
})
|
|
129
|
+
.transform((v) => {
|
|
130
|
+
return new EvalsRagasContextEntitiesRecallResponseBody(v, {
|
|
131
|
+
request: v.request$,
|
|
132
|
+
response: v.response$,
|
|
133
|
+
body: v.body$,
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
/** @internal */
|
|
138
|
+
export type EvalsRagasContextEntitiesRecallResponseBody$Outbound = {
|
|
139
|
+
message: string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** @internal */
|
|
143
|
+
export const EvalsRagasContextEntitiesRecallResponseBody$outboundSchema:
|
|
144
|
+
z.ZodType<
|
|
145
|
+
EvalsRagasContextEntitiesRecallResponseBody$Outbound,
|
|
146
|
+
z.ZodTypeDef,
|
|
147
|
+
EvalsRagasContextEntitiesRecallResponseBody
|
|
148
|
+
> = z.instanceof(EvalsRagasContextEntitiesRecallResponseBody)
|
|
149
|
+
.transform(v => v.data$)
|
|
150
|
+
.pipe(z.object({
|
|
151
|
+
message: z.string(),
|
|
152
|
+
}));
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @internal
|
|
156
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
157
|
+
*/
|
|
158
|
+
export namespace EvalsRagasContextEntitiesRecallResponseBody$ {
|
|
159
|
+
/** @deprecated use `EvalsRagasContextEntitiesRecallResponseBody$inboundSchema` instead. */
|
|
160
|
+
export const inboundSchema =
|
|
161
|
+
EvalsRagasContextEntitiesRecallResponseBody$inboundSchema;
|
|
162
|
+
/** @deprecated use `EvalsRagasContextEntitiesRecallResponseBody$outboundSchema` instead. */
|
|
163
|
+
export const outboundSchema =
|
|
164
|
+
EvalsRagasContextEntitiesRecallResponseBody$outboundSchema;
|
|
165
|
+
/** @deprecated use `EvalsRagasContextEntitiesRecallResponseBody$Outbound` instead. */
|
|
166
|
+
export type Outbound = EvalsRagasContextEntitiesRecallResponseBody$Outbound;
|
|
167
|
+
}
|