@orq-ai/node 4.1.0-rc.45 → 4.1.0-rc.50
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 +31 -24
- package/bin/mcp-server.js +3439 -531
- package/bin/mcp-server.js.map +65 -58
- package/examples/package-lock.json +1 -1
- package/funcs/routerChatCompletions.d.ts +23 -0
- package/funcs/routerChatCompletions.d.ts.map +1 -0
- package/funcs/routerChatCompletions.js +121 -0
- package/funcs/routerChatCompletions.js.map +1 -0
- package/funcs/routerImagesGenerate.d.ts +17 -0
- package/funcs/routerImagesGenerate.d.ts.map +1 -0
- package/funcs/routerImagesGenerate.js +114 -0
- package/funcs/routerImagesGenerate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/event-streams.js +1 -1
- package/lib/event-streams.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +5 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/routerChatCompletions.d.ts +8 -0
- package/mcp-server/tools/routerChatCompletions.d.ts.map +1 -0
- package/mcp-server/tools/routerChatCompletions.js +64 -0
- package/mcp-server/tools/routerChatCompletions.js.map +1 -0
- package/mcp-server/tools/routerImagesGenerate.d.ts +8 -0
- package/mcp-server/tools/routerImagesGenerate.d.ts.map +1 -0
- package/mcp-server/tools/routerImagesGenerate.js +64 -0
- package/mcp-server/tools/routerImagesGenerate.js.map +1 -0
- package/models/components/conversationresponse.js +2 -2
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/partdoneevent.js +2 -2
- package/models/components/publiccontact.d.ts +52 -0
- package/models/components/publiccontact.d.ts.map +1 -0
- package/models/components/publiccontact.js +79 -0
- package/models/components/publiccontact.js.map +1 -0
- package/models/components/reasoningpart.js +2 -2
- package/models/operations/createagentrequest.d.ts +280 -36
- package/models/operations/createagentrequest.d.ts.map +1 -1
- package/models/operations/createagentrequest.js +308 -51
- package/models/operations/createagentrequest.js.map +1 -1
- package/models/operations/createagentresponserequest.d.ts.map +1 -1
- package/models/operations/createagentresponserequest.js +3 -1
- package/models/operations/createagentresponserequest.js.map +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createchatcompletion.d.ts +3152 -0
- package/models/operations/createchatcompletion.d.ts.map +1 -0
- package/models/operations/createchatcompletion.js +3398 -0
- package/models/operations/createchatcompletion.js.map +1 -0
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createconversation.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.js +28 -28
- package/models/operations/createimage.d.ts +433 -0
- package/models/operations/createimage.d.ts.map +1 -0
- package/models/operations/createimage.js +455 -0
- package/models/operations/createimage.js.map +1 -0
- package/models/operations/creatememory.d.ts +1 -1
- package/models/operations/createtool.js +12 -12
- package/models/operations/deploymentstream.d.ts.map +1 -1
- package/models/operations/deploymentstream.js +3 -1
- package/models/operations/deploymentstream.js.map +1 -1
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/generateconversationname.js +2 -2
- package/models/operations/getallprompts.d.ts +8 -8
- package/models/operations/getallprompts.d.ts.map +1 -1
- package/models/operations/getallprompts.js +11 -12
- package/models/operations/getallprompts.js.map +1 -1
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.js +28 -28
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/invokeeval.d.ts +5 -5
- package/models/operations/invokeeval.d.ts.map +1 -1
- package/models/operations/invokeeval.js +7 -7
- package/models/operations/invokeeval.js.map +1 -1
- package/models/operations/listagents.d.ts +122 -0
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js +129 -3
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/retrieveagentrequest.d.ts +122 -0
- package/models/operations/retrieveagentrequest.d.ts.map +1 -1
- package/models/operations/retrieveagentrequest.js +128 -3
- package/models/operations/retrieveagentrequest.js.map +1 -1
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrieveconversation.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +12 -12
- package/models/operations/runagent.d.ts +122 -0
- package/models/operations/runagent.d.ts.map +1 -1
- package/models/operations/runagent.js +132 -7
- package/models/operations/runagent.js.map +1 -1
- package/models/operations/streamrunagent.d.ts +122 -0
- package/models/operations/streamrunagent.d.ts.map +1 -1
- package/models/operations/streamrunagent.js +131 -7
- package/models/operations/streamrunagent.js.map +1 -1
- package/models/operations/updateagent.d.ts +244 -0
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +255 -7
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updateconversation.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.js +28 -28
- package/models/operations/updatememory.d.ts +1 -1
- package/models/operations/updatetool.js +14 -14
- package/package.json +1 -1
- package/sdk/router.d.ts +23 -0
- package/sdk/router.d.ts.map +1 -0
- package/sdk/router.js +34 -0
- package/sdk/router.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/routerChatCompletions.ts +172 -0
- package/src/funcs/routerImagesGenerate.ts +160 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/event-streams.ts +1 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/routerChatCompletions.ts +37 -0
- package/src/mcp-server/tools/routerImagesGenerate.ts +37 -0
- package/src/models/components/conversationresponse.ts +2 -2
- package/src/models/components/index.ts +1 -0
- package/src/models/components/partdoneevent.ts +2 -2
- package/src/models/components/publiccontact.ts +99 -0
- package/src/models/components/reasoningpart.ts +2 -2
- package/src/models/operations/createagentrequest.ts +760 -113
- package/src/models/operations/createagentresponserequest.ts +2 -1
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createchatcompletion.ts +8911 -0
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createconversation.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +28 -28
- package/src/models/operations/createimage.ts +966 -0
- package/src/models/operations/creatememory.ts +1 -1
- package/src/models/operations/createtool.ts +12 -12
- package/src/models/operations/deploymentstream.ts +2 -1
- 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/generateconversationname.ts +2 -2
- package/src/models/operations/getallprompts.ts +45 -38
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +28 -28
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/invokeeval.ts +11 -10
- package/src/models/operations/listagents.ts +313 -0
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/retrieveagentrequest.ts +337 -0
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrieveconversation.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +12 -12
- package/src/models/operations/runagent.ts +315 -2
- package/src/models/operations/streamrunagent.ts +342 -2
- package/src/models/operations/updateagent.ts +659 -0
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updateconversation.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +28 -28
- package/src/models/operations/updatememory.ts +1 -1
- package/src/models/operations/updatetool.ts +14 -14
- package/src/sdk/router.ts +52 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,172 @@
|
|
|
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 { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.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
|
+
export enum ChatCompletionsAcceptEnum {
|
|
28
|
+
applicationJson = "application/json",
|
|
29
|
+
textEventStream = "text/event-stream",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create chat completion
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Creates a model response for the given chat conversation with support for retries, fallbacks, prompts, and variables.
|
|
37
|
+
*/
|
|
38
|
+
export function routerChatCompletions(
|
|
39
|
+
client: OrqCore,
|
|
40
|
+
request: operations.CreateChatCompletionRequestBody,
|
|
41
|
+
options?: RequestOptions & {
|
|
42
|
+
acceptHeaderOverride?: ChatCompletionsAcceptEnum;
|
|
43
|
+
},
|
|
44
|
+
): APIPromise<
|
|
45
|
+
Result<
|
|
46
|
+
operations.CreateChatCompletionResponse,
|
|
47
|
+
| OrqError
|
|
48
|
+
| ResponseValidationError
|
|
49
|
+
| ConnectionError
|
|
50
|
+
| RequestAbortedError
|
|
51
|
+
| RequestTimeoutError
|
|
52
|
+
| InvalidRequestError
|
|
53
|
+
| UnexpectedClientError
|
|
54
|
+
| SDKValidationError
|
|
55
|
+
>
|
|
56
|
+
> {
|
|
57
|
+
return new APIPromise($do(
|
|
58
|
+
client,
|
|
59
|
+
request,
|
|
60
|
+
options,
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function $do(
|
|
65
|
+
client: OrqCore,
|
|
66
|
+
request: operations.CreateChatCompletionRequestBody,
|
|
67
|
+
options?: RequestOptions & {
|
|
68
|
+
acceptHeaderOverride?: ChatCompletionsAcceptEnum;
|
|
69
|
+
},
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.CreateChatCompletionResponse,
|
|
74
|
+
| OrqError
|
|
75
|
+
| ResponseValidationError
|
|
76
|
+
| ConnectionError
|
|
77
|
+
| RequestAbortedError
|
|
78
|
+
| RequestTimeoutError
|
|
79
|
+
| InvalidRequestError
|
|
80
|
+
| UnexpectedClientError
|
|
81
|
+
| SDKValidationError
|
|
82
|
+
>,
|
|
83
|
+
APICall,
|
|
84
|
+
]
|
|
85
|
+
> {
|
|
86
|
+
const parsed = safeParse(
|
|
87
|
+
request,
|
|
88
|
+
(value) =>
|
|
89
|
+
operations.CreateChatCompletionRequestBody$outboundSchema.parse(value),
|
|
90
|
+
"Input validation failed",
|
|
91
|
+
);
|
|
92
|
+
if (!parsed.ok) {
|
|
93
|
+
return [parsed, { status: "invalid" }];
|
|
94
|
+
}
|
|
95
|
+
const payload = parsed.value;
|
|
96
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v2/gateway/chat/completions")();
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: options?.acceptHeaderOverride
|
|
103
|
+
|| "application/json;q=1, text/event-stream;q=0",
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
107
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
108
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
109
|
+
|
|
110
|
+
const context = {
|
|
111
|
+
options: client._options,
|
|
112
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
+
operationID: "createChatCompletion",
|
|
114
|
+
oAuth2Scopes: null,
|
|
115
|
+
|
|
116
|
+
resolvedSecurity: requestSecurity,
|
|
117
|
+
|
|
118
|
+
securitySource: client._options.apiKey,
|
|
119
|
+
retryConfig: options?.retries
|
|
120
|
+
|| client._options.retryConfig
|
|
121
|
+
|| { strategy: "none" },
|
|
122
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const requestRes = client._createRequest(context, {
|
|
126
|
+
security: requestSecurity,
|
|
127
|
+
method: "POST",
|
|
128
|
+
baseURL: options?.serverURL,
|
|
129
|
+
path: path,
|
|
130
|
+
headers: headers,
|
|
131
|
+
body: body,
|
|
132
|
+
userAgent: client._options.userAgent,
|
|
133
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
134
|
+
}, options);
|
|
135
|
+
if (!requestRes.ok) {
|
|
136
|
+
return [requestRes, { status: "invalid" }];
|
|
137
|
+
}
|
|
138
|
+
const req = requestRes.value;
|
|
139
|
+
|
|
140
|
+
const doResult = await client._do(req, {
|
|
141
|
+
context,
|
|
142
|
+
errorCodes: ["4XX", "5XX"],
|
|
143
|
+
retryConfig: context.retryConfig,
|
|
144
|
+
retryCodes: context.retryCodes,
|
|
145
|
+
});
|
|
146
|
+
if (!doResult.ok) {
|
|
147
|
+
return [doResult, { status: "request-error", request: req }];
|
|
148
|
+
}
|
|
149
|
+
const response = doResult.value;
|
|
150
|
+
|
|
151
|
+
const [result] = await M.match<
|
|
152
|
+
operations.CreateChatCompletionResponse,
|
|
153
|
+
| OrqError
|
|
154
|
+
| ResponseValidationError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| UnexpectedClientError
|
|
160
|
+
| SDKValidationError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, operations.CreateChatCompletionResponse$inboundSchema),
|
|
163
|
+
M.sse(200, operations.CreateChatCompletionResponse$inboundSchema),
|
|
164
|
+
M.fail("4XX"),
|
|
165
|
+
M.fail("5XX"),
|
|
166
|
+
)(response, req);
|
|
167
|
+
if (!result.ok) {
|
|
168
|
+
return [result, { status: "complete", request: req, response }];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return [result, { status: "complete", request: req, response }];
|
|
172
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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 { OrqError } from "../models/errors/orqerror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.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
|
+
* Create image
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Create an Image
|
|
32
|
+
*/
|
|
33
|
+
export function routerImagesGenerate(
|
|
34
|
+
client: OrqCore,
|
|
35
|
+
request: operations.CreateImageRequestBody,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.CreateImageResponseBody,
|
|
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.CreateImageRequestBody,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.CreateImageResponseBody,
|
|
65
|
+
| OrqError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.CreateImageRequestBody$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
87
|
+
|
|
88
|
+
const path = pathToFunc("/v2/gateway/images/generations")();
|
|
89
|
+
|
|
90
|
+
const headers = new Headers(compactMap({
|
|
91
|
+
"Content-Type": "application/json",
|
|
92
|
+
Accept: "application/json",
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
96
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
97
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
+
|
|
99
|
+
const context = {
|
|
100
|
+
options: client._options,
|
|
101
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
102
|
+
operationID: "createImage",
|
|
103
|
+
oAuth2Scopes: null,
|
|
104
|
+
|
|
105
|
+
resolvedSecurity: requestSecurity,
|
|
106
|
+
|
|
107
|
+
securitySource: client._options.apiKey,
|
|
108
|
+
retryConfig: options?.retries
|
|
109
|
+
|| client._options.retryConfig
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const requestRes = client._createRequest(context, {
|
|
115
|
+
security: requestSecurity,
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
body: body,
|
|
121
|
+
userAgent: client._options.userAgent,
|
|
122
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
123
|
+
}, options);
|
|
124
|
+
if (!requestRes.ok) {
|
|
125
|
+
return [requestRes, { status: "invalid" }];
|
|
126
|
+
}
|
|
127
|
+
const req = requestRes.value;
|
|
128
|
+
|
|
129
|
+
const doResult = await client._do(req, {
|
|
130
|
+
context,
|
|
131
|
+
errorCodes: ["4XX", "5XX"],
|
|
132
|
+
retryConfig: context.retryConfig,
|
|
133
|
+
retryCodes: context.retryCodes,
|
|
134
|
+
});
|
|
135
|
+
if (!doResult.ok) {
|
|
136
|
+
return [doResult, { status: "request-error", request: req }];
|
|
137
|
+
}
|
|
138
|
+
const response = doResult.value;
|
|
139
|
+
|
|
140
|
+
const [result] = await M.match<
|
|
141
|
+
operations.CreateImageResponseBody,
|
|
142
|
+
| OrqError
|
|
143
|
+
| ResponseValidationError
|
|
144
|
+
| ConnectionError
|
|
145
|
+
| RequestAbortedError
|
|
146
|
+
| RequestTimeoutError
|
|
147
|
+
| InvalidRequestError
|
|
148
|
+
| UnexpectedClientError
|
|
149
|
+
| SDKValidationError
|
|
150
|
+
>(
|
|
151
|
+
M.json(200, operations.CreateImageResponseBody$inboundSchema),
|
|
152
|
+
M.fail("4XX"),
|
|
153
|
+
M.fail("5XX"),
|
|
154
|
+
)(response, req);
|
|
155
|
+
if (!result.ok) {
|
|
156
|
+
return [result, { status: "complete", request: req, response }];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return [result, { status: "complete", request: req, response }];
|
|
160
|
+
}
|
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: "4.1.0-rc.
|
|
72
|
-
genVersion: "2.
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 4.1.0-rc.
|
|
71
|
+
sdkVersion: "4.1.0-rc.50",
|
|
72
|
+
genVersion: "2.787.2",
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 4.1.0-rc.50 2.787.2 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
package/src/lib/event-streams.ts
CHANGED
|
@@ -31,7 +31,7 @@ export class EventStream<T extends SseMessage<unknown>>
|
|
|
31
31
|
const message = buffer.slice(0, match.index);
|
|
32
32
|
buffer = buffer.slice(match.index + match.length);
|
|
33
33
|
const item = parseMessage(message, parse);
|
|
34
|
-
if (item
|
|
34
|
+
if (item && !item.done) return downstream.enqueue(item.value);
|
|
35
35
|
if (item?.done) {
|
|
36
36
|
await upstream.cancel("done");
|
|
37
37
|
return downstream.close();
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -109,6 +109,8 @@ import { tool$promptsListVersions } from "./tools/promptsListVersions.js";
|
|
|
109
109
|
import { tool$promptsRetrieve } from "./tools/promptsRetrieve.js";
|
|
110
110
|
import { tool$promptsUpdate } from "./tools/promptsUpdate.js";
|
|
111
111
|
import { tool$remoteconfigsRetrieve } from "./tools/remoteconfigsRetrieve.js";
|
|
112
|
+
import { tool$routerChatCompletions } from "./tools/routerChatCompletions.js";
|
|
113
|
+
import { tool$routerImagesGenerate } from "./tools/routerImagesGenerate.js";
|
|
112
114
|
import { tool$toolsCreate } from "./tools/toolsCreate.js";
|
|
113
115
|
import { tool$toolsDelete } from "./tools/toolsDelete.js";
|
|
114
116
|
import { tool$toolsList } from "./tools/toolsList.js";
|
|
@@ -127,7 +129,7 @@ export function createMCPServer(deps: {
|
|
|
127
129
|
}) {
|
|
128
130
|
const server = new McpServer({
|
|
129
131
|
name: "Orq",
|
|
130
|
-
version: "4.1.0-rc.
|
|
132
|
+
version: "4.1.0-rc.50",
|
|
131
133
|
});
|
|
132
134
|
|
|
133
135
|
const client = new OrqCore({
|
|
@@ -258,6 +260,8 @@ export function createMCPServer(deps: {
|
|
|
258
260
|
tool(tool$datasetsUpdateDatapoint);
|
|
259
261
|
tool(tool$datasetsDeleteDatapoint);
|
|
260
262
|
tool(tool$datasetsClear);
|
|
263
|
+
tool(tool$routerChatCompletions);
|
|
264
|
+
tool(tool$routerImagesGenerate);
|
|
261
265
|
tool(tool$deploymentsMetricsCreate);
|
|
262
266
|
tool(tool$agentsResponsesCreate);
|
|
263
267
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { routerChatCompletions } from "../../funcs/routerChatCompletions.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateChatCompletionRequestBody$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$routerChatCompletions: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "router-chat-completions",
|
|
15
|
+
description: `Create chat completion
|
|
16
|
+
|
|
17
|
+
Creates a model response for the given chat conversation with support for retries, fallbacks, prompts, and variables.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await routerChatCompletions(
|
|
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,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { routerImagesGenerate } from "../../funcs/routerImagesGenerate.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateImageRequestBody$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$routerImagesGenerate: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "router-images-generate",
|
|
15
|
+
description: `Create image
|
|
16
|
+
|
|
17
|
+
Create an Image`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await routerImagesGenerate(
|
|
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
|
+
};
|
|
@@ -128,7 +128,7 @@ export const ConversationResponse$inboundSchema: z.ZodType<
|
|
|
128
128
|
z.ZodTypeDef,
|
|
129
129
|
unknown
|
|
130
130
|
> = z.object({
|
|
131
|
-
_id: z.string().default("
|
|
131
|
+
_id: z.string().default("conv_01kccay59y23wgde9jv5bxed8q"),
|
|
132
132
|
entityId: z.string(),
|
|
133
133
|
kind: ConversationResponseKind$inboundSchema,
|
|
134
134
|
displayName: z.string(),
|
|
@@ -161,7 +161,7 @@ export const ConversationResponse$outboundSchema: z.ZodType<
|
|
|
161
161
|
z.ZodTypeDef,
|
|
162
162
|
ConversationResponse
|
|
163
163
|
> = z.object({
|
|
164
|
-
id: z.string().default("
|
|
164
|
+
id: z.string().default("conv_01kccay59y23wgde9jv5bxed8q"),
|
|
165
165
|
entityId: z.string(),
|
|
166
166
|
kind: ConversationResponseKind$outboundSchema,
|
|
167
167
|
displayName: z.string(),
|
|
@@ -27,6 +27,7 @@ export * from "./invokedeploymentrequest.js";
|
|
|
27
27
|
export * from "./partdelta.js";
|
|
28
28
|
export * from "./partdeltaevent.js";
|
|
29
29
|
export * from "./partdoneevent.js";
|
|
30
|
+
export * from "./publiccontact.js";
|
|
30
31
|
export * from "./reasoningpart.js";
|
|
31
32
|
export * from "./reasoningpartschema.js";
|
|
32
33
|
export * from "./redactedreasoningpartschema.js";
|
|
@@ -79,7 +79,7 @@ export const PartReasoningPart$inboundSchema: z.ZodType<
|
|
|
79
79
|
z.ZodTypeDef,
|
|
80
80
|
unknown
|
|
81
81
|
> = z.object({
|
|
82
|
-
_id: z.string().default("
|
|
82
|
+
_id: z.string().default("reasoning_01kccay57r85aj4k5nhfcrxavv"),
|
|
83
83
|
metadata: z.record(z.any()).optional(),
|
|
84
84
|
kind: PartKind$inboundSchema,
|
|
85
85
|
reasoning: z.string(),
|
|
@@ -104,7 +104,7 @@ export const PartReasoningPart$outboundSchema: z.ZodType<
|
|
|
104
104
|
z.ZodTypeDef,
|
|
105
105
|
PartReasoningPart
|
|
106
106
|
> = z.object({
|
|
107
|
-
id: z.string().default("
|
|
107
|
+
id: z.string().default("reasoning_01kccay57r85aj4k5nhfcrxavv"),
|
|
108
108
|
metadata: z.record(z.any()).optional(),
|
|
109
109
|
kind: PartKind$outboundSchema,
|
|
110
110
|
reasoning: z.string(),
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Information about the contact making the request. If the contact does not exist, it will be created automatically.
|
|
13
|
+
*/
|
|
14
|
+
export type PublicContact = {
|
|
15
|
+
/**
|
|
16
|
+
* Unique identifier for the contact
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* Display name of the contact
|
|
21
|
+
*/
|
|
22
|
+
displayName?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Email address of the contact
|
|
25
|
+
*/
|
|
26
|
+
email?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* A hash of key/value pairs containing any other data about the contact
|
|
29
|
+
*/
|
|
30
|
+
metadata?: Array<{ [k: string]: any }> | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* URL to the contact's avatar or logo
|
|
33
|
+
*/
|
|
34
|
+
logoUrl?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* A list of tags associated with the contact
|
|
37
|
+
*/
|
|
38
|
+
tags?: Array<string> | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const PublicContact$inboundSchema: z.ZodType<
|
|
43
|
+
PublicContact,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
unknown
|
|
46
|
+
> = z.object({
|
|
47
|
+
id: z.string(),
|
|
48
|
+
display_name: z.string().optional(),
|
|
49
|
+
email: z.string().optional(),
|
|
50
|
+
metadata: z.array(z.record(z.any())).optional(),
|
|
51
|
+
logo_url: z.string().optional(),
|
|
52
|
+
tags: z.array(z.string()).optional(),
|
|
53
|
+
}).transform((v) => {
|
|
54
|
+
return remap$(v, {
|
|
55
|
+
"display_name": "displayName",
|
|
56
|
+
"logo_url": "logoUrl",
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
/** @internal */
|
|
60
|
+
export type PublicContact$Outbound = {
|
|
61
|
+
id: string;
|
|
62
|
+
display_name?: string | undefined;
|
|
63
|
+
email?: string | undefined;
|
|
64
|
+
metadata?: Array<{ [k: string]: any }> | undefined;
|
|
65
|
+
logo_url?: string | undefined;
|
|
66
|
+
tags?: Array<string> | undefined;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** @internal */
|
|
70
|
+
export const PublicContact$outboundSchema: z.ZodType<
|
|
71
|
+
PublicContact$Outbound,
|
|
72
|
+
z.ZodTypeDef,
|
|
73
|
+
PublicContact
|
|
74
|
+
> = z.object({
|
|
75
|
+
id: z.string(),
|
|
76
|
+
displayName: z.string().optional(),
|
|
77
|
+
email: z.string().optional(),
|
|
78
|
+
metadata: z.array(z.record(z.any())).optional(),
|
|
79
|
+
logoUrl: z.string().optional(),
|
|
80
|
+
tags: z.array(z.string()).optional(),
|
|
81
|
+
}).transform((v) => {
|
|
82
|
+
return remap$(v, {
|
|
83
|
+
displayName: "display_name",
|
|
84
|
+
logoUrl: "logo_url",
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export function publicContactToJSON(publicContact: PublicContact): string {
|
|
89
|
+
return JSON.stringify(PublicContact$outboundSchema.parse(publicContact));
|
|
90
|
+
}
|
|
91
|
+
export function publicContactFromJSON(
|
|
92
|
+
jsonString: string,
|
|
93
|
+
): SafeParseResult<PublicContact, SDKValidationError> {
|
|
94
|
+
return safeParse(
|
|
95
|
+
jsonString,
|
|
96
|
+
(x) => PublicContact$inboundSchema.parse(JSON.parse(x)),
|
|
97
|
+
`Failed to parse 'PublicContact' from JSON`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
@@ -40,7 +40,7 @@ export const ReasoningPart$inboundSchema: z.ZodType<
|
|
|
40
40
|
z.ZodTypeDef,
|
|
41
41
|
unknown
|
|
42
42
|
> = z.object({
|
|
43
|
-
_id: z.string().default("
|
|
43
|
+
_id: z.string().default("reasoning_01kccay57q9egzwbd8qgqqf2th"),
|
|
44
44
|
metadata: z.record(z.any()).optional(),
|
|
45
45
|
kind: z.literal("reasoning"),
|
|
46
46
|
reasoning: z.string(),
|
|
@@ -65,7 +65,7 @@ export const ReasoningPart$outboundSchema: z.ZodType<
|
|
|
65
65
|
z.ZodTypeDef,
|
|
66
66
|
ReasoningPart
|
|
67
67
|
> = z.object({
|
|
68
|
-
id: z.string().default("
|
|
68
|
+
id: z.string().default("reasoning_01kccay57q9egzwbd8qgqqf2th"),
|
|
69
69
|
metadata: z.record(z.any()).optional(),
|
|
70
70
|
kind: z.literal("reasoning"),
|
|
71
71
|
reasoning: z.string(),
|