@meetkai/mka1 0.54.73 → 0.54.75
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 +304 -310
- package/bin/mcp-server.js +3035 -3431
- package/bin/mcp-server.js.map +15 -23
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -5
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/models/components/declaration.d.ts +3 -12
- package/dist/commonjs/models/components/declaration.d.ts.map +1 -1
- package/dist/commonjs/models/components/declaration.js.map +1 -1
- package/dist/commonjs/models/components/generation.d.ts +3 -4
- package/dist/commonjs/models/components/generation.d.ts.map +1 -1
- package/dist/commonjs/models/components/generation.js.map +1 -1
- package/dist/commonjs/models/components/generationcreated.d.ts +3 -4
- package/dist/commonjs/models/components/generationcreated.d.ts.map +1 -1
- package/dist/commonjs/models/components/generationcreated.js.map +1 -1
- package/dist/commonjs/models/components/generatordetail.d.ts +3 -4
- package/dist/commonjs/models/components/generatordetail.d.ts.map +1 -1
- package/dist/commonjs/models/components/generatordetail.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +0 -2
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +0 -2
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/limits.d.ts +10 -6
- package/dist/commonjs/models/components/limits.d.ts.map +1 -1
- package/dist/commonjs/models/components/limits.js +2 -2
- package/dist/commonjs/models/components/limits.js.map +1 -1
- package/dist/commonjs/models/components/limitsrequest.d.ts +5 -0
- package/dist/commonjs/models/components/limitsrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/limitsrequest.js.map +1 -1
- package/dist/commonjs/models/components/quoteresponse.d.ts +3 -4
- package/dist/commonjs/models/components/quoteresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/quoteresponse.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +0 -2
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +0 -2
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/index.d.ts +0 -2
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +0 -2
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/agents.d.ts +0 -8
- package/dist/commonjs/sdk/agents.d.ts.map +1 -1
- package/dist/commonjs/sdk/agents.js +0 -14
- package/dist/commonjs/sdk/agents.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +1 -5
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/models/components/declaration.d.ts +3 -12
- package/dist/esm/models/components/declaration.d.ts.map +1 -1
- package/dist/esm/models/components/declaration.js.map +1 -1
- package/dist/esm/models/components/generation.d.ts +3 -4
- package/dist/esm/models/components/generation.d.ts.map +1 -1
- package/dist/esm/models/components/generation.js.map +1 -1
- package/dist/esm/models/components/generationcreated.d.ts +3 -4
- package/dist/esm/models/components/generationcreated.d.ts.map +1 -1
- package/dist/esm/models/components/generationcreated.js.map +1 -1
- package/dist/esm/models/components/generatordetail.d.ts +3 -4
- package/dist/esm/models/components/generatordetail.d.ts.map +1 -1
- package/dist/esm/models/components/generatordetail.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +0 -2
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +0 -2
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/limits.d.ts +10 -6
- package/dist/esm/models/components/limits.d.ts.map +1 -1
- package/dist/esm/models/components/limits.js +2 -2
- package/dist/esm/models/components/limits.js.map +1 -1
- package/dist/esm/models/components/limitsrequest.d.ts +5 -0
- package/dist/esm/models/components/limitsrequest.d.ts.map +1 -1
- package/dist/esm/models/components/limitsrequest.js.map +1 -1
- package/dist/esm/models/components/quoteresponse.d.ts +3 -4
- package/dist/esm/models/components/quoteresponse.d.ts.map +1 -1
- package/dist/esm/models/components/quoteresponse.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +0 -2
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +0 -2
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/index.d.ts +0 -2
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +0 -2
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/agents.d.ts +0 -8
- package/dist/esm/sdk/agents.d.ts.map +1 -1
- package/dist/esm/sdk/agents.js +0 -14
- package/dist/esm/sdk/agents.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -5
- package/src/models/components/declaration.ts +3 -12
- package/src/models/components/generation.ts +3 -4
- package/src/models/components/generationcreated.ts +3 -4
- package/src/models/components/generatordetail.ts +3 -4
- package/src/models/components/index.ts +0 -2
- package/src/models/components/limits.ts +12 -8
- package/src/models/components/limitsrequest.ts +5 -0
- package/src/models/components/quoteresponse.ts +3 -4
- package/src/models/operations/index.ts +0 -2
- package/src/react-query/index.ts +0 -2
- package/src/sdk/agents.ts +0 -30
- package/dist/commonjs/funcs/agentsCreateAgent.d.ts +0 -18
- package/dist/commonjs/funcs/agentsCreateAgent.d.ts.map +0 -1
- package/dist/commonjs/funcs/agentsCreateAgent.js +0 -132
- package/dist/commonjs/funcs/agentsCreateAgent.js.map +0 -1
- package/dist/commonjs/funcs/agentsUpdateAgent.d.ts +0 -18
- package/dist/commonjs/funcs/agentsUpdateAgent.d.ts.map +0 -1
- package/dist/commonjs/funcs/agentsUpdateAgent.js +0 -138
- package/dist/commonjs/funcs/agentsUpdateAgent.js.map +0 -1
- package/dist/commonjs/mcp-server/tools/agentsCreateAgent.d.ts +0 -8
- package/dist/commonjs/mcp-server/tools/agentsCreateAgent.d.ts.map +0 -1
- package/dist/commonjs/mcp-server/tools/agentsCreateAgent.js +0 -62
- package/dist/commonjs/mcp-server/tools/agentsCreateAgent.js.map +0 -1
- package/dist/commonjs/mcp-server/tools/agentsUpdateAgent.d.ts +0 -8
- package/dist/commonjs/mcp-server/tools/agentsUpdateAgent.d.ts.map +0 -1
- package/dist/commonjs/mcp-server/tools/agentsUpdateAgent.js +0 -62
- package/dist/commonjs/mcp-server/tools/agentsUpdateAgent.js.map +0 -1
- package/dist/commonjs/models/components/createagentrequest.d.ts +0 -47
- package/dist/commonjs/models/components/createagentrequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/createagentrequest.js +0 -94
- package/dist/commonjs/models/components/createagentrequest.js.map +0 -1
- package/dist/commonjs/models/components/updateagentrequest.d.ts +0 -47
- package/dist/commonjs/models/components/updateagentrequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/updateagentrequest.js +0 -94
- package/dist/commonjs/models/components/updateagentrequest.js.map +0 -1
- package/dist/commonjs/models/operations/createagent.d.ts +0 -23
- package/dist/commonjs/models/operations/createagent.d.ts.map +0 -1
- package/dist/commonjs/models/operations/createagent.js +0 -72
- package/dist/commonjs/models/operations/createagent.js.map +0 -1
- package/dist/commonjs/models/operations/updateagent.d.ts +0 -25
- package/dist/commonjs/models/operations/updateagent.d.ts.map +0 -1
- package/dist/commonjs/models/operations/updateagent.js +0 -76
- package/dist/commonjs/models/operations/updateagent.js.map +0 -1
- package/dist/commonjs/react-query/agentsCreateAgent.d.ts +0 -27
- package/dist/commonjs/react-query/agentsCreateAgent.d.ts.map +0 -1
- package/dist/commonjs/react-query/agentsCreateAgent.js +0 -44
- package/dist/commonjs/react-query/agentsCreateAgent.js.map +0 -1
- package/dist/commonjs/react-query/agentsUpdateAgent.d.ts +0 -27
- package/dist/commonjs/react-query/agentsUpdateAgent.d.ts.map +0 -1
- package/dist/commonjs/react-query/agentsUpdateAgent.js +0 -44
- package/dist/commonjs/react-query/agentsUpdateAgent.js.map +0 -1
- package/dist/esm/funcs/agentsCreateAgent.d.ts +0 -18
- package/dist/esm/funcs/agentsCreateAgent.d.ts.map +0 -1
- package/dist/esm/funcs/agentsCreateAgent.js +0 -96
- package/dist/esm/funcs/agentsCreateAgent.js.map +0 -1
- package/dist/esm/funcs/agentsUpdateAgent.d.ts +0 -18
- package/dist/esm/funcs/agentsUpdateAgent.d.ts.map +0 -1
- package/dist/esm/funcs/agentsUpdateAgent.js +0 -102
- package/dist/esm/funcs/agentsUpdateAgent.js.map +0 -1
- package/dist/esm/mcp-server/tools/agentsCreateAgent.d.ts +0 -8
- package/dist/esm/mcp-server/tools/agentsCreateAgent.d.ts.map +0 -1
- package/dist/esm/mcp-server/tools/agentsCreateAgent.js +0 -26
- package/dist/esm/mcp-server/tools/agentsCreateAgent.js.map +0 -1
- package/dist/esm/mcp-server/tools/agentsUpdateAgent.d.ts +0 -8
- package/dist/esm/mcp-server/tools/agentsUpdateAgent.d.ts.map +0 -1
- package/dist/esm/mcp-server/tools/agentsUpdateAgent.js +0 -26
- package/dist/esm/mcp-server/tools/agentsUpdateAgent.js.map +0 -1
- package/dist/esm/models/components/createagentrequest.d.ts +0 -47
- package/dist/esm/models/components/createagentrequest.d.ts.map +0 -1
- package/dist/esm/models/components/createagentrequest.js +0 -56
- package/dist/esm/models/components/createagentrequest.js.map +0 -1
- package/dist/esm/models/components/updateagentrequest.d.ts +0 -47
- package/dist/esm/models/components/updateagentrequest.d.ts.map +0 -1
- package/dist/esm/models/components/updateagentrequest.js +0 -56
- package/dist/esm/models/components/updateagentrequest.js.map +0 -1
- package/dist/esm/models/operations/createagent.d.ts +0 -23
- package/dist/esm/models/operations/createagent.d.ts.map +0 -1
- package/dist/esm/models/operations/createagent.js +0 -34
- package/dist/esm/models/operations/createagent.js.map +0 -1
- package/dist/esm/models/operations/updateagent.d.ts +0 -25
- package/dist/esm/models/operations/updateagent.d.ts.map +0 -1
- package/dist/esm/models/operations/updateagent.js +0 -38
- package/dist/esm/models/operations/updateagent.js.map +0 -1
- package/dist/esm/react-query/agentsCreateAgent.d.ts +0 -27
- package/dist/esm/react-query/agentsCreateAgent.d.ts.map +0 -1
- package/dist/esm/react-query/agentsCreateAgent.js +0 -39
- package/dist/esm/react-query/agentsCreateAgent.js.map +0 -1
- package/dist/esm/react-query/agentsUpdateAgent.d.ts +0 -27
- package/dist/esm/react-query/agentsUpdateAgent.d.ts.map +0 -1
- package/dist/esm/react-query/agentsUpdateAgent.js +0 -39
- package/dist/esm/react-query/agentsUpdateAgent.js.map +0 -1
- package/src/funcs/agentsCreateAgent.ts +0 -188
- package/src/funcs/agentsUpdateAgent.ts +0 -194
- package/src/mcp-server/tools/agentsCreateAgent.ts +0 -35
- package/src/mcp-server/tools/agentsUpdateAgent.ts +0 -35
- package/src/models/components/createagentrequest.ts +0 -125
- package/src/models/components/updateagentrequest.ts +0 -125
- package/src/models/operations/createagent.ts +0 -70
- package/src/models/operations/updateagent.ts +0 -76
- package/src/react-query/agentsCreateAgent.ts +0 -108
- package/src/react-query/agentsUpdateAgent.ts +0 -108
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { SDKCore } 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 * 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 * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKError } from "../models/errors/sdkerror.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
|
-
* Create an agent
|
|
32
|
-
*
|
|
33
|
-
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
34
|
-
*/
|
|
35
|
-
export function agentsCreateAgent(
|
|
36
|
-
client: SDKCore,
|
|
37
|
-
request: operations.CreateAgentRequest,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
Result<
|
|
41
|
-
components.Agent,
|
|
42
|
-
| errors.ErrorEnvelope
|
|
43
|
-
| SDKError
|
|
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: SDKCore,
|
|
62
|
-
request: operations.CreateAgentRequest,
|
|
63
|
-
options?: RequestOptions,
|
|
64
|
-
): Promise<
|
|
65
|
-
[
|
|
66
|
-
Result<
|
|
67
|
-
components.Agent,
|
|
68
|
-
| errors.ErrorEnvelope
|
|
69
|
-
| SDKError
|
|
70
|
-
| ResponseValidationError
|
|
71
|
-
| ConnectionError
|
|
72
|
-
| RequestAbortedError
|
|
73
|
-
| RequestTimeoutError
|
|
74
|
-
| InvalidRequestError
|
|
75
|
-
| UnexpectedClientError
|
|
76
|
-
| SDKValidationError
|
|
77
|
-
>,
|
|
78
|
-
APICall,
|
|
79
|
-
]
|
|
80
|
-
> {
|
|
81
|
-
const parsed = safeParse(
|
|
82
|
-
request,
|
|
83
|
-
(value) => operations.CreateAgentRequest$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.CreateAgentRequest, {
|
|
91
|
-
explode: true,
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const path = pathToFunc("/api/v1/agents")();
|
|
95
|
-
|
|
96
|
-
const headers = new Headers(compactMap({
|
|
97
|
-
"Content-Type": "application/json",
|
|
98
|
-
Accept: "application/json",
|
|
99
|
-
"X-On-Behalf-Of": encodeSimple(
|
|
100
|
-
"X-On-Behalf-Of",
|
|
101
|
-
payload["X-On-Behalf-Of"],
|
|
102
|
-
{ explode: false, charEncoding: "none" },
|
|
103
|
-
),
|
|
104
|
-
}));
|
|
105
|
-
|
|
106
|
-
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
107
|
-
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
108
|
-
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
109
|
-
|
|
110
|
-
const context = {
|
|
111
|
-
options: client._options,
|
|
112
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
113
|
-
operationID: "createAgent",
|
|
114
|
-
oAuth2Scopes: null,
|
|
115
|
-
|
|
116
|
-
resolvedSecurity: requestSecurity,
|
|
117
|
-
|
|
118
|
-
securitySource: client._options.bearerAuth,
|
|
119
|
-
retryConfig: options?.retries
|
|
120
|
-
|| client._options.retryConfig
|
|
121
|
-
|| {
|
|
122
|
-
strategy: "backoff",
|
|
123
|
-
backoff: {
|
|
124
|
-
initialInterval: 500,
|
|
125
|
-
maxInterval: 5000,
|
|
126
|
-
exponent: 1.5,
|
|
127
|
-
maxElapsedTime: 15000,
|
|
128
|
-
},
|
|
129
|
-
retryConnectionErrors: true,
|
|
130
|
-
}
|
|
131
|
-
|| { strategy: "none" },
|
|
132
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const requestRes = client._createRequest(context, {
|
|
136
|
-
security: requestSecurity,
|
|
137
|
-
method: "POST",
|
|
138
|
-
baseURL: options?.serverURL,
|
|
139
|
-
path: path,
|
|
140
|
-
headers: headers,
|
|
141
|
-
body: body,
|
|
142
|
-
userAgent: client._options.userAgent,
|
|
143
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
144
|
-
}, options);
|
|
145
|
-
if (!requestRes.ok) {
|
|
146
|
-
return [requestRes, { status: "invalid" }];
|
|
147
|
-
}
|
|
148
|
-
const req = requestRes.value;
|
|
149
|
-
|
|
150
|
-
const doResult = await client._do(req, {
|
|
151
|
-
context,
|
|
152
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
153
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
154
|
-
retryConfig: context.retryConfig,
|
|
155
|
-
retryCodes: context.retryCodes,
|
|
156
|
-
});
|
|
157
|
-
if (!doResult.ok) {
|
|
158
|
-
return [doResult, { status: "request-error", request: req }];
|
|
159
|
-
}
|
|
160
|
-
const response = doResult.value;
|
|
161
|
-
|
|
162
|
-
const responseFields = {
|
|
163
|
-
HttpMeta: { Response: response, Request: req },
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const [result] = await M.match<
|
|
167
|
-
components.Agent,
|
|
168
|
-
| errors.ErrorEnvelope
|
|
169
|
-
| SDKError
|
|
170
|
-
| ResponseValidationError
|
|
171
|
-
| ConnectionError
|
|
172
|
-
| RequestAbortedError
|
|
173
|
-
| RequestTimeoutError
|
|
174
|
-
| InvalidRequestError
|
|
175
|
-
| UnexpectedClientError
|
|
176
|
-
| SDKValidationError
|
|
177
|
-
>(
|
|
178
|
-
M.json(201, components.Agent$inboundSchema),
|
|
179
|
-
M.jsonErr([400, 401], errors.ErrorEnvelope$inboundSchema),
|
|
180
|
-
M.fail("4XX"),
|
|
181
|
-
M.fail("5XX"),
|
|
182
|
-
)(response, req, { extraFields: responseFields });
|
|
183
|
-
if (!result.ok) {
|
|
184
|
-
return [result, { status: "complete", request: req, response }];
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return [result, { status: "complete", request: req, response }];
|
|
188
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { SDKCore } 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 * 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 * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKError } from "../models/errors/sdkerror.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
|
-
* Update an agent
|
|
32
|
-
*
|
|
33
|
-
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
34
|
-
*/
|
|
35
|
-
export function agentsUpdateAgent(
|
|
36
|
-
client: SDKCore,
|
|
37
|
-
request: operations.UpdateAgentRequest,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
Result<
|
|
41
|
-
components.Agent,
|
|
42
|
-
| errors.ErrorEnvelope
|
|
43
|
-
| SDKError
|
|
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: SDKCore,
|
|
62
|
-
request: operations.UpdateAgentRequest,
|
|
63
|
-
options?: RequestOptions,
|
|
64
|
-
): Promise<
|
|
65
|
-
[
|
|
66
|
-
Result<
|
|
67
|
-
components.Agent,
|
|
68
|
-
| errors.ErrorEnvelope
|
|
69
|
-
| SDKError
|
|
70
|
-
| ResponseValidationError
|
|
71
|
-
| ConnectionError
|
|
72
|
-
| RequestAbortedError
|
|
73
|
-
| RequestTimeoutError
|
|
74
|
-
| InvalidRequestError
|
|
75
|
-
| UnexpectedClientError
|
|
76
|
-
| SDKValidationError
|
|
77
|
-
>,
|
|
78
|
-
APICall,
|
|
79
|
-
]
|
|
80
|
-
> {
|
|
81
|
-
const parsed = safeParse(
|
|
82
|
-
request,
|
|
83
|
-
(value) => operations.UpdateAgentRequest$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.UpdateAgentRequest, {
|
|
91
|
-
explode: true,
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const pathParams = {
|
|
95
|
-
agent_id: encodeSimple("agent_id", payload.agent_id, {
|
|
96
|
-
explode: false,
|
|
97
|
-
charEncoding: "percent",
|
|
98
|
-
}),
|
|
99
|
-
};
|
|
100
|
-
const path = pathToFunc("/api/v1/agents/{agent_id}")(pathParams);
|
|
101
|
-
|
|
102
|
-
const headers = new Headers(compactMap({
|
|
103
|
-
"Content-Type": "application/json",
|
|
104
|
-
Accept: "application/json",
|
|
105
|
-
"X-On-Behalf-Of": encodeSimple(
|
|
106
|
-
"X-On-Behalf-Of",
|
|
107
|
-
payload["X-On-Behalf-Of"],
|
|
108
|
-
{ explode: false, charEncoding: "none" },
|
|
109
|
-
),
|
|
110
|
-
}));
|
|
111
|
-
|
|
112
|
-
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
113
|
-
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
114
|
-
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
115
|
-
|
|
116
|
-
const context = {
|
|
117
|
-
options: client._options,
|
|
118
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
119
|
-
operationID: "updateAgent",
|
|
120
|
-
oAuth2Scopes: null,
|
|
121
|
-
|
|
122
|
-
resolvedSecurity: requestSecurity,
|
|
123
|
-
|
|
124
|
-
securitySource: client._options.bearerAuth,
|
|
125
|
-
retryConfig: options?.retries
|
|
126
|
-
|| client._options.retryConfig
|
|
127
|
-
|| {
|
|
128
|
-
strategy: "backoff",
|
|
129
|
-
backoff: {
|
|
130
|
-
initialInterval: 500,
|
|
131
|
-
maxInterval: 5000,
|
|
132
|
-
exponent: 1.5,
|
|
133
|
-
maxElapsedTime: 15000,
|
|
134
|
-
},
|
|
135
|
-
retryConnectionErrors: true,
|
|
136
|
-
}
|
|
137
|
-
|| { strategy: "none" },
|
|
138
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
const requestRes = client._createRequest(context, {
|
|
142
|
-
security: requestSecurity,
|
|
143
|
-
method: "POST",
|
|
144
|
-
baseURL: options?.serverURL,
|
|
145
|
-
path: path,
|
|
146
|
-
headers: headers,
|
|
147
|
-
body: body,
|
|
148
|
-
userAgent: client._options.userAgent,
|
|
149
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
150
|
-
}, options);
|
|
151
|
-
if (!requestRes.ok) {
|
|
152
|
-
return [requestRes, { status: "invalid" }];
|
|
153
|
-
}
|
|
154
|
-
const req = requestRes.value;
|
|
155
|
-
|
|
156
|
-
const doResult = await client._do(req, {
|
|
157
|
-
context,
|
|
158
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
159
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
160
|
-
retryConfig: context.retryConfig,
|
|
161
|
-
retryCodes: context.retryCodes,
|
|
162
|
-
});
|
|
163
|
-
if (!doResult.ok) {
|
|
164
|
-
return [doResult, { status: "request-error", request: req }];
|
|
165
|
-
}
|
|
166
|
-
const response = doResult.value;
|
|
167
|
-
|
|
168
|
-
const responseFields = {
|
|
169
|
-
HttpMeta: { Response: response, Request: req },
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const [result] = await M.match<
|
|
173
|
-
components.Agent,
|
|
174
|
-
| errors.ErrorEnvelope
|
|
175
|
-
| SDKError
|
|
176
|
-
| ResponseValidationError
|
|
177
|
-
| ConnectionError
|
|
178
|
-
| RequestAbortedError
|
|
179
|
-
| RequestTimeoutError
|
|
180
|
-
| InvalidRequestError
|
|
181
|
-
| UnexpectedClientError
|
|
182
|
-
| SDKValidationError
|
|
183
|
-
>(
|
|
184
|
-
M.json(200, components.Agent$inboundSchema),
|
|
185
|
-
M.jsonErr([400, 401, 404], errors.ErrorEnvelope$inboundSchema),
|
|
186
|
-
M.fail("4XX"),
|
|
187
|
-
M.fail("5XX"),
|
|
188
|
-
)(response, req, { extraFields: responseFields });
|
|
189
|
-
if (!result.ok) {
|
|
190
|
-
return [result, { status: "complete", request: req, response }];
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return [result, { status: "complete", request: req, response }];
|
|
194
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { agentsCreateAgent } from "../../funcs/agentsCreateAgent.js";
|
|
6
|
-
import * as operations from "../../models/operations/index.js";
|
|
7
|
-
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
-
|
|
9
|
-
const args = {
|
|
10
|
-
request: operations.CreateAgentRequest$inboundSchema,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const tool$agentsCreateAgent: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "agents-create-agent",
|
|
15
|
-
description: `Create an agent`,
|
|
16
|
-
args,
|
|
17
|
-
tool: async (client, args, ctx) => {
|
|
18
|
-
const [result, apiCall] = await agentsCreateAgent(
|
|
19
|
-
client,
|
|
20
|
-
args.request,
|
|
21
|
-
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
-
).$inspect();
|
|
23
|
-
|
|
24
|
-
if (!result.ok) {
|
|
25
|
-
return {
|
|
26
|
-
content: [{ type: "text", text: result.error.message }],
|
|
27
|
-
isError: true,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const value = result.value;
|
|
32
|
-
|
|
33
|
-
return formatResult(value, apiCall);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { agentsUpdateAgent } from "../../funcs/agentsUpdateAgent.js";
|
|
6
|
-
import * as operations from "../../models/operations/index.js";
|
|
7
|
-
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
-
|
|
9
|
-
const args = {
|
|
10
|
-
request: operations.UpdateAgentRequest$inboundSchema,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const tool$agentsUpdateAgent: ToolDefinition<typeof args> = {
|
|
14
|
-
name: "agents-update-agent",
|
|
15
|
-
description: `Update an agent`,
|
|
16
|
-
args,
|
|
17
|
-
tool: async (client, args, ctx) => {
|
|
18
|
-
const [result, apiCall] = await agentsUpdateAgent(
|
|
19
|
-
client,
|
|
20
|
-
args.request,
|
|
21
|
-
{ fetchOptions: { signal: ctx.signal } },
|
|
22
|
-
).$inspect();
|
|
23
|
-
|
|
24
|
-
if (!result.ok) {
|
|
25
|
-
return {
|
|
26
|
-
content: [{ type: "text", text: result.error.message }],
|
|
27
|
-
isError: true,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const value = result.value;
|
|
32
|
-
|
|
33
|
-
return formatResult(value, apiCall);
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
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
|
-
import {
|
|
11
|
-
AgentReasoningConfiguration,
|
|
12
|
-
AgentReasoningConfiguration$inboundSchema,
|
|
13
|
-
AgentReasoningConfiguration$Outbound,
|
|
14
|
-
AgentReasoningConfiguration$outboundSchema,
|
|
15
|
-
} from "./agentreasoningconfiguration.js";
|
|
16
|
-
import {
|
|
17
|
-
AgentTextConfiguration,
|
|
18
|
-
AgentTextConfiguration$inboundSchema,
|
|
19
|
-
AgentTextConfiguration$Outbound,
|
|
20
|
-
AgentTextConfiguration$outboundSchema,
|
|
21
|
-
} from "./agenttextconfiguration.js";
|
|
22
|
-
import {
|
|
23
|
-
ToolDefinition,
|
|
24
|
-
ToolDefinition$inboundSchema,
|
|
25
|
-
ToolDefinition$Outbound,
|
|
26
|
-
ToolDefinition$outboundSchema,
|
|
27
|
-
} from "./tooldefinition.js";
|
|
28
|
-
|
|
29
|
-
export type CreateAgentRequest = {
|
|
30
|
-
name: string;
|
|
31
|
-
description?: string | null | undefined;
|
|
32
|
-
model: string;
|
|
33
|
-
instructions?: string | null | undefined;
|
|
34
|
-
tools?: Array<ToolDefinition> | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Arbitrary JSON value.
|
|
37
|
-
*/
|
|
38
|
-
toolChoice?: any | undefined;
|
|
39
|
-
parallelToolCalls?: boolean | undefined;
|
|
40
|
-
maxToolCalls?: number | null | undefined;
|
|
41
|
-
text?: AgentTextConfiguration | null | undefined;
|
|
42
|
-
reasoning?: AgentReasoningConfiguration | null | undefined;
|
|
43
|
-
metadata?: { [k: string]: string } | undefined;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/** @internal */
|
|
47
|
-
export const CreateAgentRequest$inboundSchema: z.ZodType<
|
|
48
|
-
CreateAgentRequest,
|
|
49
|
-
z.ZodTypeDef,
|
|
50
|
-
unknown
|
|
51
|
-
> = z.object({
|
|
52
|
-
name: z.string(),
|
|
53
|
-
description: z.nullable(z.string()).optional(),
|
|
54
|
-
model: z.string(),
|
|
55
|
-
instructions: z.nullable(z.string()).optional(),
|
|
56
|
-
tools: z.array(ToolDefinition$inboundSchema).optional(),
|
|
57
|
-
tool_choice: z.any().optional(),
|
|
58
|
-
parallel_tool_calls: z.boolean().default(true),
|
|
59
|
-
max_tool_calls: z.nullable(z.number().int()).optional(),
|
|
60
|
-
text: z.nullable(AgentTextConfiguration$inboundSchema).optional(),
|
|
61
|
-
reasoning: z.nullable(AgentReasoningConfiguration$inboundSchema).optional(),
|
|
62
|
-
metadata: z.record(z.string()).optional(),
|
|
63
|
-
}).transform((v) => {
|
|
64
|
-
return remap$(v, {
|
|
65
|
-
"tool_choice": "toolChoice",
|
|
66
|
-
"parallel_tool_calls": "parallelToolCalls",
|
|
67
|
-
"max_tool_calls": "maxToolCalls",
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
/** @internal */
|
|
71
|
-
export type CreateAgentRequest$Outbound = {
|
|
72
|
-
name: string;
|
|
73
|
-
description?: string | null | undefined;
|
|
74
|
-
model: string;
|
|
75
|
-
instructions?: string | null | undefined;
|
|
76
|
-
tools?: Array<ToolDefinition$Outbound> | undefined;
|
|
77
|
-
tool_choice?: any | undefined;
|
|
78
|
-
parallel_tool_calls: boolean;
|
|
79
|
-
max_tool_calls?: number | null | undefined;
|
|
80
|
-
text?: AgentTextConfiguration$Outbound | null | undefined;
|
|
81
|
-
reasoning?: AgentReasoningConfiguration$Outbound | null | undefined;
|
|
82
|
-
metadata?: { [k: string]: string } | undefined;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/** @internal */
|
|
86
|
-
export const CreateAgentRequest$outboundSchema: z.ZodType<
|
|
87
|
-
CreateAgentRequest$Outbound,
|
|
88
|
-
z.ZodTypeDef,
|
|
89
|
-
CreateAgentRequest
|
|
90
|
-
> = z.object({
|
|
91
|
-
name: z.string(),
|
|
92
|
-
description: z.nullable(z.string()).optional(),
|
|
93
|
-
model: z.string(),
|
|
94
|
-
instructions: z.nullable(z.string()).optional(),
|
|
95
|
-
tools: z.array(ToolDefinition$outboundSchema).optional(),
|
|
96
|
-
toolChoice: z.any().optional(),
|
|
97
|
-
parallelToolCalls: z.boolean().default(true),
|
|
98
|
-
maxToolCalls: z.nullable(z.number().int()).optional(),
|
|
99
|
-
text: z.nullable(AgentTextConfiguration$outboundSchema).optional(),
|
|
100
|
-
reasoning: z.nullable(AgentReasoningConfiguration$outboundSchema).optional(),
|
|
101
|
-
metadata: z.record(z.string()).optional(),
|
|
102
|
-
}).transform((v) => {
|
|
103
|
-
return remap$(v, {
|
|
104
|
-
toolChoice: "tool_choice",
|
|
105
|
-
parallelToolCalls: "parallel_tool_calls",
|
|
106
|
-
maxToolCalls: "max_tool_calls",
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
export function createAgentRequestToJSON(
|
|
111
|
-
createAgentRequest: CreateAgentRequest,
|
|
112
|
-
): string {
|
|
113
|
-
return JSON.stringify(
|
|
114
|
-
CreateAgentRequest$outboundSchema.parse(createAgentRequest),
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
export function createAgentRequestFromJSON(
|
|
118
|
-
jsonString: string,
|
|
119
|
-
): SafeParseResult<CreateAgentRequest, SDKValidationError> {
|
|
120
|
-
return safeParse(
|
|
121
|
-
jsonString,
|
|
122
|
-
(x) => CreateAgentRequest$inboundSchema.parse(JSON.parse(x)),
|
|
123
|
-
`Failed to parse 'CreateAgentRequest' from JSON`,
|
|
124
|
-
);
|
|
125
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
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
|
-
import {
|
|
11
|
-
AgentReasoningConfiguration,
|
|
12
|
-
AgentReasoningConfiguration$inboundSchema,
|
|
13
|
-
AgentReasoningConfiguration$Outbound,
|
|
14
|
-
AgentReasoningConfiguration$outboundSchema,
|
|
15
|
-
} from "./agentreasoningconfiguration.js";
|
|
16
|
-
import {
|
|
17
|
-
AgentTextConfiguration,
|
|
18
|
-
AgentTextConfiguration$inboundSchema,
|
|
19
|
-
AgentTextConfiguration$Outbound,
|
|
20
|
-
AgentTextConfiguration$outboundSchema,
|
|
21
|
-
} from "./agenttextconfiguration.js";
|
|
22
|
-
import {
|
|
23
|
-
ToolDefinition,
|
|
24
|
-
ToolDefinition$inboundSchema,
|
|
25
|
-
ToolDefinition$Outbound,
|
|
26
|
-
ToolDefinition$outboundSchema,
|
|
27
|
-
} from "./tooldefinition.js";
|
|
28
|
-
|
|
29
|
-
export type UpdateAgentRequest = {
|
|
30
|
-
name?: string | undefined;
|
|
31
|
-
description?: string | null | undefined;
|
|
32
|
-
model?: string | undefined;
|
|
33
|
-
instructions?: string | null | undefined;
|
|
34
|
-
tools?: Array<ToolDefinition> | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Arbitrary JSON value.
|
|
37
|
-
*/
|
|
38
|
-
toolChoice?: any | undefined;
|
|
39
|
-
parallelToolCalls?: boolean | undefined;
|
|
40
|
-
maxToolCalls?: number | null | undefined;
|
|
41
|
-
text?: AgentTextConfiguration | null | undefined;
|
|
42
|
-
reasoning?: AgentReasoningConfiguration | null | undefined;
|
|
43
|
-
metadata?: { [k: string]: string } | undefined;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/** @internal */
|
|
47
|
-
export const UpdateAgentRequest$inboundSchema: z.ZodType<
|
|
48
|
-
UpdateAgentRequest,
|
|
49
|
-
z.ZodTypeDef,
|
|
50
|
-
unknown
|
|
51
|
-
> = z.object({
|
|
52
|
-
name: z.string().optional(),
|
|
53
|
-
description: z.nullable(z.string()).optional(),
|
|
54
|
-
model: z.string().optional(),
|
|
55
|
-
instructions: z.nullable(z.string()).optional(),
|
|
56
|
-
tools: z.array(ToolDefinition$inboundSchema).optional(),
|
|
57
|
-
tool_choice: z.any().optional(),
|
|
58
|
-
parallel_tool_calls: z.boolean().optional(),
|
|
59
|
-
max_tool_calls: z.nullable(z.number().int()).optional(),
|
|
60
|
-
text: z.nullable(AgentTextConfiguration$inboundSchema).optional(),
|
|
61
|
-
reasoning: z.nullable(AgentReasoningConfiguration$inboundSchema).optional(),
|
|
62
|
-
metadata: z.record(z.string()).optional(),
|
|
63
|
-
}).transform((v) => {
|
|
64
|
-
return remap$(v, {
|
|
65
|
-
"tool_choice": "toolChoice",
|
|
66
|
-
"parallel_tool_calls": "parallelToolCalls",
|
|
67
|
-
"max_tool_calls": "maxToolCalls",
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
/** @internal */
|
|
71
|
-
export type UpdateAgentRequest$Outbound = {
|
|
72
|
-
name?: string | undefined;
|
|
73
|
-
description?: string | null | undefined;
|
|
74
|
-
model?: string | undefined;
|
|
75
|
-
instructions?: string | null | undefined;
|
|
76
|
-
tools?: Array<ToolDefinition$Outbound> | undefined;
|
|
77
|
-
tool_choice?: any | undefined;
|
|
78
|
-
parallel_tool_calls?: boolean | undefined;
|
|
79
|
-
max_tool_calls?: number | null | undefined;
|
|
80
|
-
text?: AgentTextConfiguration$Outbound | null | undefined;
|
|
81
|
-
reasoning?: AgentReasoningConfiguration$Outbound | null | undefined;
|
|
82
|
-
metadata?: { [k: string]: string } | undefined;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
/** @internal */
|
|
86
|
-
export const UpdateAgentRequest$outboundSchema: z.ZodType<
|
|
87
|
-
UpdateAgentRequest$Outbound,
|
|
88
|
-
z.ZodTypeDef,
|
|
89
|
-
UpdateAgentRequest
|
|
90
|
-
> = z.object({
|
|
91
|
-
name: z.string().optional(),
|
|
92
|
-
description: z.nullable(z.string()).optional(),
|
|
93
|
-
model: z.string().optional(),
|
|
94
|
-
instructions: z.nullable(z.string()).optional(),
|
|
95
|
-
tools: z.array(ToolDefinition$outboundSchema).optional(),
|
|
96
|
-
toolChoice: z.any().optional(),
|
|
97
|
-
parallelToolCalls: z.boolean().optional(),
|
|
98
|
-
maxToolCalls: z.nullable(z.number().int()).optional(),
|
|
99
|
-
text: z.nullable(AgentTextConfiguration$outboundSchema).optional(),
|
|
100
|
-
reasoning: z.nullable(AgentReasoningConfiguration$outboundSchema).optional(),
|
|
101
|
-
metadata: z.record(z.string()).optional(),
|
|
102
|
-
}).transform((v) => {
|
|
103
|
-
return remap$(v, {
|
|
104
|
-
toolChoice: "tool_choice",
|
|
105
|
-
parallelToolCalls: "parallel_tool_calls",
|
|
106
|
-
maxToolCalls: "max_tool_calls",
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
export function updateAgentRequestToJSON(
|
|
111
|
-
updateAgentRequest: UpdateAgentRequest,
|
|
112
|
-
): string {
|
|
113
|
-
return JSON.stringify(
|
|
114
|
-
UpdateAgentRequest$outboundSchema.parse(updateAgentRequest),
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
export function updateAgentRequestFromJSON(
|
|
118
|
-
jsonString: string,
|
|
119
|
-
): SafeParseResult<UpdateAgentRequest, SDKValidationError> {
|
|
120
|
-
return safeParse(
|
|
121
|
-
jsonString,
|
|
122
|
-
(x) => UpdateAgentRequest$inboundSchema.parse(JSON.parse(x)),
|
|
123
|
-
`Failed to parse 'UpdateAgentRequest' from JSON`,
|
|
124
|
-
);
|
|
125
|
-
}
|