@meetkai/mka1 0.55.29 → 0.55.30
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 +410 -410
- package/bin/mcp-server.js +1689 -1140
- package/bin/mcp-server.js.map +16 -7
- package/dist/commonjs/funcs/llmModelsGetOrgBudgetEnforcement.d.ts +19 -0
- package/dist/commonjs/funcs/llmModelsGetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/commonjs/funcs/llmModelsGetOrgBudgetEnforcement.js +132 -0
- package/dist/commonjs/funcs/llmModelsGetOrgBudgetEnforcement.js.map +1 -0
- package/dist/commonjs/funcs/llmModelsListOrgBudgetEnforcements.d.ts +19 -0
- package/dist/commonjs/funcs/llmModelsListOrgBudgetEnforcements.d.ts.map +1 -0
- package/dist/commonjs/funcs/llmModelsListOrgBudgetEnforcements.js +117 -0
- package/dist/commonjs/funcs/llmModelsListOrgBudgetEnforcements.js.map +1 -0
- package/dist/commonjs/funcs/llmModelsSetOrgBudgetEnforcement.d.ts +19 -0
- package/dist/commonjs/funcs/llmModelsSetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/commonjs/funcs/llmModelsSetOrgBudgetEnforcement.js +133 -0
- package/dist/commonjs/funcs/llmModelsSetOrgBudgetEnforcement.js.map +1 -0
- 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 +7 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.js +64 -0
- package/dist/commonjs/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/llmModelsListOrgBudgetEnforcements.d.ts +3 -0
- package/dist/commonjs/mcp-server/tools/llmModelsListOrgBudgetEnforcements.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/llmModelsListOrgBudgetEnforcements.js +26 -0
- package/dist/commonjs/mcp-server/tools/llmModelsListOrgBudgetEnforcements.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.js +64 -0
- package/dist/commonjs/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.js.map +1 -0
- package/dist/commonjs/models/operations/getorgbudgetenforcement.d.ts +79 -0
- package/dist/commonjs/models/operations/getorgbudgetenforcement.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getorgbudgetenforcement.js +129 -0
- package/dist/commonjs/models/operations/getorgbudgetenforcement.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +3 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +3 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listorgbudgetenforcements.d.ts +86 -0
- package/dist/commonjs/models/operations/listorgbudgetenforcements.d.ts.map +1 -0
- package/dist/commonjs/models/operations/listorgbudgetenforcements.js +134 -0
- package/dist/commonjs/models/operations/listorgbudgetenforcements.js.map +1 -0
- package/dist/commonjs/models/operations/setorgbudgetenforcement.d.ts +103 -0
- package/dist/commonjs/models/operations/setorgbudgetenforcement.d.ts.map +1 -0
- package/dist/commonjs/models/operations/setorgbudgetenforcement.js +164 -0
- package/dist/commonjs/models/operations/setorgbudgetenforcement.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +3 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +3 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.core.d.ts +12 -0
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.core.js +34 -0
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.core.js.map +1 -0
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.d.ts +28 -0
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.js +65 -0
- package/dist/commonjs/react-query/llmModelsGetOrgBudgetEnforcement.js.map +1 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.core.d.ts +12 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.core.d.ts.map +1 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.core.js +34 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.core.js.map +1 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.d.ts +26 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.d.ts.map +1 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.js +53 -0
- package/dist/commonjs/react-query/llmModelsListOrgBudgetEnforcements.js.map +1 -0
- package/dist/commonjs/react-query/llmModelsSetOrgBudgetEnforcement.d.ts +28 -0
- package/dist/commonjs/react-query/llmModelsSetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/commonjs/react-query/llmModelsSetOrgBudgetEnforcement.js +47 -0
- package/dist/commonjs/react-query/llmModelsSetOrgBudgetEnforcement.js.map +1 -0
- package/dist/commonjs/sdk/models.d.ts +21 -0
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js +30 -0
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/esm/funcs/llmModelsGetOrgBudgetEnforcement.d.ts +19 -0
- package/dist/esm/funcs/llmModelsGetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/esm/funcs/llmModelsGetOrgBudgetEnforcement.js +96 -0
- package/dist/esm/funcs/llmModelsGetOrgBudgetEnforcement.js.map +1 -0
- package/dist/esm/funcs/llmModelsListOrgBudgetEnforcements.d.ts +19 -0
- package/dist/esm/funcs/llmModelsListOrgBudgetEnforcements.d.ts.map +1 -0
- package/dist/esm/funcs/llmModelsListOrgBudgetEnforcements.js +81 -0
- package/dist/esm/funcs/llmModelsListOrgBudgetEnforcements.js.map +1 -0
- package/dist/esm/funcs/llmModelsSetOrgBudgetEnforcement.d.ts +19 -0
- package/dist/esm/funcs/llmModelsSetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/esm/funcs/llmModelsSetOrgBudgetEnforcement.js +97 -0
- package/dist/esm/funcs/llmModelsSetOrgBudgetEnforcement.js.map +1 -0
- 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 +7 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.d.ts +8 -0
- package/dist/esm/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.js +28 -0
- package/dist/esm/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.js.map +1 -0
- package/dist/esm/mcp-server/tools/llmModelsListOrgBudgetEnforcements.d.ts +3 -0
- package/dist/esm/mcp-server/tools/llmModelsListOrgBudgetEnforcements.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/llmModelsListOrgBudgetEnforcements.js +23 -0
- package/dist/esm/mcp-server/tools/llmModelsListOrgBudgetEnforcements.js.map +1 -0
- package/dist/esm/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.d.ts +8 -0
- package/dist/esm/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.js +28 -0
- package/dist/esm/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.js.map +1 -0
- package/dist/esm/models/operations/getorgbudgetenforcement.d.ts +79 -0
- package/dist/esm/models/operations/getorgbudgetenforcement.d.ts.map +1 -0
- package/dist/esm/models/operations/getorgbudgetenforcement.js +89 -0
- package/dist/esm/models/operations/getorgbudgetenforcement.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +3 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +3 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listorgbudgetenforcements.d.ts +86 -0
- package/dist/esm/models/operations/listorgbudgetenforcements.d.ts.map +1 -0
- package/dist/esm/models/operations/listorgbudgetenforcements.js +94 -0
- package/dist/esm/models/operations/listorgbudgetenforcements.js.map +1 -0
- package/dist/esm/models/operations/setorgbudgetenforcement.d.ts +103 -0
- package/dist/esm/models/operations/setorgbudgetenforcement.d.ts.map +1 -0
- package/dist/esm/models/operations/setorgbudgetenforcement.js +122 -0
- package/dist/esm/models/operations/setorgbudgetenforcement.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +3 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +3 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.core.d.ts +12 -0
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.core.d.ts.map +1 -0
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.core.js +29 -0
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.core.js.map +1 -0
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.d.ts +28 -0
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.js +55 -0
- package/dist/esm/react-query/llmModelsGetOrgBudgetEnforcement.js.map +1 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.core.d.ts +12 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.core.d.ts.map +1 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.core.js +29 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.core.js.map +1 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.d.ts +26 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.d.ts.map +1 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.js +44 -0
- package/dist/esm/react-query/llmModelsListOrgBudgetEnforcements.js.map +1 -0
- package/dist/esm/react-query/llmModelsSetOrgBudgetEnforcement.d.ts +28 -0
- package/dist/esm/react-query/llmModelsSetOrgBudgetEnforcement.d.ts.map +1 -0
- package/dist/esm/react-query/llmModelsSetOrgBudgetEnforcement.js +42 -0
- package/dist/esm/react-query/llmModelsSetOrgBudgetEnforcement.js.map +1 -0
- package/dist/esm/sdk/models.d.ts +21 -0
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js +30 -0
- package/dist/esm/sdk/models.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/llmModelsGetOrgBudgetEnforcement.ts +182 -0
- package/src/funcs/llmModelsListOrgBudgetEnforcements.ts +156 -0
- package/src/funcs/llmModelsSetOrgBudgetEnforcement.ts +183 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +7 -1
- package/src/mcp-server/tools/llmModelsGetOrgBudgetEnforcement.ts +39 -0
- package/src/mcp-server/tools/llmModelsListOrgBudgetEnforcements.ts +30 -0
- package/src/mcp-server/tools/llmModelsSetOrgBudgetEnforcement.ts +39 -0
- package/src/models/operations/getorgbudgetenforcement.ts +198 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/listorgbudgetenforcements.ts +214 -0
- package/src/models/operations/setorgbudgetenforcement.ts +280 -0
- package/src/react-query/index.ts +3 -0
- package/src/react-query/llmModelsGetOrgBudgetEnforcement.core.ts +73 -0
- package/src/react-query/llmModelsGetOrgBudgetEnforcement.ts +144 -0
- package/src/react-query/llmModelsListOrgBudgetEnforcements.core.ts +67 -0
- package/src/react-query/llmModelsListOrgBudgetEnforcements.ts +118 -0
- package/src/react-query/llmModelsSetOrgBudgetEnforcement.ts +109 -0
- package/src/sdk/models.ts +52 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { 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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.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
|
+
* Get an organization's budget-enforcement setting
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* What the spend gate does for this organization's billable requests when the budget check cannot be made (budgeting unreachable or degraded): `allow` admits them, `block` refuses them with 503 `budget_check_unavailable`. Returns the organization's own setting (null = inherits), the cluster default and the effective mode. Cluster admins may read any organization; organization admins their own (never through an exchanged end-user token). API keys need `read:budgets`.
|
|
33
|
+
*
|
|
34
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
35
|
+
*/
|
|
36
|
+
export function llmModelsGetOrgBudgetEnforcement(
|
|
37
|
+
client: SDKCore,
|
|
38
|
+
request: operations.GetOrgBudgetEnforcementRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.GetOrgBudgetEnforcementResponseBody,
|
|
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.GetOrgBudgetEnforcementRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.GetOrgBudgetEnforcementResponseBody,
|
|
68
|
+
| SDKError
|
|
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.GetOrgBudgetEnforcementRequest$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 = null;
|
|
91
|
+
|
|
92
|
+
const pathParams = {
|
|
93
|
+
org_id: encodeSimple("org_id", payload.org_id, {
|
|
94
|
+
explode: false,
|
|
95
|
+
charEncoding: "percent",
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
const path = pathToFunc(
|
|
99
|
+
"/api/v1/llm/models/orgs/{org_id}/budget-enforcement",
|
|
100
|
+
)(pathParams);
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
Accept: "application/json",
|
|
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: "getOrgBudgetEnforcement",
|
|
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: "GET",
|
|
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 [result] = await M.match<
|
|
163
|
+
operations.GetOrgBudgetEnforcementResponseBody,
|
|
164
|
+
| SDKError
|
|
165
|
+
| ResponseValidationError
|
|
166
|
+
| ConnectionError
|
|
167
|
+
| RequestAbortedError
|
|
168
|
+
| RequestTimeoutError
|
|
169
|
+
| InvalidRequestError
|
|
170
|
+
| UnexpectedClientError
|
|
171
|
+
| SDKValidationError
|
|
172
|
+
>(
|
|
173
|
+
M.json(200, operations.GetOrgBudgetEnforcementResponseBody$inboundSchema),
|
|
174
|
+
M.fail("4XX"),
|
|
175
|
+
M.fail("5XX"),
|
|
176
|
+
)(response, req);
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SDKCore } from "../core.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/errors/httpclienterrors.js";
|
|
19
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
20
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List every organization's budget-enforcement override
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Cluster-admin inventory of the organizations that hold a budget-enforcement override, with the cluster default and each one's effective mode — what to review before flipping the cluster default, and where to look when an organization is being refused with `budget_check_unavailable`. Organizations that inherit the default are not listed. API keys need `read:budgets`.
|
|
31
|
+
*
|
|
32
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
33
|
+
*/
|
|
34
|
+
export function llmModelsListOrgBudgetEnforcements(
|
|
35
|
+
client: SDKCore,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.ListOrgBudgetEnforcementsResponseBody,
|
|
40
|
+
| SDKError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
options,
|
|
53
|
+
));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function $do(
|
|
57
|
+
client: SDKCore,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.ListOrgBudgetEnforcementsResponseBody,
|
|
63
|
+
| SDKError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const path = pathToFunc("/api/v1/llm/models/orgs/budget-enforcement")();
|
|
76
|
+
|
|
77
|
+
const headers = new Headers(compactMap({
|
|
78
|
+
Accept: "application/json",
|
|
79
|
+
}));
|
|
80
|
+
|
|
81
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
82
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
83
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
84
|
+
|
|
85
|
+
const context = {
|
|
86
|
+
options: client._options,
|
|
87
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
88
|
+
operationID: "listOrgBudgetEnforcements",
|
|
89
|
+
oAuth2Scopes: null,
|
|
90
|
+
|
|
91
|
+
resolvedSecurity: requestSecurity,
|
|
92
|
+
|
|
93
|
+
securitySource: client._options.bearerAuth,
|
|
94
|
+
retryConfig: options?.retries
|
|
95
|
+
|| client._options.retryConfig
|
|
96
|
+
|| {
|
|
97
|
+
strategy: "backoff",
|
|
98
|
+
backoff: {
|
|
99
|
+
initialInterval: 500,
|
|
100
|
+
maxInterval: 5000,
|
|
101
|
+
exponent: 1.5,
|
|
102
|
+
maxElapsedTime: 15000,
|
|
103
|
+
},
|
|
104
|
+
retryConnectionErrors: true,
|
|
105
|
+
}
|
|
106
|
+
|| { strategy: "none" },
|
|
107
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const requestRes = client._createRequest(context, {
|
|
111
|
+
security: requestSecurity,
|
|
112
|
+
method: "GET",
|
|
113
|
+
baseURL: options?.serverURL,
|
|
114
|
+
path: path,
|
|
115
|
+
headers: headers,
|
|
116
|
+
userAgent: client._options.userAgent,
|
|
117
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
118
|
+
}, options);
|
|
119
|
+
if (!requestRes.ok) {
|
|
120
|
+
return [requestRes, { status: "invalid" }];
|
|
121
|
+
}
|
|
122
|
+
const req = requestRes.value;
|
|
123
|
+
|
|
124
|
+
const doResult = await client._do(req, {
|
|
125
|
+
context,
|
|
126
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
127
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
128
|
+
retryConfig: context.retryConfig,
|
|
129
|
+
retryCodes: context.retryCodes,
|
|
130
|
+
});
|
|
131
|
+
if (!doResult.ok) {
|
|
132
|
+
return [doResult, { status: "request-error", request: req }];
|
|
133
|
+
}
|
|
134
|
+
const response = doResult.value;
|
|
135
|
+
|
|
136
|
+
const [result] = await M.match<
|
|
137
|
+
operations.ListOrgBudgetEnforcementsResponseBody,
|
|
138
|
+
| SDKError
|
|
139
|
+
| ResponseValidationError
|
|
140
|
+
| ConnectionError
|
|
141
|
+
| RequestAbortedError
|
|
142
|
+
| RequestTimeoutError
|
|
143
|
+
| InvalidRequestError
|
|
144
|
+
| UnexpectedClientError
|
|
145
|
+
| SDKValidationError
|
|
146
|
+
>(
|
|
147
|
+
M.json(200, operations.ListOrgBudgetEnforcementsResponseBody$inboundSchema),
|
|
148
|
+
M.fail("4XX"),
|
|
149
|
+
M.fail("5XX"),
|
|
150
|
+
)(response, req);
|
|
151
|
+
if (!result.ok) {
|
|
152
|
+
return [result, { status: "complete", request: req, response }];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return [result, { status: "complete", request: req, response }];
|
|
156
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
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 {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.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
|
+
* Set an organization's budget-enforcement setting
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Choose `block` to refuse this organization's billable requests whenever the budget check is unavailable (fail closed), `allow` to admit them (fail open), or `null` to inherit the cluster default again. Applies to new admissions within 10 seconds on every gateway replica. Cluster admins may set any organization to anything; organization admins may only tighten their own — `block`, or `null` to inherit while that does not loosen an effective `block` — and never `allow`, so neither a cluster-wide nor a cluster-admin-pinned `block` can be switched off or pre-empted by a tenant (never through an exchanged end-user token). API keys need `write:budgets`. The cluster organization has no override: it is the operator's own identity and always fails open.
|
|
33
|
+
*
|
|
34
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
35
|
+
*/
|
|
36
|
+
export function llmModelsSetOrgBudgetEnforcement(
|
|
37
|
+
client: SDKCore,
|
|
38
|
+
request: operations.SetOrgBudgetEnforcementRequest,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.SetOrgBudgetEnforcementResponseBody,
|
|
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.SetOrgBudgetEnforcementRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.SetOrgBudgetEnforcementResponseBody,
|
|
68
|
+
| SDKError
|
|
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.SetOrgBudgetEnforcementRequest$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.RequestBody, { explode: true });
|
|
91
|
+
|
|
92
|
+
const pathParams = {
|
|
93
|
+
org_id: encodeSimple("org_id", payload.org_id, {
|
|
94
|
+
explode: false,
|
|
95
|
+
charEncoding: "percent",
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
const path = pathToFunc(
|
|
99
|
+
"/api/v1/llm/models/orgs/{org_id}/budget-enforcement",
|
|
100
|
+
)(pathParams);
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
108
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
109
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
110
|
+
|
|
111
|
+
const context = {
|
|
112
|
+
options: client._options,
|
|
113
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
+
operationID: "setOrgBudgetEnforcement",
|
|
115
|
+
oAuth2Scopes: null,
|
|
116
|
+
|
|
117
|
+
resolvedSecurity: requestSecurity,
|
|
118
|
+
|
|
119
|
+
securitySource: client._options.bearerAuth,
|
|
120
|
+
retryConfig: options?.retries
|
|
121
|
+
|| client._options.retryConfig
|
|
122
|
+
|| {
|
|
123
|
+
strategy: "backoff",
|
|
124
|
+
backoff: {
|
|
125
|
+
initialInterval: 500,
|
|
126
|
+
maxInterval: 5000,
|
|
127
|
+
exponent: 1.5,
|
|
128
|
+
maxElapsedTime: 15000,
|
|
129
|
+
},
|
|
130
|
+
retryConnectionErrors: true,
|
|
131
|
+
}
|
|
132
|
+
|| { strategy: "none" },
|
|
133
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const requestRes = client._createRequest(context, {
|
|
137
|
+
security: requestSecurity,
|
|
138
|
+
method: "PUT",
|
|
139
|
+
baseURL: options?.serverURL,
|
|
140
|
+
path: path,
|
|
141
|
+
headers: headers,
|
|
142
|
+
body: body,
|
|
143
|
+
userAgent: client._options.userAgent,
|
|
144
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
145
|
+
}, options);
|
|
146
|
+
if (!requestRes.ok) {
|
|
147
|
+
return [requestRes, { status: "invalid" }];
|
|
148
|
+
}
|
|
149
|
+
const req = requestRes.value;
|
|
150
|
+
|
|
151
|
+
const doResult = await client._do(req, {
|
|
152
|
+
context,
|
|
153
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
154
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
155
|
+
retryConfig: context.retryConfig,
|
|
156
|
+
retryCodes: context.retryCodes,
|
|
157
|
+
});
|
|
158
|
+
if (!doResult.ok) {
|
|
159
|
+
return [doResult, { status: "request-error", request: req }];
|
|
160
|
+
}
|
|
161
|
+
const response = doResult.value;
|
|
162
|
+
|
|
163
|
+
const [result] = await M.match<
|
|
164
|
+
operations.SetOrgBudgetEnforcementResponseBody,
|
|
165
|
+
| SDKError
|
|
166
|
+
| ResponseValidationError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| InvalidRequestError
|
|
171
|
+
| UnexpectedClientError
|
|
172
|
+
| SDKValidationError
|
|
173
|
+
>(
|
|
174
|
+
M.json(200, operations.SetOrgBudgetEnforcementResponseBody$inboundSchema),
|
|
175
|
+
M.fail("4XX"),
|
|
176
|
+
M.fail("5XX"),
|
|
177
|
+
)(response, req);
|
|
178
|
+
if (!result.ok) {
|
|
179
|
+
return [result, { status: "complete", request: req, response }];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.1.0",
|
|
68
|
-
sdkVersion: "0.55.
|
|
68
|
+
sdkVersion: "0.55.30",
|
|
69
69
|
genVersion: "2.950.2",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.55.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.55.30 2.950.2 1.1.0 @meetkai/mka1",
|
|
71
71
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -345,6 +345,7 @@ import { tool$llmModelsDeleteCatalogEntry } from "./tools/llmModelsDeleteCatalog
|
|
|
345
345
|
import { tool$llmModelsDeleteOrgAutoModel } from "./tools/llmModelsDeleteOrgAutoModel.js";
|
|
346
346
|
import { tool$llmModelsGet } from "./tools/llmModelsGet.js";
|
|
347
347
|
import { tool$llmModelsGetClusterCurrency } from "./tools/llmModelsGetClusterCurrency.js";
|
|
348
|
+
import { tool$llmModelsGetOrgBudgetEnforcement } from "./tools/llmModelsGetOrgBudgetEnforcement.js";
|
|
348
349
|
import { tool$llmModelsGetOrgTokenQuota } from "./tools/llmModelsGetOrgTokenQuota.js";
|
|
349
350
|
import { tool$llmModelsGetQuota } from "./tools/llmModelsGetQuota.js";
|
|
350
351
|
import { tool$llmModelsList } from "./tools/llmModelsList.js";
|
|
@@ -354,12 +355,14 @@ import { tool$llmModelsListCatalogOrgAccess } from "./tools/llmModelsListCatalog
|
|
|
354
355
|
import { tool$llmModelsListClusterPrices } from "./tools/llmModelsListClusterPrices.js";
|
|
355
356
|
import { tool$llmModelsListEffectivePrices } from "./tools/llmModelsListEffectivePrices.js";
|
|
356
357
|
import { tool$llmModelsListOrgAutoModels } from "./tools/llmModelsListOrgAutoModels.js";
|
|
358
|
+
import { tool$llmModelsListOrgBudgetEnforcements } from "./tools/llmModelsListOrgBudgetEnforcements.js";
|
|
357
359
|
import { tool$llmModelsListOrgPrices } from "./tools/llmModelsListOrgPrices.js";
|
|
358
360
|
import { tool$llmModelsListRegistry } from "./tools/llmModelsListRegistry.js";
|
|
359
361
|
import { tool$llmModelsPutOrgAutoModel } from "./tools/llmModelsPutOrgAutoModel.js";
|
|
360
362
|
import { tool$llmModelsReplaceCatalogOrgAccess } from "./tools/llmModelsReplaceCatalogOrgAccess.js";
|
|
361
363
|
import { tool$llmModelsSetClusterCurrency } from "./tools/llmModelsSetClusterCurrency.js";
|
|
362
364
|
import { tool$llmModelsSetClusterPrice } from "./tools/llmModelsSetClusterPrice.js";
|
|
365
|
+
import { tool$llmModelsSetOrgBudgetEnforcement } from "./tools/llmModelsSetOrgBudgetEnforcement.js";
|
|
363
366
|
import { tool$llmModelsSetOrgPrice } from "./tools/llmModelsSetOrgPrice.js";
|
|
364
367
|
import { tool$llmModelsSetOrgTokenQuota } from "./tools/llmModelsSetOrgTokenQuota.js";
|
|
365
368
|
import { tool$llmModelsUpdateCatalogEntry } from "./tools/llmModelsUpdateCatalogEntry.js";
|
|
@@ -521,7 +524,7 @@ export function createMCPServer(deps: {
|
|
|
521
524
|
}) {
|
|
522
525
|
const server = new McpServer({
|
|
523
526
|
name: "SDK",
|
|
524
|
-
version: "0.55.
|
|
527
|
+
version: "0.55.30",
|
|
525
528
|
});
|
|
526
529
|
|
|
527
530
|
const client = new SDKCore({
|
|
@@ -831,6 +834,9 @@ export function createMCPServer(deps: {
|
|
|
831
834
|
tool(tool$llmModelsGetQuota);
|
|
832
835
|
tool(tool$llmModelsGetOrgTokenQuota);
|
|
833
836
|
tool(tool$llmModelsSetOrgTokenQuota);
|
|
837
|
+
tool(tool$llmModelsListOrgBudgetEnforcements);
|
|
838
|
+
tool(tool$llmModelsGetOrgBudgetEnforcement);
|
|
839
|
+
tool(tool$llmModelsSetOrgBudgetEnforcement);
|
|
834
840
|
tool(tool$llmModelsListCatalog);
|
|
835
841
|
tool(tool$llmModelsAddCatalogEntry);
|
|
836
842
|
tool(tool$llmModelsUpdateCatalogEntry);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { llmModelsGetOrgBudgetEnforcement } from "../../funcs/llmModelsGetOrgBudgetEnforcement.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetOrgBudgetEnforcementRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$llmModelsGetOrgBudgetEnforcement: ToolDefinition<
|
|
14
|
+
typeof args
|
|
15
|
+
> = {
|
|
16
|
+
name: "llm-models-get-org-budget-enforcement",
|
|
17
|
+
description: `Get an organization's budget-enforcement setting
|
|
18
|
+
|
|
19
|
+
What the spend gate does for this organization's billable requests when the budget check cannot be made (budgeting unreachable or degraded): \`allow\` admits them, \`block\` refuses them with 503 \`budget_check_unavailable\`. Returns the organization's own setting (null = inherits), the cluster default and the effective mode. Cluster admins may read any organization; organization admins their own (never through an exchanged end-user token). API keys need \`read:budgets\`.`,
|
|
20
|
+
args,
|
|
21
|
+
tool: async (client, args, ctx) => {
|
|
22
|
+
const [result, apiCall] = await llmModelsGetOrgBudgetEnforcement(
|
|
23
|
+
client,
|
|
24
|
+
args.request,
|
|
25
|
+
{ fetchOptions: { signal: ctx.mcpReq.signal } },
|
|
26
|
+
).$inspect();
|
|
27
|
+
|
|
28
|
+
if (!result.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: result.error.message }],
|
|
31
|
+
isError: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const value = result.value;
|
|
36
|
+
|
|
37
|
+
return formatResult(value, apiCall);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { llmModelsListOrgBudgetEnforcements } from "../../funcs/llmModelsListOrgBudgetEnforcements.js";
|
|
6
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
7
|
+
|
|
8
|
+
export const tool$llmModelsListOrgBudgetEnforcements: ToolDefinition = {
|
|
9
|
+
name: "llm-models-list-org-budget-enforcements",
|
|
10
|
+
description: `List every organization's budget-enforcement override
|
|
11
|
+
|
|
12
|
+
Cluster-admin inventory of the organizations that hold a budget-enforcement override, with the cluster default and each one's effective mode — what to review before flipping the cluster default, and where to look when an organization is being refused with \`budget_check_unavailable\`. Organizations that inherit the default are not listed. API keys need \`read:budgets\`.`,
|
|
13
|
+
tool: async (client, ctx) => {
|
|
14
|
+
const [result, apiCall] = await llmModelsListOrgBudgetEnforcements(
|
|
15
|
+
client,
|
|
16
|
+
{ fetchOptions: { signal: ctx.mcpReq.signal } },
|
|
17
|
+
).$inspect();
|
|
18
|
+
|
|
19
|
+
if (!result.ok) {
|
|
20
|
+
return {
|
|
21
|
+
content: [{ type: "text", text: result.error.message }],
|
|
22
|
+
isError: true,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const value = result.value;
|
|
27
|
+
|
|
28
|
+
return formatResult(value, apiCall);
|
|
29
|
+
},
|
|
30
|
+
};
|