@orq-ai/node 4.9.23 → 4.9.28
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/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createcontact.js +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.js +16 -16
- package/models/operations/createidentity.js +1 -1
- package/models/operations/createtool.js +6 -6
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listidentities.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrieveidentity.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.js +16 -16
- package/models/operations/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +3 -3
- package/packages/orq-rc/src/funcs/annotationsCreate.ts +3 -0
- package/packages/orq-rc/src/funcs/annotationsDelete.ts +3 -0
- package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +5 -13
- package/packages/orq-rc/src/funcs/deploymentsStream.ts +1 -9
- package/packages/orq-rc/src/funcs/knowledgeGetChunksCount.ts +3 -0
- package/packages/orq-rc/src/funcs/modelsAzureFoundryDeployments.ts +168 -0
- package/packages/orq-rc/src/funcs/modelsCreate.ts +162 -0
- package/packages/orq-rc/src/funcs/modelsCreateAutorouter.ts +163 -0
- package/packages/orq-rc/src/funcs/modelsCreateAwsBedrock.ts +163 -0
- package/packages/orq-rc/src/funcs/modelsCreateOpenaiLike.ts +163 -0
- package/packages/orq-rc/src/funcs/modelsCreateVertex.ts +163 -0
- package/packages/orq-rc/src/funcs/modelsDelete.ts +168 -0
- package/packages/orq-rc/src/funcs/modelsDisable.ts +168 -0
- package/packages/orq-rc/src/funcs/modelsEnable.ts +163 -0
- package/packages/orq-rc/src/funcs/{agentsPostV2AgentsA2a.ts → modelsImportLitellm.ts} +16 -30
- package/packages/orq-rc/src/funcs/modelsListLitellm.ts +144 -0
- package/packages/orq-rc/src/funcs/{deploymentsMetricsCreate.ts → modelsUpdate.ts} +14 -17
- package/packages/orq-rc/src/funcs/modelsUpdateAutorouter.ts +169 -0
- package/packages/orq-rc/src/funcs/modelsUpdateAwsBedrock.ts +169 -0
- package/packages/orq-rc/src/funcs/modelsUpdateOpenaiLike.ts +169 -0
- package/packages/orq-rc/src/funcs/modelsValidate.ts +163 -0
- package/packages/orq-rc/src/funcs/modelsValidateAwsBedrock.ts +164 -0
- package/packages/orq-rc/src/lib/config.ts +3 -13
- package/packages/orq-rc/src/lib/env.ts +0 -32
- package/packages/orq-rc/src/lib/sdks.ts +2 -2
- package/packages/orq-rc/src/models/components/agentthoughtstreamingevent.ts +43 -55
- package/packages/orq-rc/src/models/components/autorouterconfig.ts +78 -0
- package/packages/orq-rc/src/models/components/azurefoundrydeployment.ts +44 -0
- package/packages/orq-rc/src/models/components/azurefoundrydeploymentmasterdata.ts +60 -0
- package/packages/orq-rc/src/models/components/createmodelparameter.ts +54 -0
- package/packages/orq-rc/src/models/components/createprojectrequest.ts +6 -0
- package/packages/orq-rc/src/models/components/domain.ts +14 -21
- package/packages/orq-rc/src/models/components/index.ts +21 -3
- package/packages/orq-rc/src/models/components/listcapabilitiesresponse.ts +1 -2
- package/packages/orq-rc/src/models/components/litellmmodel.ts +50 -0
- package/packages/orq-rc/src/models/components/litellmmodelinfo.ts +97 -0
- package/packages/orq-rc/src/models/components/litellmparams.ts +43 -0
- package/packages/orq-rc/src/models/components/modelconfigurationresponse.ts +82 -0
- package/packages/orq-rc/src/models/components/modeldocument.ts +112 -0
- package/packages/orq-rc/src/models/components/modelmetadata.ts +720 -0
- package/packages/orq-rc/src/models/components/modelparameterdocument.ts +53 -0
- package/packages/orq-rc/src/models/components/price.ts +56 -0
- package/packages/orq-rc/src/models/components/pricing.ts +93 -0
- package/packages/orq-rc/src/models/components/pricingvariant.ts +90 -0
- package/packages/orq-rc/src/models/components/project.ts +5 -0
- package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
- package/packages/orq-rc/src/models/components/updatemodelparameter.ts +61 -0
- package/packages/orq-rc/src/models/components/updateprojectrequest.ts +6 -0
- package/packages/orq-rc/src/models/components/vertexcapabilities.ts +37 -0
- package/packages/orq-rc/src/models/components/vertexconfiguration.ts +45 -0
- package/packages/orq-rc/src/models/components/vertexmodelconfiguration.ts +53 -0
- package/packages/orq-rc/src/models/components/vertexparameters.ts +47 -0
- package/packages/orq-rc/src/models/components/vertexparamrange.ts +34 -0
- package/packages/orq-rc/src/models/components/vertexparamrangeint.ts +34 -0
- package/packages/orq-rc/src/models/errors/index.ts +0 -1
- package/packages/orq-rc/src/models/operations/createagentrequest.ts +14 -101
- package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
- package/packages/orq-rc/src/models/operations/createdatasource.ts +7 -1
- package/packages/orq-rc/src/models/operations/createeval.ts +668 -1296
- package/packages/orq-rc/src/models/operations/createtool.ts +24 -28
- package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +1606 -1156
- package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +3761 -320
- package/packages/orq-rc/src/models/operations/deploymentstream.ts +285 -249
- package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
- package/packages/orq-rc/src/models/operations/getevals.ts +16 -16
- package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/index.ts +15 -2
- package/packages/orq-rc/src/models/operations/listagents.ts +3 -87
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
- package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
- package/packages/orq-rc/src/models/operations/modelazurefoundrydeployments.ts +90 -0
- package/packages/orq-rc/src/models/operations/modelcreate.ts +184 -0
- package/packages/orq-rc/src/models/operations/modelcreateautorouter.ts +151 -0
- package/packages/orq-rc/src/models/operations/modelcreateawsbedrock.ts +218 -0
- package/packages/orq-rc/src/models/operations/modelcreateopenailike.ts +202 -0
- package/packages/orq-rc/src/models/operations/modelcreatevertex.ts +144 -0
- package/packages/orq-rc/src/models/operations/modeldelete.ts +34 -0
- package/packages/orq-rc/src/models/operations/modeldisable.ts +39 -0
- package/packages/orq-rc/src/models/operations/modelenable.ts +36 -0
- package/packages/orq-rc/src/models/operations/modelupdate.ts +198 -0
- package/packages/orq-rc/src/models/operations/modelupdateautorouter.ts +189 -0
- package/packages/orq-rc/src/models/operations/modelupdateawsbedrock.ts +248 -0
- package/packages/orq-rc/src/models/operations/modelupdateopenailike.ts +236 -0
- package/packages/orq-rc/src/models/operations/modelvalidate.ts +57 -0
- package/packages/orq-rc/src/models/operations/modelvalidateawsbedrock.ts +57 -0
- package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +0 -91
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
- package/packages/orq-rc/src/models/operations/runagent.ts +20 -29
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateagent.ts +0 -171
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateeval.ts +41 -43
- package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
- package/packages/orq-rc/src/sdk/agents.ts +17 -35
- package/packages/orq-rc/src/sdk/annotations.ts +6 -0
- package/packages/orq-rc/src/sdk/deployments.ts +1 -8
- package/packages/orq-rc/src/sdk/knowledge.ts +3 -0
- package/packages/orq-rc/src/sdk/models.ts +305 -0
- package/packages/orq-rc/src/sdk/sdk.ts +5 -5
- package/src/lib/config.ts +3 -3
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createcontact.ts +1 -1
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/createidentity.ts +1 -1
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/listidentities.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrieveidentity.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +16 -16
- package/src/models/operations/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/packages/orq-rc/src/models/components/domaingroup.ts +0 -18
- package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +0 -3457
- package/packages/orq-rc/src/models/components/scopemode.ts +0 -17
- package/packages/orq-rc/src/models/errors/postv2agentsa2a.ts +0 -96
- package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -2370
- package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +0 -249
- package/packages/orq-rc/src/sdk/metrics.ts +0 -29
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import * as z from "zod/v3";
|
|
5
6
|
import { OrqCore } from "../core.js";
|
|
6
7
|
import { encodeJSON } from "../lib/encodings.js";
|
|
7
8
|
import { matchStatusCode } from "../lib/http.js";
|
|
@@ -11,6 +12,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
11
12
|
import { RequestOptions } from "../lib/sdks.js";
|
|
12
13
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
14
|
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import * as components from "../models/components/index.js";
|
|
14
16
|
import {
|
|
15
17
|
ConnectionError,
|
|
16
18
|
InvalidRequestError,
|
|
@@ -18,29 +20,25 @@ import {
|
|
|
18
20
|
RequestTimeoutError,
|
|
19
21
|
UnexpectedClientError,
|
|
20
22
|
} from "../models/errors/httpclienterrors.js";
|
|
21
|
-
import * as errors from "../models/errors/index.js";
|
|
22
23
|
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
24
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
25
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import * as operations from "../models/operations/index.js";
|
|
26
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Import models from LiteLLM
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
*
|
|
33
|
+
* Bulk-imports a list of LiteLLM model definitions into the workspace model garden.
|
|
34
34
|
*/
|
|
35
|
-
export function
|
|
35
|
+
export function modelsImportLitellm(
|
|
36
36
|
client: OrqCore,
|
|
37
|
-
request
|
|
37
|
+
request: Array<components.LiteLLMModel> | null,
|
|
38
38
|
options?: RequestOptions,
|
|
39
39
|
): APIPromise<
|
|
40
40
|
Result<
|
|
41
|
-
|
|
42
|
-
| errors.PostV2AgentsA2aResponseBody
|
|
43
|
-
| errors.PostV2AgentsA2aAgentsResponseBody
|
|
41
|
+
Array<components.ModelDocument>,
|
|
44
42
|
| OrqError
|
|
45
43
|
| ResponseValidationError
|
|
46
44
|
| ConnectionError
|
|
@@ -60,14 +58,12 @@ export function agentsPostV2AgentsA2a(
|
|
|
60
58
|
|
|
61
59
|
async function $do(
|
|
62
60
|
client: OrqCore,
|
|
63
|
-
request
|
|
61
|
+
request: Array<components.LiteLLMModel> | null,
|
|
64
62
|
options?: RequestOptions,
|
|
65
63
|
): Promise<
|
|
66
64
|
[
|
|
67
65
|
Result<
|
|
68
|
-
|
|
69
|
-
| errors.PostV2AgentsA2aResponseBody
|
|
70
|
-
| errors.PostV2AgentsA2aAgentsResponseBody
|
|
66
|
+
Array<components.ModelDocument>,
|
|
71
67
|
| OrqError
|
|
72
68
|
| ResponseValidationError
|
|
73
69
|
| ConnectionError
|
|
@@ -83,9 +79,7 @@ async function $do(
|
|
|
83
79
|
const parsed = safeParse(
|
|
84
80
|
request,
|
|
85
81
|
(value) =>
|
|
86
|
-
|
|
87
|
-
value,
|
|
88
|
-
),
|
|
82
|
+
z.nullable(z.array(components.LiteLLMModel$outboundSchema)).parse(value),
|
|
89
83
|
"Input validation failed",
|
|
90
84
|
);
|
|
91
85
|
if (!parsed.ok) {
|
|
@@ -96,7 +90,7 @@ async function $do(
|
|
|
96
90
|
? null
|
|
97
91
|
: encodeJSON("body", payload, { explode: true });
|
|
98
92
|
|
|
99
|
-
const path = pathToFunc("/v2/
|
|
93
|
+
const path = pathToFunc("/v2/models/litellm/import")();
|
|
100
94
|
|
|
101
95
|
const headers = new Headers(compactMap({
|
|
102
96
|
"Content-Type": "application/json",
|
|
@@ -110,7 +104,7 @@ async function $do(
|
|
|
110
104
|
const context = {
|
|
111
105
|
options: client._options,
|
|
112
106
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
-
operationID: "
|
|
107
|
+
operationID: "ModelLiteLLMImport",
|
|
114
108
|
oAuth2Scopes: null,
|
|
115
109
|
|
|
116
110
|
resolvedSecurity: requestSecurity,
|
|
@@ -149,14 +143,8 @@ async function $do(
|
|
|
149
143
|
}
|
|
150
144
|
const response = doResult.value;
|
|
151
145
|
|
|
152
|
-
const responseFields = {
|
|
153
|
-
HttpMeta: { Response: response, Request: req },
|
|
154
|
-
};
|
|
155
|
-
|
|
156
146
|
const [result] = await M.match<
|
|
157
|
-
|
|
158
|
-
| errors.PostV2AgentsA2aResponseBody
|
|
159
|
-
| errors.PostV2AgentsA2aAgentsResponseBody
|
|
147
|
+
Array<components.ModelDocument>,
|
|
160
148
|
| OrqError
|
|
161
149
|
| ResponseValidationError
|
|
162
150
|
| ConnectionError
|
|
@@ -166,12 +154,10 @@ async function $do(
|
|
|
166
154
|
| UnexpectedClientError
|
|
167
155
|
| SDKValidationError
|
|
168
156
|
>(
|
|
169
|
-
M.json(
|
|
170
|
-
M.
|
|
171
|
-
M.jsonErr(409, errors.PostV2AgentsA2aAgentsResponseBody$inboundSchema),
|
|
172
|
-
M.fail("4XX"),
|
|
157
|
+
M.json(200, z.array(components.ModelDocument$inboundSchema)),
|
|
158
|
+
M.fail([400, 404, "4XX"]),
|
|
173
159
|
M.fail("5XX"),
|
|
174
|
-
)(response, req
|
|
160
|
+
)(response, req);
|
|
175
161
|
if (!result.ok) {
|
|
176
162
|
return [result, { status: "complete", request: req, response }];
|
|
177
163
|
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { OrqCore } from "../core.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.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 { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List models from configured LiteLLM instance
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Fetches the list of models from the LiteLLM instance configured for the workspace. Requires a stored LiteLLM integration.
|
|
31
|
+
*/
|
|
32
|
+
export function modelsListLitellm(
|
|
33
|
+
client: OrqCore,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
Array<{ [k: string]: any }>,
|
|
38
|
+
| OrqError
|
|
39
|
+
| ResponseValidationError
|
|
40
|
+
| ConnectionError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| UnexpectedClientError
|
|
45
|
+
| SDKValidationError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
options,
|
|
51
|
+
));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function $do(
|
|
55
|
+
client: OrqCore,
|
|
56
|
+
options?: RequestOptions,
|
|
57
|
+
): Promise<
|
|
58
|
+
[
|
|
59
|
+
Result<
|
|
60
|
+
Array<{ [k: string]: any }>,
|
|
61
|
+
| OrqError
|
|
62
|
+
| ResponseValidationError
|
|
63
|
+
| ConnectionError
|
|
64
|
+
| RequestAbortedError
|
|
65
|
+
| RequestTimeoutError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| UnexpectedClientError
|
|
68
|
+
| SDKValidationError
|
|
69
|
+
>,
|
|
70
|
+
APICall,
|
|
71
|
+
]
|
|
72
|
+
> {
|
|
73
|
+
const path = pathToFunc("/v2/models/litellm/models")();
|
|
74
|
+
|
|
75
|
+
const headers = new Headers(compactMap({
|
|
76
|
+
Accept: "application/json",
|
|
77
|
+
}));
|
|
78
|
+
|
|
79
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
80
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
81
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
82
|
+
|
|
83
|
+
const context = {
|
|
84
|
+
options: client._options,
|
|
85
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
86
|
+
operationID: "ModelListLitellm",
|
|
87
|
+
oAuth2Scopes: null,
|
|
88
|
+
|
|
89
|
+
resolvedSecurity: requestSecurity,
|
|
90
|
+
|
|
91
|
+
securitySource: client._options.apiKey,
|
|
92
|
+
retryConfig: options?.retries
|
|
93
|
+
|| client._options.retryConfig
|
|
94
|
+
|| { strategy: "none" },
|
|
95
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const requestRes = client._createRequest(context, {
|
|
99
|
+
security: requestSecurity,
|
|
100
|
+
method: "GET",
|
|
101
|
+
baseURL: options?.serverURL,
|
|
102
|
+
path: path,
|
|
103
|
+
headers: headers,
|
|
104
|
+
userAgent: client._options.userAgent,
|
|
105
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
106
|
+
}, options);
|
|
107
|
+
if (!requestRes.ok) {
|
|
108
|
+
return [requestRes, { status: "invalid" }];
|
|
109
|
+
}
|
|
110
|
+
const req = requestRes.value;
|
|
111
|
+
|
|
112
|
+
const doResult = await client._do(req, {
|
|
113
|
+
context,
|
|
114
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
115
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
116
|
+
retryConfig: context.retryConfig,
|
|
117
|
+
retryCodes: context.retryCodes,
|
|
118
|
+
});
|
|
119
|
+
if (!doResult.ok) {
|
|
120
|
+
return [doResult, { status: "request-error", request: req }];
|
|
121
|
+
}
|
|
122
|
+
const response = doResult.value;
|
|
123
|
+
|
|
124
|
+
const [result] = await M.match<
|
|
125
|
+
Array<{ [k: string]: any }>,
|
|
126
|
+
| OrqError
|
|
127
|
+
| ResponseValidationError
|
|
128
|
+
| ConnectionError
|
|
129
|
+
| RequestAbortedError
|
|
130
|
+
| RequestTimeoutError
|
|
131
|
+
| InvalidRequestError
|
|
132
|
+
| UnexpectedClientError
|
|
133
|
+
| SDKValidationError
|
|
134
|
+
>(
|
|
135
|
+
M.json(200, z.array(z.record(z.any()))),
|
|
136
|
+
M.fail([404, "4XX"]),
|
|
137
|
+
M.fail([500, "5XX"]),
|
|
138
|
+
)(response, req);
|
|
139
|
+
if (!result.ok) {
|
|
140
|
+
return [result, { status: "complete", request: req, response }];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return [result, { status: "complete", request: req, response }];
|
|
144
|
+
}
|
|
@@ -26,20 +26,18 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Update custom model
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
32
|
+
* Updates a custom model. Only fields present in the request body are modified, except for `metadata` and `parameters`, which are fully replaced when present (preserved from the legacy handler's behavior).
|
|
35
33
|
*/
|
|
36
|
-
export function
|
|
34
|
+
export function modelsUpdate(
|
|
37
35
|
client: OrqCore,
|
|
38
|
-
request: operations.
|
|
36
|
+
request: operations.ModelUpdateRequest,
|
|
39
37
|
options?: RequestOptions,
|
|
40
38
|
): APIPromise<
|
|
41
39
|
Result<
|
|
42
|
-
operations.
|
|
40
|
+
operations.ModelUpdateResponseBody,
|
|
43
41
|
| OrqError
|
|
44
42
|
| ResponseValidationError
|
|
45
43
|
| ConnectionError
|
|
@@ -59,12 +57,12 @@ export function deploymentsMetricsCreate(
|
|
|
59
57
|
|
|
60
58
|
async function $do(
|
|
61
59
|
client: OrqCore,
|
|
62
|
-
request: operations.
|
|
60
|
+
request: operations.ModelUpdateRequest,
|
|
63
61
|
options?: RequestOptions,
|
|
64
62
|
): Promise<
|
|
65
63
|
[
|
|
66
64
|
Result<
|
|
67
|
-
operations.
|
|
65
|
+
operations.ModelUpdateResponseBody,
|
|
68
66
|
| OrqError
|
|
69
67
|
| ResponseValidationError
|
|
70
68
|
| ConnectionError
|
|
@@ -79,8 +77,7 @@ async function $do(
|
|
|
79
77
|
> {
|
|
80
78
|
const parsed = safeParse(
|
|
81
79
|
request,
|
|
82
|
-
(value) =>
|
|
83
|
-
operations.DeploymentCreateMetricRequest$outboundSchema.parse(value),
|
|
80
|
+
(value) => operations.ModelUpdateRequest$outboundSchema.parse(value),
|
|
84
81
|
"Input validation failed",
|
|
85
82
|
);
|
|
86
83
|
if (!parsed.ok) {
|
|
@@ -95,7 +92,7 @@ async function $do(
|
|
|
95
92
|
charEncoding: "percent",
|
|
96
93
|
}),
|
|
97
94
|
};
|
|
98
|
-
const path = pathToFunc("/v2/
|
|
95
|
+
const path = pathToFunc("/v2/models/{id}")(pathParams);
|
|
99
96
|
|
|
100
97
|
const headers = new Headers(compactMap({
|
|
101
98
|
"Content-Type": "application/json",
|
|
@@ -109,7 +106,7 @@ async function $do(
|
|
|
109
106
|
const context = {
|
|
110
107
|
options: client._options,
|
|
111
108
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
-
operationID: "
|
|
109
|
+
operationID: "ModelUpdate",
|
|
113
110
|
oAuth2Scopes: null,
|
|
114
111
|
|
|
115
112
|
resolvedSecurity: requestSecurity,
|
|
@@ -123,7 +120,7 @@ async function $do(
|
|
|
123
120
|
|
|
124
121
|
const requestRes = client._createRequest(context, {
|
|
125
122
|
security: requestSecurity,
|
|
126
|
-
method: "
|
|
123
|
+
method: "PATCH",
|
|
127
124
|
baseURL: options?.serverURL,
|
|
128
125
|
path: path,
|
|
129
126
|
headers: headers,
|
|
@@ -149,7 +146,7 @@ async function $do(
|
|
|
149
146
|
const response = doResult.value;
|
|
150
147
|
|
|
151
148
|
const [result] = await M.match<
|
|
152
|
-
operations.
|
|
149
|
+
operations.ModelUpdateResponseBody,
|
|
153
150
|
| OrqError
|
|
154
151
|
| ResponseValidationError
|
|
155
152
|
| ConnectionError
|
|
@@ -159,8 +156,8 @@ async function $do(
|
|
|
159
156
|
| UnexpectedClientError
|
|
160
157
|
| SDKValidationError
|
|
161
158
|
>(
|
|
162
|
-
M.json(200, operations.
|
|
163
|
-
M.fail([400,
|
|
159
|
+
M.json(200, operations.ModelUpdateResponseBody$inboundSchema),
|
|
160
|
+
M.fail([400, 404, "4XX"]),
|
|
164
161
|
M.fail("5XX"),
|
|
165
162
|
)(response, req);
|
|
166
163
|
if (!result.ok) {
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { 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
|
+
* Update autorouter custom model
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Re-configures an autorouter model. Each of key/strong_model/economical_model/profile falls back to the existing value when omitted. Changing the key enforces uniqueness and rewrites PRICING_KV.
|
|
33
|
+
*/
|
|
34
|
+
export function modelsUpdateAutorouter(
|
|
35
|
+
client: OrqCore,
|
|
36
|
+
request: operations.ModelUpdateAutorouterRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.ModelUpdateAutorouterResponseBody,
|
|
41
|
+
| OrqError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: OrqCore,
|
|
60
|
+
request: operations.ModelUpdateAutorouterRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
operations.ModelUpdateAutorouterResponseBody,
|
|
66
|
+
| OrqError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) =>
|
|
81
|
+
operations.ModelUpdateAutorouterRequest$outboundSchema.parse(value),
|
|
82
|
+
"Input validation failed",
|
|
83
|
+
);
|
|
84
|
+
if (!parsed.ok) {
|
|
85
|
+
return [parsed, { status: "invalid" }];
|
|
86
|
+
}
|
|
87
|
+
const payload = parsed.value;
|
|
88
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
89
|
+
|
|
90
|
+
const pathParams = {
|
|
91
|
+
id: encodeSimple("id", payload.id, {
|
|
92
|
+
explode: false,
|
|
93
|
+
charEncoding: "percent",
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
const path = pathToFunc("/v2/models/autorouter/{id}")(pathParams);
|
|
97
|
+
|
|
98
|
+
const headers = new Headers(compactMap({
|
|
99
|
+
"Content-Type": "application/json",
|
|
100
|
+
Accept: "application/json",
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
104
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
105
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
106
|
+
|
|
107
|
+
const context = {
|
|
108
|
+
options: client._options,
|
|
109
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
110
|
+
operationID: "ModelUpdateAutorouter",
|
|
111
|
+
oAuth2Scopes: null,
|
|
112
|
+
|
|
113
|
+
resolvedSecurity: requestSecurity,
|
|
114
|
+
|
|
115
|
+
securitySource: client._options.apiKey,
|
|
116
|
+
retryConfig: options?.retries
|
|
117
|
+
|| client._options.retryConfig
|
|
118
|
+
|| { strategy: "none" },
|
|
119
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const requestRes = client._createRequest(context, {
|
|
123
|
+
security: requestSecurity,
|
|
124
|
+
method: "PATCH",
|
|
125
|
+
baseURL: options?.serverURL,
|
|
126
|
+
path: path,
|
|
127
|
+
headers: headers,
|
|
128
|
+
body: body,
|
|
129
|
+
userAgent: client._options.userAgent,
|
|
130
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
131
|
+
}, options);
|
|
132
|
+
if (!requestRes.ok) {
|
|
133
|
+
return [requestRes, { status: "invalid" }];
|
|
134
|
+
}
|
|
135
|
+
const req = requestRes.value;
|
|
136
|
+
|
|
137
|
+
const doResult = await client._do(req, {
|
|
138
|
+
context,
|
|
139
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
140
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
141
|
+
retryConfig: context.retryConfig,
|
|
142
|
+
retryCodes: context.retryCodes,
|
|
143
|
+
});
|
|
144
|
+
if (!doResult.ok) {
|
|
145
|
+
return [doResult, { status: "request-error", request: req }];
|
|
146
|
+
}
|
|
147
|
+
const response = doResult.value;
|
|
148
|
+
|
|
149
|
+
const [result] = await M.match<
|
|
150
|
+
operations.ModelUpdateAutorouterResponseBody,
|
|
151
|
+
| OrqError
|
|
152
|
+
| ResponseValidationError
|
|
153
|
+
| ConnectionError
|
|
154
|
+
| RequestAbortedError
|
|
155
|
+
| RequestTimeoutError
|
|
156
|
+
| InvalidRequestError
|
|
157
|
+
| UnexpectedClientError
|
|
158
|
+
| SDKValidationError
|
|
159
|
+
>(
|
|
160
|
+
M.json(200, operations.ModelUpdateAutorouterResponseBody$inboundSchema),
|
|
161
|
+
M.fail([400, 404, "4XX"]),
|
|
162
|
+
M.fail("5XX"),
|
|
163
|
+
)(response, req);
|
|
164
|
+
if (!result.ok) {
|
|
165
|
+
return [result, { status: "complete", request: req, response }];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return [result, { status: "complete", request: req, response }];
|
|
169
|
+
}
|