@orq-ai/node 4.15.0-rc.53 → 4.15.0-rc.54
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/FUNCTIONS.md +38 -3
- package/README.md +252 -71
- package/examples/deploymentsInvoke.example.ts +62 -0
- package/funcs/deploymentsInvoke.d.ts +18 -0
- package/funcs/deploymentsInvoke.d.ts.map +1 -0
- package/funcs/deploymentsInvoke.js +116 -0
- package/funcs/deploymentsInvoke.js.map +1 -0
- package/funcs/deploymentsStream.d.ts +18 -0
- package/funcs/deploymentsStream.d.ts.map +1 -0
- package/funcs/deploymentsStream.js +129 -0
- package/funcs/deploymentsStream.js.map +1 -0
- package/funcs/skillsUpdate.d.ts +1 -1
- package/funcs/skillsUpdate.js +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/agentresponserequest.d.ts +8 -8
- package/models/components/agentresponserequest.d.ts.map +1 -1
- package/models/components/agentresponserequest.js +10 -9
- package/models/components/agentresponserequest.js.map +1 -1
- package/models/components/agentthoughtstreamingevent.d.ts +12 -12
- package/models/components/agentthoughtstreamingevent.d.ts.map +1 -1
- package/models/components/agentthoughtstreamingevent.js +17 -17
- package/models/components/agentthoughtstreamingevent.js.map +1 -1
- 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/invokedeploymentrequest.d.ts +1544 -0
- package/models/components/invokedeploymentrequest.d.ts.map +1 -0
- package/models/components/invokedeploymentrequest.js +1109 -0
- package/models/components/invokedeploymentrequest.js.map +1 -0
- package/models/components/reasoningpart.js +1 -1
- package/models/components/searchknowledgerequest.d.ts +176 -176
- package/models/components/searchknowledgerequest.d.ts.map +1 -1
- package/models/components/searchknowledgerequest.js +211 -222
- package/models/components/searchknowledgerequest.js.map +1 -1
- package/models/components/updatememorystorerequest.d.ts +5 -0
- package/models/components/updatememorystorerequest.d.ts.map +1 -1
- package/models/components/updatememorystorerequest.js +6 -0
- package/models/components/updatememorystorerequest.js.map +1 -1
- package/models/components/updateskillrequest.d.ts +1 -1
- package/models/operations/createchatcompletion.d.ts +58 -58
- package/models/operations/createchatcompletion.d.ts.map +1 -1
- package/models/operations/createchatcompletion.js +81 -80
- package/models/operations/createchatcompletion.js.map +1 -1
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +5 -5
- package/models/operations/createprompt.d.ts +4 -4
- package/models/operations/createprompt.d.ts.map +1 -1
- package/models/operations/createprompt.js +5 -6
- package/models/operations/createprompt.js.map +1 -1
- package/models/operations/createtool.js +4 -4
- package/models/operations/deploymentgetconfig.d.ts +442 -442
- package/models/operations/deploymentgetconfig.d.ts.map +1 -1
- package/models/operations/deploymentgetconfig.js +481 -485
- package/models/operations/deploymentgetconfig.js.map +1 -1
- package/models/operations/deploymentinvoke.d.ts +367 -0
- package/models/operations/deploymentinvoke.d.ts.map +1 -0
- package/models/operations/deploymentinvoke.js +373 -0
- package/models/operations/deploymentinvoke.js.map +1 -0
- package/models/operations/deployments.d.ts +16 -16
- package/models/operations/deployments.d.ts.map +1 -1
- package/models/operations/deployments.js +16 -18
- package/models/operations/deployments.js.map +1 -1
- package/models/operations/deploymentstream.d.ts +1899 -0
- package/models/operations/deploymentstream.d.ts.map +1 -0
- package/models/operations/deploymentstream.js +1488 -0
- package/models/operations/deploymentstream.js.map +1 -0
- package/models/operations/getalltools.js +4 -4
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- 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/listdatasetdatapoints.js +5 -5
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +4 -4
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +5 -5
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievetool.js +4 -4
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatedatapoint.js +5 -5
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatetool.js +4 -4
- package/package.json +7 -7
- package/sdk/deployments.d.ts +16 -0
- package/sdk/deployments.d.ts.map +1 -1
- package/sdk/deployments.js +20 -0
- package/sdk/deployments.js.map +1 -1
- package/sdk/skills.d.ts +1 -1
- package/sdk/skills.js +1 -1
- package/src/funcs/deploymentsInvoke.ts +170 -0
- package/src/funcs/deploymentsStream.ts +180 -0
- package/src/funcs/skillsUpdate.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/agentresponserequest.ts +17 -12
- package/src/models/components/agentthoughtstreamingevent.ts +55 -43
- package/src/models/components/index.ts +1 -0
- package/src/models/components/invokedeploymentrequest.ts +3444 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/components/searchknowledgerequest.ts +680 -469
- package/src/models/components/updatememorystorerequest.ts +11 -0
- package/src/models/components/updateskillrequest.ts +1 -1
- package/src/models/operations/createchatcompletion.ts +313 -248
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +5 -5
- package/src/models/operations/createprompt.ts +7 -6
- package/src/models/operations/createtool.ts +4 -4
- package/src/models/operations/deploymentgetconfig.ts +1631 -1141
- package/src/models/operations/deploymentinvoke.ts +732 -0
- package/src/models/operations/deployments.ts +46 -42
- package/src/models/operations/deploymentstream.ts +4102 -0
- package/src/models/operations/getalltools.ts +4 -4
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listdatasetdatapoints.ts +5 -5
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +4 -4
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +5 -5
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievetool.ts +4 -4
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +5 -5
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatetool.ts +4 -4
- package/src/sdk/deployments.ts +38 -0
- package/src/sdk/skills.ts +1 -1
- package/examples/deploymentsList.example.ts +0 -26
package/sdk/deployments.d.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
import { EventStream } from "../lib/event-streams.js";
|
|
1
2
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import * as components from "../models/components/index.js";
|
|
2
4
|
import * as operations from "../models/operations/index.js";
|
|
3
5
|
export declare class Deployments extends ClientSDK {
|
|
6
|
+
/**
|
|
7
|
+
* Invoke
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Invoke a deployment with a given payload
|
|
11
|
+
*/
|
|
12
|
+
invoke(request: components.InvokeDeploymentRequest, options?: RequestOptions): Promise<operations.DeploymentInvokeResponseBody | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Stream
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Stream deployment generation. Only supported for completions and chat completions.
|
|
18
|
+
*/
|
|
19
|
+
stream(request: operations.DeploymentStreamRequestBody, options?: RequestOptions): Promise<EventStream<operations.DeploymentStreamResponseBody>>;
|
|
4
20
|
/**
|
|
5
21
|
* List all deployments
|
|
6
22
|
*
|
package/sdk/deployments.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../src/sdk/deployments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../src/sdk/deployments.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,WAAY,SAAQ,SAAS;IACxC;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,uBAAuB,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,4BAA4B,GAAG,SAAS,CAAC;IAQ/D;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;IAQhE;;;;;OAKG;IACG,IAAI,CACR,OAAO,CAAC,EAAE,UAAU,CAAC,kBAAkB,GAAG,SAAS,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAQ9C;;;;;OAKG;IACG,SAAS,CACb,OAAO,EAAE,UAAU,CAAC,8BAA8B,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,+BAA+B,GAAG,SAAS,CAAC;CAOnE"}
|
package/sdk/deployments.js
CHANGED
|
@@ -5,10 +5,30 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Deployments = void 0;
|
|
7
7
|
const deploymentsGetConfig_js_1 = require("../funcs/deploymentsGetConfig.js");
|
|
8
|
+
const deploymentsInvoke_js_1 = require("../funcs/deploymentsInvoke.js");
|
|
8
9
|
const deploymentsList_js_1 = require("../funcs/deploymentsList.js");
|
|
10
|
+
const deploymentsStream_js_1 = require("../funcs/deploymentsStream.js");
|
|
9
11
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
10
12
|
const fp_js_1 = require("../types/fp.js");
|
|
11
13
|
class Deployments extends sdks_js_1.ClientSDK {
|
|
14
|
+
/**
|
|
15
|
+
* Invoke
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Invoke a deployment with a given payload
|
|
19
|
+
*/
|
|
20
|
+
async invoke(request, options) {
|
|
21
|
+
return (0, fp_js_1.unwrapAsync)((0, deploymentsInvoke_js_1.deploymentsInvoke)(this, request, options));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Stream
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Stream deployment generation. Only supported for completions and chat completions.
|
|
28
|
+
*/
|
|
29
|
+
async stream(request, options) {
|
|
30
|
+
return (0, fp_js_1.unwrapAsync)((0, deploymentsStream_js_1.deploymentsStream)(this, request, options));
|
|
31
|
+
}
|
|
12
32
|
/**
|
|
13
33
|
* List all deployments
|
|
14
34
|
*
|
package/sdk/deployments.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/sdk/deployments.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8EAAwE;AACxE,oEAA8D;AAC9D,4CAA2D;
|
|
1
|
+
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/sdk/deployments.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8EAAwE;AACxE,wEAAkE;AAClE,oEAA8D;AAC9D,wEAAkE;AAElE,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,WAAY,SAAQ,mBAAS;IACxC;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA2C,EAC3C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wCAAiB,EAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,OAAmD,EACnD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,oCAAe,EAChC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,OAAkD,EAClD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AApED,kCAoEC"}
|
package/sdk/skills.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare class Skills extends ClientSDK {
|
|
|
34
34
|
* Update a skill
|
|
35
35
|
*
|
|
36
36
|
* @remarks
|
|
37
|
-
* Updates mutable skill fields. Omitted
|
|
37
|
+
* Updates mutable skill fields. Omitted fields keep their current values. When `tags` is provided it replaces the existing tags; send an empty array to clear them.
|
|
38
38
|
*/
|
|
39
39
|
update(request: operations.SkillUpdateRequest, options?: RequestOptions): Promise<components.UpdateSkillResponse>;
|
|
40
40
|
}
|
package/sdk/skills.js
CHANGED
|
@@ -52,7 +52,7 @@ class Skills extends sdks_js_1.ClientSDK {
|
|
|
52
52
|
* Update a skill
|
|
53
53
|
*
|
|
54
54
|
* @remarks
|
|
55
|
-
* Updates mutable skill fields. Omitted
|
|
55
|
+
* Updates mutable skill fields. Omitted fields keep their current values. When `tags` is provided it replaces the existing tags; send an empty array to clear them.
|
|
56
56
|
*/
|
|
57
57
|
async update(request, options) {
|
|
58
58
|
return (0, fp_js_1.unwrapAsync)((0, skillsUpdate_js_1.skillsUpdate)(this, request, options));
|
|
@@ -0,0 +1,170 @@
|
|
|
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 { 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 * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Invoke
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Invoke a deployment with a given payload
|
|
34
|
+
*/
|
|
35
|
+
export function deploymentsInvoke(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: components.InvokeDeploymentRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.DeploymentInvokeResponseBody | undefined,
|
|
42
|
+
| OrqError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: OrqCore,
|
|
61
|
+
request: components.InvokeDeploymentRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
operations.DeploymentInvokeResponseBody | undefined,
|
|
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) => components.InvokeDeploymentRequest$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, { explode: true });
|
|
89
|
+
|
|
90
|
+
const path = pathToFunc("/v2/deployments/invoke")();
|
|
91
|
+
|
|
92
|
+
const headers = new Headers(compactMap({
|
|
93
|
+
"Content-Type": "application/json",
|
|
94
|
+
Accept: "application/json",
|
|
95
|
+
}));
|
|
96
|
+
|
|
97
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
98
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
99
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
100
|
+
|
|
101
|
+
const context = {
|
|
102
|
+
options: client._options,
|
|
103
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
104
|
+
operationID: "DeploymentInvoke",
|
|
105
|
+
oAuth2Scopes: null,
|
|
106
|
+
|
|
107
|
+
resolvedSecurity: requestSecurity,
|
|
108
|
+
|
|
109
|
+
securitySource: client._options.apiKey,
|
|
110
|
+
retryConfig: options?.retries
|
|
111
|
+
|| client._options.retryConfig
|
|
112
|
+
|| { strategy: "none" },
|
|
113
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const requestRes = client._createRequest(context, {
|
|
117
|
+
security: requestSecurity,
|
|
118
|
+
method: "POST",
|
|
119
|
+
baseURL: options?.serverURL,
|
|
120
|
+
path: path,
|
|
121
|
+
headers: headers,
|
|
122
|
+
body: body,
|
|
123
|
+
userAgent: client._options.userAgent,
|
|
124
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
125
|
+
}, options);
|
|
126
|
+
if (!requestRes.ok) {
|
|
127
|
+
return [requestRes, { status: "invalid" }];
|
|
128
|
+
}
|
|
129
|
+
const req = requestRes.value;
|
|
130
|
+
|
|
131
|
+
const doResult = await client._do(req, {
|
|
132
|
+
context,
|
|
133
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
134
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
135
|
+
retryConfig: context.retryConfig,
|
|
136
|
+
retryCodes: context.retryCodes,
|
|
137
|
+
});
|
|
138
|
+
if (!doResult.ok) {
|
|
139
|
+
return [doResult, { status: "request-error", request: req }];
|
|
140
|
+
}
|
|
141
|
+
const response = doResult.value;
|
|
142
|
+
|
|
143
|
+
const [result] = await M.match<
|
|
144
|
+
operations.DeploymentInvokeResponseBody | undefined,
|
|
145
|
+
| OrqError
|
|
146
|
+
| ResponseValidationError
|
|
147
|
+
| ConnectionError
|
|
148
|
+
| RequestAbortedError
|
|
149
|
+
| RequestTimeoutError
|
|
150
|
+
| InvalidRequestError
|
|
151
|
+
| UnexpectedClientError
|
|
152
|
+
| SDKValidationError
|
|
153
|
+
>(
|
|
154
|
+
M.json(
|
|
155
|
+
200,
|
|
156
|
+
operations.DeploymentInvokeResponseBody$inboundSchema.optional(),
|
|
157
|
+
),
|
|
158
|
+
M.nil(
|
|
159
|
+
204,
|
|
160
|
+
operations.DeploymentInvokeResponseBody$inboundSchema.optional(),
|
|
161
|
+
),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail("5XX"),
|
|
164
|
+
)(response, req);
|
|
165
|
+
if (!result.ok) {
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
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 { encodeJSON } from "../lib/encodings.js";
|
|
8
|
+
import { EventStream } from "../lib/event-streams.js";
|
|
9
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
10
|
+
import * as M from "../lib/matchers.js";
|
|
11
|
+
import { compactMap } from "../lib/primitives.js";
|
|
12
|
+
import { safeParse } from "../lib/schemas.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
15
|
+
import { pathToFunc } from "../lib/url.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Stream
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Stream deployment generation. Only supported for completions and chat completions.
|
|
35
|
+
*/
|
|
36
|
+
export function deploymentsStream(
|
|
37
|
+
client: OrqCore,
|
|
38
|
+
request: operations.DeploymentStreamRequestBody,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
EventStream<operations.DeploymentStreamResponseBody>,
|
|
43
|
+
| OrqError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: OrqCore,
|
|
62
|
+
request: operations.DeploymentStreamRequestBody,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
EventStream<operations.DeploymentStreamResponseBody>,
|
|
68
|
+
| OrqError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) =>
|
|
83
|
+
operations.DeploymentStreamRequestBody$outboundSchema.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 = encodeJSON("body", payload, { explode: true });
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/v2/deployments/stream")();
|
|
93
|
+
|
|
94
|
+
const headers = new Headers(compactMap({
|
|
95
|
+
"Content-Type": "application/json",
|
|
96
|
+
Accept: "text/event-stream",
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
100
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
options: client._options,
|
|
105
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
106
|
+
operationID: "DeploymentStream",
|
|
107
|
+
oAuth2Scopes: null,
|
|
108
|
+
|
|
109
|
+
resolvedSecurity: requestSecurity,
|
|
110
|
+
|
|
111
|
+
securitySource: client._options.apiKey,
|
|
112
|
+
retryConfig: options?.retries
|
|
113
|
+
|| client._options.retryConfig
|
|
114
|
+
|| { strategy: "none" },
|
|
115
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const requestRes = client._createRequest(context, {
|
|
119
|
+
security: requestSecurity,
|
|
120
|
+
method: "POST",
|
|
121
|
+
baseURL: options?.serverURL,
|
|
122
|
+
path: path,
|
|
123
|
+
headers: headers,
|
|
124
|
+
body: body,
|
|
125
|
+
userAgent: client._options.userAgent,
|
|
126
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
127
|
+
}, options);
|
|
128
|
+
if (!requestRes.ok) {
|
|
129
|
+
return [requestRes, { status: "invalid" }];
|
|
130
|
+
}
|
|
131
|
+
const req = requestRes.value;
|
|
132
|
+
|
|
133
|
+
const doResult = await client._do(req, {
|
|
134
|
+
context,
|
|
135
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
136
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
137
|
+
retryConfig: context.retryConfig,
|
|
138
|
+
retryCodes: context.retryCodes,
|
|
139
|
+
});
|
|
140
|
+
if (!doResult.ok) {
|
|
141
|
+
return [doResult, { status: "request-error", request: req }];
|
|
142
|
+
}
|
|
143
|
+
const response = doResult.value;
|
|
144
|
+
|
|
145
|
+
const [result] = await M.match<
|
|
146
|
+
EventStream<operations.DeploymentStreamResponseBody>,
|
|
147
|
+
| OrqError
|
|
148
|
+
| ResponseValidationError
|
|
149
|
+
| ConnectionError
|
|
150
|
+
| RequestAbortedError
|
|
151
|
+
| RequestTimeoutError
|
|
152
|
+
| InvalidRequestError
|
|
153
|
+
| UnexpectedClientError
|
|
154
|
+
| SDKValidationError
|
|
155
|
+
>(
|
|
156
|
+
M.sse(
|
|
157
|
+
200,
|
|
158
|
+
z.instanceof(ReadableStream<Uint8Array>)
|
|
159
|
+
.transform(stream => {
|
|
160
|
+
return new EventStream(stream, rawEvent => {
|
|
161
|
+
if (rawEvent.data === "[DONE]") {
|
|
162
|
+
return { done: true, value: undefined };
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
done: false,
|
|
166
|
+
value: operations.DeploymentStreamResponseBody$inboundSchema
|
|
167
|
+
.parse(rawEvent),
|
|
168
|
+
};
|
|
169
|
+
}, { dataRequired: false });
|
|
170
|
+
}),
|
|
171
|
+
),
|
|
172
|
+
M.fail("4XX"),
|
|
173
|
+
M.fail("5XX"),
|
|
174
|
+
)(response, req);
|
|
175
|
+
if (!result.ok) {
|
|
176
|
+
return [result, { status: "complete", request: req, response }];
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Update a skill
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Updates mutable skill fields. Omitted
|
|
33
|
+
* Updates mutable skill fields. Omitted fields keep their current values. When `tags` is provided it replaces the existing tags; send an empty array to clear them.
|
|
34
34
|
*/
|
|
35
35
|
export function skillsUpdate(
|
|
36
36
|
client: OrqCore,
|
package/src/lib/config.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "2.0",
|
|
61
|
-
sdkVersion: "4.15.0-rc.
|
|
61
|
+
sdkVersion: "4.15.0-rc.54",
|
|
62
62
|
genVersion: "2.937.18",
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 4.15.0-rc.
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 4.15.0-rc.54 2.937.18 2.0 @orq-ai/node",
|
|
64
64
|
} as const;
|
|
@@ -29,29 +29,29 @@ import {
|
|
|
29
29
|
/**
|
|
30
30
|
* Message containing tool execution results
|
|
31
31
|
*/
|
|
32
|
-
export const
|
|
32
|
+
export const RoleToolMessage = {
|
|
33
33
|
Tool: "tool",
|
|
34
34
|
} as const;
|
|
35
35
|
/**
|
|
36
36
|
* Message containing tool execution results
|
|
37
37
|
*/
|
|
38
|
-
export type
|
|
38
|
+
export type RoleToolMessage = ClosedEnum<typeof RoleToolMessage>;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Message from the end user
|
|
42
42
|
*/
|
|
43
|
-
export const
|
|
43
|
+
export const RoleUserMessage = {
|
|
44
44
|
User: "user",
|
|
45
45
|
} as const;
|
|
46
46
|
/**
|
|
47
47
|
* Message from the end user
|
|
48
48
|
*/
|
|
49
|
-
export type
|
|
49
|
+
export type RoleUserMessage = ClosedEnum<typeof RoleUserMessage>;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Message role (user or tool for continuing executions)
|
|
53
53
|
*/
|
|
54
|
-
export type AgentResponseRequestRole =
|
|
54
|
+
export type AgentResponseRequestRole = RoleUserMessage | RoleToolMessage;
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Message part that can be provided by users. Use "text" for regular messages, "file" for attachments, or "tool_result" when responding to tool call requests.
|
|
@@ -73,7 +73,7 @@ export type A2AMessage = {
|
|
|
73
73
|
/**
|
|
74
74
|
* Message role (user or tool for continuing executions)
|
|
75
75
|
*/
|
|
76
|
-
role:
|
|
76
|
+
role: RoleUserMessage | RoleToolMessage;
|
|
77
77
|
/**
|
|
78
78
|
* A2A message parts (text, file, or tool_result only). Note: Tool role messages must only contain tool_result parts.
|
|
79
79
|
*/
|
|
@@ -260,12 +260,14 @@ export type AgentResponseRequest = {
|
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
/** @internal */
|
|
263
|
-
export const
|
|
264
|
-
|
|
263
|
+
export const RoleToolMessage$outboundSchema: z.ZodNativeEnum<
|
|
264
|
+
typeof RoleToolMessage
|
|
265
|
+
> = z.nativeEnum(RoleToolMessage);
|
|
265
266
|
|
|
266
267
|
/** @internal */
|
|
267
|
-
export const
|
|
268
|
-
|
|
268
|
+
export const RoleUserMessage$outboundSchema: z.ZodNativeEnum<
|
|
269
|
+
typeof RoleUserMessage
|
|
270
|
+
> = z.nativeEnum(RoleUserMessage);
|
|
269
271
|
|
|
270
272
|
/** @internal */
|
|
271
273
|
export type AgentResponseRequestRole$Outbound = string | string;
|
|
@@ -275,7 +277,7 @@ export const AgentResponseRequestRole$outboundSchema: z.ZodType<
|
|
|
275
277
|
AgentResponseRequestRole$Outbound,
|
|
276
278
|
z.ZodTypeDef,
|
|
277
279
|
AgentResponseRequestRole
|
|
278
|
-
> = z.union([
|
|
280
|
+
> = z.union([RoleUserMessage$outboundSchema, RoleToolMessage$outboundSchema]);
|
|
279
281
|
|
|
280
282
|
export function agentResponseRequestRoleToJSON(
|
|
281
283
|
agentResponseRequestRole: AgentResponseRequestRole,
|
|
@@ -331,7 +333,10 @@ export const A2AMessage$outboundSchema: z.ZodType<
|
|
|
331
333
|
A2AMessage
|
|
332
334
|
> = z.object({
|
|
333
335
|
messageId: z.string().optional(),
|
|
334
|
-
role: z.union([
|
|
336
|
+
role: z.union([
|
|
337
|
+
RoleUserMessage$outboundSchema,
|
|
338
|
+
RoleToolMessage$outboundSchema,
|
|
339
|
+
]),
|
|
335
340
|
parts: z.array(
|
|
336
341
|
z.union([
|
|
337
342
|
TextPart$outboundSchema,
|