@orq-ai/node 3.8.4 → 3.8.5
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/bin/mcp-server.js +103 -103
- package/bin/mcp-server.js.map +26 -26
- 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.js +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/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getevals.js +28 -28
- 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/packages/orq-rc/README.md +95 -83
- package/packages/orq-rc/docs/sdks/evals/README.md +213 -0
- package/packages/orq-rc/docs/sdks/knowledge/README.md +87 -77
- package/packages/orq-rc/jsr.json +1 -1
- package/packages/orq-rc/package-lock.json +2 -2
- package/packages/orq-rc/package.json +1 -1
- package/packages/orq-rc/src/funcs/evalsRagasContextEntitiesRecall.ts +183 -0
- package/packages/orq-rc/src/funcs/evalsRagasContextRecall.ts +177 -0
- package/packages/orq-rc/src/funcs/evalsRagasNoiseSensitivity.ts +180 -0
- package/packages/orq-rc/src/funcs/{knowledgeCreate.ts → knowledgeChunkText.ts} +13 -11
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
- package/packages/orq-rc/src/mcp-server/server.ts +9 -3
- package/packages/orq-rc/src/mcp-server/tools/evalsRagasContextEntitiesRecall.ts +37 -0
- package/packages/orq-rc/src/mcp-server/tools/{knowledgeCreate.ts → evalsRagasContextRecall.ts} +7 -6
- package/packages/orq-rc/src/mcp-server/tools/evalsRagasNoiseSensitivity.ts +36 -0
- package/packages/orq-rc/src/mcp-server/tools/knowledgeChunkText.ts +37 -0
- package/packages/orq-rc/src/models/errors/evalsragascontextentitiesrecall.ts +167 -0
- package/packages/orq-rc/src/models/errors/evalsragascontextrecall.ts +162 -0
- package/packages/orq-rc/src/models/errors/evalsragasnoisesensitivity.ts +164 -0
- package/packages/orq-rc/src/models/errors/index.ts +3 -0
- package/packages/orq-rc/src/models/operations/chunktext.ts +1623 -0
- package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
- package/packages/orq-rc/src/models/operations/createdatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/evalsragascontextentitiesrecall.ts +164 -0
- package/packages/orq-rc/src/models/operations/evalsragascontextrecall.ts +164 -0
- package/packages/orq-rc/src/models/operations/evalsragasnoisesensitivity.ts +166 -0
- package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -2
- package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
- package/packages/orq-rc/src/models/operations/getevals.ts +29 -28
- package/packages/orq-rc/src/models/operations/index.ts +4 -1
- package/packages/orq-rc/src/models/operations/listcontacts.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasets.ts +2 -2
- package/packages/orq-rc/src/models/operations/listdatasources.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatecontact.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +2 -2
- package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/updateknowledge.ts +206 -266
- package/packages/orq-rc/src/sdk/evals.ts +45 -0
- package/packages/orq-rc/src/sdk/knowledge.ts +18 -15
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- 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/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 +28 -28
- 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/packages/orq-rc/src/models/operations/createknowledge.ts +0 -846
|
@@ -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
|
+
}
|
|
@@ -25,15 +25,18 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Chunk text content using various strategies
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Split large text documents into smaller, manageable chunks using different chunking strategies optimized for RAG (Retrieval-Augmented Generation) workflows. This endpoint supports multiple chunking algorithms including token-based, sentence-based, recursive, semantic, and specialized strategies.
|
|
29
32
|
*/
|
|
30
|
-
export function
|
|
33
|
+
export function knowledgeChunkText(
|
|
31
34
|
client: OrqCore,
|
|
32
|
-
request: operations.
|
|
35
|
+
request: operations.ChunkTextChunkingRequest,
|
|
33
36
|
options?: RequestOptions,
|
|
34
37
|
): APIPromise<
|
|
35
38
|
Result<
|
|
36
|
-
operations.
|
|
39
|
+
operations.ChunkTextResponseBody,
|
|
37
40
|
| OrqError
|
|
38
41
|
| ResponseValidationError
|
|
39
42
|
| ConnectionError
|
|
@@ -53,12 +56,12 @@ export function knowledgeCreate(
|
|
|
53
56
|
|
|
54
57
|
async function $do(
|
|
55
58
|
client: OrqCore,
|
|
56
|
-
request: operations.
|
|
59
|
+
request: operations.ChunkTextChunkingRequest,
|
|
57
60
|
options?: RequestOptions,
|
|
58
61
|
): Promise<
|
|
59
62
|
[
|
|
60
63
|
Result<
|
|
61
|
-
operations.
|
|
64
|
+
operations.ChunkTextResponseBody,
|
|
62
65
|
| OrqError
|
|
63
66
|
| ResponseValidationError
|
|
64
67
|
| ConnectionError
|
|
@@ -73,8 +76,7 @@ async function $do(
|
|
|
73
76
|
> {
|
|
74
77
|
const parsed = safeParse(
|
|
75
78
|
request,
|
|
76
|
-
(value) =>
|
|
77
|
-
operations.CreateKnowledgeRequestBody$outboundSchema.parse(value),
|
|
79
|
+
(value) => operations.ChunkTextChunkingRequest$outboundSchema.parse(value),
|
|
78
80
|
"Input validation failed",
|
|
79
81
|
);
|
|
80
82
|
if (!parsed.ok) {
|
|
@@ -97,7 +99,7 @@ async function $do(
|
|
|
97
99
|
const context = {
|
|
98
100
|
options: client._options,
|
|
99
101
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
100
|
-
operationID: "
|
|
102
|
+
operationID: "ChunkText",
|
|
101
103
|
oAuth2Scopes: [],
|
|
102
104
|
|
|
103
105
|
resolvedSecurity: requestSecurity,
|
|
@@ -136,7 +138,7 @@ async function $do(
|
|
|
136
138
|
const response = doResult.value;
|
|
137
139
|
|
|
138
140
|
const [result] = await M.match<
|
|
139
|
-
operations.
|
|
141
|
+
operations.ChunkTextResponseBody,
|
|
140
142
|
| OrqError
|
|
141
143
|
| ResponseValidationError
|
|
142
144
|
| ConnectionError
|
|
@@ -146,7 +148,7 @@ async function $do(
|
|
|
146
148
|
| UnexpectedClientError
|
|
147
149
|
| SDKValidationError
|
|
148
150
|
>(
|
|
149
|
-
M.json(200, operations.
|
|
151
|
+
M.json(200, operations.ChunkTextResponseBody$inboundSchema),
|
|
150
152
|
M.fail("4XX"),
|
|
151
153
|
M.fail("5XX"),
|
|
152
154
|
)(response, req);
|
|
@@ -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.
|
|
72
|
-
genVersion: "2.
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 3.
|
|
71
|
+
sdkVersion: "3.9.0-rc.1",
|
|
72
|
+
genVersion: "2.632.2",
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 3.9.0-rc.1 2.632.2 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
|
@@ -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";
|
|
@@ -80,7 +83,7 @@ import { tool$filesCreate } from "./tools/filesCreate.js";
|
|
|
80
83
|
import { tool$filesDelete } from "./tools/filesDelete.js";
|
|
81
84
|
import { tool$filesGet } from "./tools/filesGet.js";
|
|
82
85
|
import { tool$filesList } from "./tools/filesList.js";
|
|
83
|
-
import { tool$
|
|
86
|
+
import { tool$knowledgeChunkText } from "./tools/knowledgeChunkText.js";
|
|
84
87
|
import { tool$knowledgeCreateChunks } from "./tools/knowledgeCreateChunks.js";
|
|
85
88
|
import { tool$knowledgeCreateDatasource } from "./tools/knowledgeCreateDatasource.js";
|
|
86
89
|
import { tool$knowledgeDelete } from "./tools/knowledgeDelete.js";
|
|
@@ -118,7 +121,7 @@ export function createMCPServer(deps: {
|
|
|
118
121
|
}) {
|
|
119
122
|
const server = new McpServer({
|
|
120
123
|
name: "Orq",
|
|
121
|
-
version: "3.
|
|
124
|
+
version: "3.9.0-rc.1",
|
|
122
125
|
});
|
|
123
126
|
|
|
124
127
|
const client = new OrqCore({
|
|
@@ -187,7 +190,6 @@ export function createMCPServer(deps: {
|
|
|
187
190
|
tool(tool$datasetsDeleteDatapoint);
|
|
188
191
|
tool(tool$datasetsClear);
|
|
189
192
|
tool(tool$knowledgeList);
|
|
190
|
-
tool(tool$knowledgeCreate);
|
|
191
193
|
tool(tool$knowledgeRetrieve);
|
|
192
194
|
tool(tool$knowledgeUpdate);
|
|
193
195
|
tool(tool$knowledgeDelete);
|
|
@@ -202,6 +204,7 @@ export function createMCPServer(deps: {
|
|
|
202
204
|
tool(tool$knowledgeUpdateChunk);
|
|
203
205
|
tool(tool$knowledgeDeleteChunk);
|
|
204
206
|
tool(tool$knowledgeRetrieveChunk);
|
|
207
|
+
tool(tool$knowledgeChunkText);
|
|
205
208
|
tool(tool$evalsAll);
|
|
206
209
|
tool(tool$evalsCreate);
|
|
207
210
|
tool(tool$evalsUpdate);
|
|
@@ -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
|
+
};
|
package/packages/orq-rc/src/mcp-server/tools/{knowledgeCreate.ts → evalsRagasContextRecall.ts}
RENAMED
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { evalsRagasContextRecall } from "../../funcs/evalsRagasContextRecall.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.
|
|
10
|
+
request: operations.EvalsRagasContextRecallRequestBody$inboundSchema
|
|
11
|
+
.optional(),
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
export const tool$
|
|
14
|
-
name: "
|
|
15
|
-
description: `
|
|
14
|
+
export const tool$evalsRagasContextRecall: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "evals-ragas-context-recall",
|
|
16
|
+
description: `Run Context Recall Evaluator`,
|
|
16
17
|
args,
|
|
17
18
|
tool: async (client, args, ctx) => {
|
|
18
|
-
const [result, apiCall] = await
|
|
19
|
+
const [result, apiCall] = await evalsRagasContextRecall(
|
|
19
20
|
client,
|
|
20
21
|
args.request,
|
|
21
22
|
{ fetchOptions: { signal: ctx.signal } },
|
|
@@ -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,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { knowledgeChunkText } from "../../funcs/knowledgeChunkText.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ChunkTextChunkingRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$knowledgeChunkText: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "knowledge-chunk-text",
|
|
15
|
+
description: `Chunk text content using various strategies
|
|
16
|
+
|
|
17
|
+
Split large text documents into smaller, manageable chunks using different chunking strategies optimized for RAG (Retrieval-Augmented Generation) workflows. This endpoint supports multiple chunking algorithms including token-based, sentence-based, recursive, semantic, and specialized strategies.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await knowledgeChunkText(
|
|
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
|
+
};
|