@meetkai/mka1 0.54.71 → 0.54.73
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 +307 -304
- package/bin/mcp-server.js +1691 -1486
- package/bin/mcp-server.js.map +23 -18
- package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.d.ts +20 -0
- package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
- package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.js +137 -0
- package/dist/commonjs/funcs/llmEvalsMeasureSuiteTokens.js.map +1 -0
- package/dist/commonjs/funcs/reposCreate.d.ts +5 -5
- package/dist/commonjs/funcs/reposCreate.js +5 -5
- package/dist/commonjs/funcs/reposDelete.d.ts +2 -2
- package/dist/commonjs/funcs/reposDelete.js +2 -2
- package/dist/commonjs/funcs/reposList.d.ts +1 -1
- package/dist/commonjs/funcs/reposList.js +1 -1
- package/dist/commonjs/funcs/reposUpdate.d.ts +3 -3
- package/dist/commonjs/funcs/reposUpdate.js +3 -3
- 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 +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.js +64 -0
- package/dist/commonjs/mcp-server/tools/llmEvalsMeasureSuiteTokens.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/reposCreate.js +5 -5
- package/dist/commonjs/mcp-server/tools/reposDelete.js +2 -2
- package/dist/commonjs/mcp-server/tools/reposList.js +1 -1
- package/dist/commonjs/mcp-server/tools/reposUpdate.js +3 -3
- package/dist/commonjs/models/components/evalsampleobject.d.ts +5 -0
- package/dist/commonjs/models/components/evalsampleobject.d.ts.map +1 -1
- package/dist/commonjs/models/components/evalsampleobject.js +4 -0
- package/dist/commonjs/models/components/evalsampleobject.js.map +1 -1
- package/dist/commonjs/models/components/evalsuitetokenmeasurement.d.ts +34 -0
- package/dist/commonjs/models/components/evalsuitetokenmeasurement.d.ts.map +1 -0
- package/dist/commonjs/models/components/evalsuitetokenmeasurement.js +81 -0
- package/dist/commonjs/models/components/evalsuitetokenmeasurement.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/measureevalsuitetokensbody.d.ts +20 -0
- package/dist/commonjs/models/components/measureevalsuitetokensbody.d.ts.map +1 -0
- package/dist/commonjs/models/components/measureevalsuitetokensbody.js +58 -0
- package/dist/commonjs/models/components/measureevalsuitetokensbody.js.map +1 -0
- package/dist/commonjs/models/components/repo.d.ts +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/measureevalsuitetokens.d.ts +25 -0
- package/dist/commonjs/models/operations/measureevalsuitetokens.d.ts.map +1 -0
- package/dist/commonjs/models/operations/measureevalsuitetokens.js +76 -0
- package/dist/commonjs/models/operations/measureevalsuitetokens.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +1 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +1 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.d.ts +29 -0
- package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
- package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.js +47 -0
- package/dist/commonjs/react-query/llmEvalsMeasureSuiteTokens.js.map +1 -0
- package/dist/commonjs/react-query/reposCreate.d.ts +5 -5
- package/dist/commonjs/react-query/reposCreate.js +5 -5
- package/dist/commonjs/react-query/reposDelete.d.ts +2 -2
- package/dist/commonjs/react-query/reposDelete.js +2 -2
- package/dist/commonjs/react-query/reposList.d.ts +2 -2
- package/dist/commonjs/react-query/reposList.js +2 -2
- package/dist/commonjs/react-query/reposUpdate.d.ts +3 -3
- package/dist/commonjs/react-query/reposUpdate.js +3 -3
- package/dist/commonjs/sdk/evals.d.ts +7 -0
- package/dist/commonjs/sdk/evals.d.ts.map +1 -1
- package/dist/commonjs/sdk/evals.js +10 -0
- package/dist/commonjs/sdk/evals.js.map +1 -1
- package/dist/commonjs/sdk/repos.d.ts +11 -11
- package/dist/commonjs/sdk/repos.js +11 -11
- package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.d.ts +20 -0
- package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
- package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.js +101 -0
- package/dist/esm/funcs/llmEvalsMeasureSuiteTokens.js.map +1 -0
- package/dist/esm/funcs/reposCreate.d.ts +5 -5
- package/dist/esm/funcs/reposCreate.js +5 -5
- package/dist/esm/funcs/reposDelete.d.ts +2 -2
- package/dist/esm/funcs/reposDelete.js +2 -2
- package/dist/esm/funcs/reposList.d.ts +1 -1
- package/dist/esm/funcs/reposList.js +1 -1
- package/dist/esm/funcs/reposUpdate.d.ts +3 -3
- package/dist/esm/funcs/reposUpdate.js +3 -3
- 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 +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts +8 -0
- package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.js +28 -0
- package/dist/esm/mcp-server/tools/llmEvalsMeasureSuiteTokens.js.map +1 -0
- package/dist/esm/mcp-server/tools/reposCreate.js +5 -5
- package/dist/esm/mcp-server/tools/reposDelete.js +2 -2
- package/dist/esm/mcp-server/tools/reposList.js +1 -1
- package/dist/esm/mcp-server/tools/reposUpdate.js +3 -3
- package/dist/esm/models/components/evalsampleobject.d.ts +5 -0
- package/dist/esm/models/components/evalsampleobject.d.ts.map +1 -1
- package/dist/esm/models/components/evalsampleobject.js +4 -0
- package/dist/esm/models/components/evalsampleobject.js.map +1 -1
- package/dist/esm/models/components/evalsuitetokenmeasurement.d.ts +34 -0
- package/dist/esm/models/components/evalsuitetokenmeasurement.d.ts.map +1 -0
- package/dist/esm/models/components/evalsuitetokenmeasurement.js +43 -0
- package/dist/esm/models/components/evalsuitetokenmeasurement.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/measureevalsuitetokensbody.d.ts +20 -0
- package/dist/esm/models/components/measureevalsuitetokensbody.d.ts.map +1 -0
- package/dist/esm/models/components/measureevalsuitetokensbody.js +20 -0
- package/dist/esm/models/components/measureevalsuitetokensbody.js.map +1 -0
- package/dist/esm/models/components/repo.d.ts +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/measureevalsuitetokens.d.ts +25 -0
- package/dist/esm/models/operations/measureevalsuitetokens.d.ts.map +1 -0
- package/dist/esm/models/operations/measureevalsuitetokens.js +38 -0
- package/dist/esm/models/operations/measureevalsuitetokens.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +1 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +1 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.d.ts +29 -0
- package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.d.ts.map +1 -0
- package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.js +42 -0
- package/dist/esm/react-query/llmEvalsMeasureSuiteTokens.js.map +1 -0
- package/dist/esm/react-query/reposCreate.d.ts +5 -5
- package/dist/esm/react-query/reposCreate.js +5 -5
- package/dist/esm/react-query/reposDelete.d.ts +2 -2
- package/dist/esm/react-query/reposDelete.js +2 -2
- package/dist/esm/react-query/reposList.d.ts +2 -2
- package/dist/esm/react-query/reposList.js +2 -2
- package/dist/esm/react-query/reposUpdate.d.ts +3 -3
- package/dist/esm/react-query/reposUpdate.js +3 -3
- package/dist/esm/sdk/evals.d.ts +7 -0
- package/dist/esm/sdk/evals.d.ts.map +1 -1
- package/dist/esm/sdk/evals.js +10 -0
- package/dist/esm/sdk/evals.js.map +1 -1
- package/dist/esm/sdk/repos.d.ts +11 -11
- package/dist/esm/sdk/repos.js +11 -11
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/llmEvalsMeasureSuiteTokens.ts +191 -0
- package/src/funcs/reposCreate.ts +5 -5
- package/src/funcs/reposDelete.ts +2 -2
- package/src/funcs/reposList.ts +1 -1
- package/src/funcs/reposUpdate.ts +3 -3
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/llmEvalsMeasureSuiteTokens.ts +37 -0
- package/src/mcp-server/tools/reposCreate.ts +5 -5
- package/src/mcp-server/tools/reposDelete.ts +2 -2
- package/src/mcp-server/tools/reposList.ts +1 -1
- package/src/mcp-server/tools/reposUpdate.ts +3 -3
- package/src/models/components/evalsampleobject.ts +9 -0
- package/src/models/components/evalsuitetokenmeasurement.ts +91 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/measureevalsuitetokensbody.ts +54 -0
- package/src/models/components/repo.ts +1 -1
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/measureevalsuitetokens.ts +80 -0
- package/src/react-query/index.ts +1 -0
- package/src/react-query/llmEvalsMeasureSuiteTokens.ts +110 -0
- package/src/react-query/reposCreate.ts +5 -5
- package/src/react-query/reposDelete.ts +2 -2
- package/src/react-query/reposList.ts +2 -2
- package/src/react-query/reposUpdate.ts +3 -3
- package/src/sdk/evals.ts +18 -0
- package/src/sdk/repos.ts +11 -11
package/dist/esm/sdk/repos.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare class Repos extends ClientSDK {
|
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
12
|
* Returns every repository in the caller's org (org owner/admin only).
|
|
13
|
-
*
|
|
13
|
+
* Read-only. With `kind`, only repositories of that kind; an untyped
|
|
14
14
|
* (legacy, `kind: null`) repository appears in the unfiltered listing
|
|
15
15
|
* only.
|
|
16
16
|
*/
|
|
@@ -19,19 +19,19 @@ export declare class Repos extends ClientSDK {
|
|
|
19
19
|
* Create a repository
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
|
-
* Provisions a repository (org owner/admin only)
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
22
|
+
* Provisions a repository (org owner/admin only); a failed provision is
|
|
23
|
+
* rolled back best-effort (see the `502`). The repository belongs to the
|
|
24
|
+
* caller's org. `kind` says what it will hold and defaults to `repo` (a
|
|
25
|
+
* plain git repository); it decides which protocol planes answer for the
|
|
26
|
+
* name (see the `Repo` schema).
|
|
27
27
|
*/
|
|
28
28
|
create(request: operations.CreateRepoRequest, options?: RequestOptions): Promise<components.Repo>;
|
|
29
29
|
/**
|
|
30
30
|
* Delete a repository
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* Removes a repository; org owner/admin only. The
|
|
34
|
-
* authoritative; the
|
|
33
|
+
* Removes a repository; org owner/admin only. The deletion is
|
|
34
|
+
* authoritative; the contents are cleaned up best-effort.
|
|
35
35
|
*/
|
|
36
36
|
delete(request: operations.DeleteRepoRequest, options?: RequestOptions): Promise<void>;
|
|
37
37
|
/**
|
|
@@ -47,15 +47,15 @@ export declare class Repos extends ClientSDK {
|
|
|
47
47
|
*
|
|
48
48
|
* @remarks
|
|
49
49
|
* Applies a label-only update (name/description/kind); org owner/admin
|
|
50
|
-
* only. The repository id is stable, so a rename
|
|
51
|
-
*
|
|
50
|
+
* only. The repository id is stable, so a rename touches no contents.
|
|
51
|
+
* Omitted fields are left unchanged.
|
|
52
52
|
*
|
|
53
53
|
* `kind` is the ONE way a repository's kind changes after creation (the
|
|
54
54
|
* protocol planes never change it): it types a legacy `kind: null`
|
|
55
55
|
* repository and corrects a wrong kind. `repo`, `model` and `dataset`
|
|
56
56
|
* convert freely and any repository may become `image`; a repository
|
|
57
57
|
* whose container images are still named by a tag can be given no
|
|
58
|
-
* other kind — leaving `image`, or typing a legacy `null`
|
|
58
|
+
* other kind — leaving `image`, or typing a legacy `null` repository as
|
|
59
59
|
* anything else, is refused with `409 kind_has_content` (list and
|
|
60
60
|
* delete the tags through this API first). A switch away from `image`
|
|
61
61
|
* collects every image no tag reaches before it is judged, so an image
|
package/dist/esm/sdk/repos.js
CHANGED
|
@@ -18,7 +18,7 @@ export class Repos extends ClientSDK {
|
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
20
|
* Returns every repository in the caller's org (org owner/admin only).
|
|
21
|
-
*
|
|
21
|
+
* Read-only. With `kind`, only repositories of that kind; an untyped
|
|
22
22
|
* (legacy, `kind: null`) repository appears in the unfiltered listing
|
|
23
23
|
* only.
|
|
24
24
|
*/
|
|
@@ -29,11 +29,11 @@ export class Repos extends ClientSDK {
|
|
|
29
29
|
* Create a repository
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
|
-
* Provisions a repository (org owner/admin only)
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
32
|
+
* Provisions a repository (org owner/admin only); a failed provision is
|
|
33
|
+
* rolled back best-effort (see the `502`). The repository belongs to the
|
|
34
|
+
* caller's org. `kind` says what it will hold and defaults to `repo` (a
|
|
35
|
+
* plain git repository); it decides which protocol planes answer for the
|
|
36
|
+
* name (see the `Repo` schema).
|
|
37
37
|
*/
|
|
38
38
|
async create(request, options) {
|
|
39
39
|
return unwrapAsync(reposCreate(this, request, options));
|
|
@@ -42,8 +42,8 @@ export class Repos extends ClientSDK {
|
|
|
42
42
|
* Delete a repository
|
|
43
43
|
*
|
|
44
44
|
* @remarks
|
|
45
|
-
* Removes a repository; org owner/admin only. The
|
|
46
|
-
* authoritative; the
|
|
45
|
+
* Removes a repository; org owner/admin only. The deletion is
|
|
46
|
+
* authoritative; the contents are cleaned up best-effort.
|
|
47
47
|
*/
|
|
48
48
|
async delete(request, options) {
|
|
49
49
|
return unwrapAsync(reposDelete(this, request, options));
|
|
@@ -63,15 +63,15 @@ export class Repos extends ClientSDK {
|
|
|
63
63
|
*
|
|
64
64
|
* @remarks
|
|
65
65
|
* Applies a label-only update (name/description/kind); org owner/admin
|
|
66
|
-
* only. The repository id is stable, so a rename
|
|
67
|
-
*
|
|
66
|
+
* only. The repository id is stable, so a rename touches no contents.
|
|
67
|
+
* Omitted fields are left unchanged.
|
|
68
68
|
*
|
|
69
69
|
* `kind` is the ONE way a repository's kind changes after creation (the
|
|
70
70
|
* protocol planes never change it): it types a legacy `kind: null`
|
|
71
71
|
* repository and corrects a wrong kind. `repo`, `model` and `dataset`
|
|
72
72
|
* convert freely and any repository may become `image`; a repository
|
|
73
73
|
* whose container images are still named by a tag can be given no
|
|
74
|
-
* other kind — leaving `image`, or typing a legacy `null`
|
|
74
|
+
* other kind — leaving `image`, or typing a legacy `null` repository as
|
|
75
75
|
* anything else, is refused with `409 kind_has_content` (list and
|
|
76
76
|
* delete the tags through this API first). A switch away from `image`
|
|
77
77
|
* collects every image no tag reaches before it is judged, so an image
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,191 @@
|
|
|
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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKError } from "../models/errors/sdkerror.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
|
+
* Count tokens from stored text for a suite's unmeasured samples
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Backfill for rows written before the gateway recorded usage. For samples of the suite's completed runs that have answer or reasoning text but no token figure, counts prompt, reasoning and answer tokens from the stored text (tiktoken o200k_base, one ruler for every model), marks them `tokens_estimated`, and refreshes each run's per-task `tokens` and run totals so the leaderboard's efficiency figures appear. Processes `limit` runs per call, oldest run id first; call again until `remaining_runs` is 0. Samples the provider or the import already measured are left alone, and a sample with no text stays unmeasured. New rows get the same figures at generation or import time, so this is a no-op on a suite with nothing to measure.
|
|
34
|
+
*
|
|
35
|
+
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
36
|
+
*/
|
|
37
|
+
export function llmEvalsMeasureSuiteTokens(
|
|
38
|
+
client: SDKCore,
|
|
39
|
+
request: operations.MeasureEvalSuiteTokensRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
components.EvalSuiteTokenMeasurement,
|
|
44
|
+
| SDKError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: SDKCore,
|
|
63
|
+
request: operations.MeasureEvalSuiteTokensRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
components.EvalSuiteTokenMeasurement,
|
|
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) =>
|
|
84
|
+
operations.MeasureEvalSuiteTokensRequest$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload.MeasureEvalSuiteTokensBody, {
|
|
92
|
+
explode: true,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const pathParams = {
|
|
96
|
+
suite_id: encodeSimple("suite_id", payload.suite_id, {
|
|
97
|
+
explode: false,
|
|
98
|
+
charEncoding: "percent",
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
const path = pathToFunc("/api/v1/llm/evals/suites/{suite_id}/tokens/measure")(
|
|
102
|
+
pathParams,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const headers = new Headers(compactMap({
|
|
106
|
+
"Content-Type": "application/json",
|
|
107
|
+
Accept: "application/json",
|
|
108
|
+
"X-On-Behalf-Of": encodeSimple(
|
|
109
|
+
"X-On-Behalf-Of",
|
|
110
|
+
payload["X-On-Behalf-Of"],
|
|
111
|
+
{ explode: false, charEncoding: "none" },
|
|
112
|
+
),
|
|
113
|
+
}));
|
|
114
|
+
|
|
115
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
116
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
117
|
+
const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
|
|
118
|
+
|
|
119
|
+
const context = {
|
|
120
|
+
options: client._options,
|
|
121
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
122
|
+
operationID: "measureEvalSuiteTokens",
|
|
123
|
+
oAuth2Scopes: null,
|
|
124
|
+
|
|
125
|
+
resolvedSecurity: requestSecurity,
|
|
126
|
+
|
|
127
|
+
securitySource: client._options.bearerAuth,
|
|
128
|
+
retryConfig: options?.retries
|
|
129
|
+
|| client._options.retryConfig
|
|
130
|
+
|| {
|
|
131
|
+
strategy: "backoff",
|
|
132
|
+
backoff: {
|
|
133
|
+
initialInterval: 500,
|
|
134
|
+
maxInterval: 5000,
|
|
135
|
+
exponent: 1.5,
|
|
136
|
+
maxElapsedTime: 15000,
|
|
137
|
+
},
|
|
138
|
+
retryConnectionErrors: true,
|
|
139
|
+
}
|
|
140
|
+
|| { strategy: "none" },
|
|
141
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const requestRes = client._createRequest(context, {
|
|
145
|
+
security: requestSecurity,
|
|
146
|
+
method: "POST",
|
|
147
|
+
baseURL: options?.serverURL,
|
|
148
|
+
path: path,
|
|
149
|
+
headers: headers,
|
|
150
|
+
body: body,
|
|
151
|
+
userAgent: client._options.userAgent,
|
|
152
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
153
|
+
}, options);
|
|
154
|
+
if (!requestRes.ok) {
|
|
155
|
+
return [requestRes, { status: "invalid" }];
|
|
156
|
+
}
|
|
157
|
+
const req = requestRes.value;
|
|
158
|
+
|
|
159
|
+
const doResult = await client._do(req, {
|
|
160
|
+
context,
|
|
161
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
162
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
163
|
+
retryConfig: context.retryConfig,
|
|
164
|
+
retryCodes: context.retryCodes,
|
|
165
|
+
});
|
|
166
|
+
if (!doResult.ok) {
|
|
167
|
+
return [doResult, { status: "request-error", request: req }];
|
|
168
|
+
}
|
|
169
|
+
const response = doResult.value;
|
|
170
|
+
|
|
171
|
+
const [result] = await M.match<
|
|
172
|
+
components.EvalSuiteTokenMeasurement,
|
|
173
|
+
| SDKError
|
|
174
|
+
| ResponseValidationError
|
|
175
|
+
| ConnectionError
|
|
176
|
+
| RequestAbortedError
|
|
177
|
+
| RequestTimeoutError
|
|
178
|
+
| InvalidRequestError
|
|
179
|
+
| UnexpectedClientError
|
|
180
|
+
| SDKValidationError
|
|
181
|
+
>(
|
|
182
|
+
M.json(200, components.EvalSuiteTokenMeasurement$inboundSchema),
|
|
183
|
+
M.fail("4XX"),
|
|
184
|
+
M.fail("5XX"),
|
|
185
|
+
)(response, req);
|
|
186
|
+
if (!result.ok) {
|
|
187
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return [result, { status: "complete", request: req, response }];
|
|
191
|
+
}
|
package/src/funcs/reposCreate.ts
CHANGED
|
@@ -31,11 +31,11 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Create a repository
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Provisions a repository (org owner/admin only)
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* Provisions a repository (org owner/admin only); a failed provision is
|
|
35
|
+
* rolled back best-effort (see the `502`). The repository belongs to the
|
|
36
|
+
* caller's org. `kind` says what it will hold and defaults to `repo` (a
|
|
37
|
+
* plain git repository); it decides which protocol planes answer for the
|
|
38
|
+
* name (see the `Repo` schema).
|
|
39
39
|
*
|
|
40
40
|
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
41
41
|
*/
|
package/src/funcs/reposDelete.ts
CHANGED
|
@@ -31,8 +31,8 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* Delete a repository
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* Removes a repository; org owner/admin only. The
|
|
35
|
-
* authoritative; the
|
|
34
|
+
* Removes a repository; org owner/admin only. The deletion is
|
|
35
|
+
* authoritative; the contents are cleaned up best-effort.
|
|
36
36
|
*
|
|
37
37
|
* If set, this operation will use {@link Security.bearerAuth} from the global security.
|
|
38
38
|
*/
|
package/src/funcs/reposList.ts
CHANGED
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
33
|
* Returns every repository in the caller's org (org owner/admin only).
|
|
34
|
-
*
|
|
34
|
+
* Read-only. With `kind`, only repositories of that kind; an untyped
|
|
35
35
|
* (legacy, `kind: null`) repository appears in the unfiltered listing
|
|
36
36
|
* only.
|
|
37
37
|
*
|
package/src/funcs/reposUpdate.ts
CHANGED
|
@@ -32,15 +32,15 @@ import { Result } from "../types/fp.js";
|
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
34
|
* Applies a label-only update (name/description/kind); org owner/admin
|
|
35
|
-
* only. The repository id is stable, so a rename
|
|
36
|
-
*
|
|
35
|
+
* only. The repository id is stable, so a rename touches no contents.
|
|
36
|
+
* Omitted fields are left unchanged.
|
|
37
37
|
*
|
|
38
38
|
* `kind` is the ONE way a repository's kind changes after creation (the
|
|
39
39
|
* protocol planes never change it): it types a legacy `kind: null`
|
|
40
40
|
* repository and corrects a wrong kind. `repo`, `model` and `dataset`
|
|
41
41
|
* convert freely and any repository may become `image`; a repository
|
|
42
42
|
* whose container images are still named by a tag can be given no
|
|
43
|
-
* other kind — leaving `image`, or typing a legacy `null`
|
|
43
|
+
* other kind — leaving `image`, or typing a legacy `null` repository as
|
|
44
44
|
* anything else, is refused with `409 kind_has_content` (list and
|
|
45
45
|
* delete the tags through this API first). A switch away from `image`
|
|
46
46
|
* collects every image no tag reaches before it is judged, so an image
|
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.54.
|
|
68
|
+
sdkVersion: "0.54.73",
|
|
69
69
|
genVersion: "2.943.0",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.54.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.54.73 2.943.0 1.1.0 @meetkai/mka1",
|
|
71
71
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -247,6 +247,7 @@ import { tool$llmEvalsListSchedules } from "./tools/llmEvalsListSchedules.js";
|
|
|
247
247
|
import { tool$llmEvalsListSuiteLeaderboardRuns } from "./tools/llmEvalsListSuiteLeaderboardRuns.js";
|
|
248
248
|
import { tool$llmEvalsListSuites } from "./tools/llmEvalsListSuites.js";
|
|
249
249
|
import { tool$llmEvalsListSuiteVersions } from "./tools/llmEvalsListSuiteVersions.js";
|
|
250
|
+
import { tool$llmEvalsMeasureSuiteTokens } from "./tools/llmEvalsMeasureSuiteTokens.js";
|
|
250
251
|
import { tool$llmEvalsRerunFailedSamples } from "./tools/llmEvalsRerunFailedSamples.js";
|
|
251
252
|
import { tool$llmEvalsRetryFailedRun } from "./tools/llmEvalsRetryFailedRun.js";
|
|
252
253
|
import { tool$llmEvalsTriggerSchedule } from "./tools/llmEvalsTriggerSchedule.js";
|
|
@@ -473,7 +474,7 @@ export function createMCPServer(deps: {
|
|
|
473
474
|
}) {
|
|
474
475
|
const server = new McpServer({
|
|
475
476
|
name: "SDK",
|
|
476
|
-
version: "0.54.
|
|
477
|
+
version: "0.54.73",
|
|
477
478
|
});
|
|
478
479
|
|
|
479
480
|
const client = new SDKCore({
|
|
@@ -683,6 +684,7 @@ export function createMCPServer(deps: {
|
|
|
683
684
|
tool(tool$llmEvalsGetSuiteVersion);
|
|
684
685
|
tool(tool$llmEvalsListSuiteLeaderboardRuns);
|
|
685
686
|
tool(tool$llmEvalsGetSuiteLeaderboard);
|
|
687
|
+
tool(tool$llmEvalsMeasureSuiteTokens);
|
|
686
688
|
tool(tool$llmEvalsCreateRun);
|
|
687
689
|
tool(tool$llmEvalsListRuns);
|
|
688
690
|
tool(tool$llmEvalsGetRun);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { llmEvalsMeasureSuiteTokens } from "../../funcs/llmEvalsMeasureSuiteTokens.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.MeasureEvalSuiteTokensRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$llmEvalsMeasureSuiteTokens: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "llm-evals-measure-suite-tokens",
|
|
15
|
+
description: `Count tokens from stored text for a suite's unmeasured samples
|
|
16
|
+
|
|
17
|
+
Backfill for rows written before the gateway recorded usage. For samples of the suite's completed runs that have answer or reasoning text but no token figure, counts prompt, reasoning and answer tokens from the stored text (tiktoken o200k_base, one ruler for every model), marks them \`tokens_estimated\`, and refreshes each run's per-task \`tokens\` and run totals so the leaderboard's efficiency figures appear. Processes \`limit\` runs per call, oldest run id first; call again until \`remaining_runs\` is 0. Samples the provider or the import already measured are left alone, and a sample with no text stays unmeasured. New rows get the same figures at generation or import time, so this is a no-op on a suite with nothing to measure.`,
|
|
18
|
+
args,
|
|
19
|
+
tool: async (client, args, ctx) => {
|
|
20
|
+
const [result, apiCall] = await llmEvalsMeasureSuiteTokens(
|
|
21
|
+
client,
|
|
22
|
+
args.request,
|
|
23
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
24
|
+
).$inspect();
|
|
25
|
+
|
|
26
|
+
if (!result.ok) {
|
|
27
|
+
return {
|
|
28
|
+
content: [{ type: "text", text: result.error.message }],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const value = result.value;
|
|
34
|
+
|
|
35
|
+
return formatResult(value, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -14,11 +14,11 @@ export const tool$reposCreate: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "repos-create",
|
|
15
15
|
description: `Create a repository
|
|
16
16
|
|
|
17
|
-
Provisions a repository (org owner/admin only)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
Provisions a repository (org owner/admin only); a failed provision is
|
|
18
|
+
rolled back best-effort (see the \`502\`). The repository belongs to the
|
|
19
|
+
caller's org. \`kind\` says what it will hold and defaults to \`repo\` (a
|
|
20
|
+
plain git repository); it decides which protocol planes answer for the
|
|
21
|
+
name (see the \`Repo\` schema).
|
|
22
22
|
`,
|
|
23
23
|
args,
|
|
24
24
|
tool: async (client, args, ctx) => {
|
|
@@ -14,8 +14,8 @@ export const tool$reposDelete: ToolDefinition<typeof args> = {
|
|
|
14
14
|
name: "repos-delete",
|
|
15
15
|
description: `Delete a repository
|
|
16
16
|
|
|
17
|
-
Removes a repository; org owner/admin only. The
|
|
18
|
-
authoritative; the
|
|
17
|
+
Removes a repository; org owner/admin only. The deletion is
|
|
18
|
+
authoritative; the contents are cleaned up best-effort.
|
|
19
19
|
`,
|
|
20
20
|
args,
|
|
21
21
|
tool: async (client, args, ctx) => {
|
|
@@ -15,7 +15,7 @@ export const tool$reposList: ToolDefinition<typeof args> = {
|
|
|
15
15
|
description: `List the caller's org's repositories
|
|
16
16
|
|
|
17
17
|
Returns every repository in the caller's org (org owner/admin only).
|
|
18
|
-
|
|
18
|
+
Read-only. With \`kind\`, only repositories of that kind; an untyped
|
|
19
19
|
(legacy, \`kind: null\`) repository appears in the unfiltered listing
|
|
20
20
|
only.
|
|
21
21
|
`,
|
|
@@ -15,15 +15,15 @@ export const tool$reposUpdate: ToolDefinition<typeof args> = {
|
|
|
15
15
|
description: `Update a repository's labels
|
|
16
16
|
|
|
17
17
|
Applies a label-only update (name/description/kind); org owner/admin
|
|
18
|
-
only. The repository id is stable, so a rename
|
|
19
|
-
|
|
18
|
+
only. The repository id is stable, so a rename touches no contents.
|
|
19
|
+
Omitted fields are left unchanged.
|
|
20
20
|
|
|
21
21
|
\`kind\` is the ONE way a repository's kind changes after creation (the
|
|
22
22
|
protocol planes never change it): it types a legacy \`kind: null\`
|
|
23
23
|
repository and corrects a wrong kind. \`repo\`, \`model\` and \`dataset\`
|
|
24
24
|
convert freely and any repository may become \`image\`; a repository
|
|
25
25
|
whose container images are still named by a tag can be given no
|
|
26
|
-
other kind — leaving \`image\`, or typing a legacy \`null\`
|
|
26
|
+
other kind — leaving \`image\`, or typing a legacy \`null\` repository as
|
|
27
27
|
anything else, is refused with \`409 kind_has_content\` (list and
|
|
28
28
|
delete the tags through this API first). A switch away from \`image\`
|
|
29
29
|
collects every image no tag reaches before it is judged, so an image
|
|
@@ -57,6 +57,10 @@ export type EvalSampleObject = {
|
|
|
57
57
|
* The share of `output_tokens` the provider attributed to reasoning. Null when it reported no split.
|
|
58
58
|
*/
|
|
59
59
|
reasoningTokens: number | null;
|
|
60
|
+
/**
|
|
61
|
+
* True when the token figures were counted from the stored text by the gateway (tiktoken o200k_base, one ruler for every model) because neither the provider nor the imported row reported usage. Comparable verbosity, not a billing count.
|
|
62
|
+
*/
|
|
63
|
+
tokensEstimated: boolean;
|
|
60
64
|
/**
|
|
61
65
|
* Per-phase wall clock for a harness trial: `environment_setup`, `agent_setup`, `agent_execution`, `verifier`, each `{ started_at, finished_at }` as ISO 8601 timestamps exactly as the harness recorded them. A phase the harness did not time is absent rather than null. Drives the trial timing bar. Null outside harness runs.
|
|
62
66
|
*/
|
|
@@ -94,6 +98,7 @@ export const EvalSampleObject$inboundSchema: z.ZodType<
|
|
|
94
98
|
output_tokens: z.nullable(z.number().int()),
|
|
95
99
|
cached_tokens: z.nullable(z.number().int()),
|
|
96
100
|
reasoning_tokens: z.nullable(z.number().int()),
|
|
101
|
+
tokens_estimated: z.boolean(),
|
|
97
102
|
phase_timings: z.nullable(z.record(z.any())),
|
|
98
103
|
created_at: z.number().int(),
|
|
99
104
|
started_at: z.nullable(z.number().int()),
|
|
@@ -112,6 +117,7 @@ export const EvalSampleObject$inboundSchema: z.ZodType<
|
|
|
112
117
|
"output_tokens": "outputTokens",
|
|
113
118
|
"cached_tokens": "cachedTokens",
|
|
114
119
|
"reasoning_tokens": "reasoningTokens",
|
|
120
|
+
"tokens_estimated": "tokensEstimated",
|
|
115
121
|
"phase_timings": "phaseTimings",
|
|
116
122
|
"created_at": "createdAt",
|
|
117
123
|
"started_at": "startedAt",
|
|
@@ -142,6 +148,7 @@ export type EvalSampleObject$Outbound = {
|
|
|
142
148
|
output_tokens: number | null;
|
|
143
149
|
cached_tokens: number | null;
|
|
144
150
|
reasoning_tokens: number | null;
|
|
151
|
+
tokens_estimated: boolean;
|
|
145
152
|
phase_timings: { [k: string]: any } | null;
|
|
146
153
|
created_at: number;
|
|
147
154
|
started_at: number | null;
|
|
@@ -176,6 +183,7 @@ export const EvalSampleObject$outboundSchema: z.ZodType<
|
|
|
176
183
|
outputTokens: z.nullable(z.number().int()),
|
|
177
184
|
cachedTokens: z.nullable(z.number().int()),
|
|
178
185
|
reasoningTokens: z.nullable(z.number().int()),
|
|
186
|
+
tokensEstimated: z.boolean(),
|
|
179
187
|
phaseTimings: z.nullable(z.record(z.any())),
|
|
180
188
|
createdAt: z.number().int(),
|
|
181
189
|
startedAt: z.nullable(z.number().int()),
|
|
@@ -194,6 +202,7 @@ export const EvalSampleObject$outboundSchema: z.ZodType<
|
|
|
194
202
|
outputTokens: "output_tokens",
|
|
195
203
|
cachedTokens: "cached_tokens",
|
|
196
204
|
reasoningTokens: "reasoning_tokens",
|
|
205
|
+
tokensEstimated: "tokens_estimated",
|
|
197
206
|
phaseTimings: "phase_timings",
|
|
198
207
|
createdAt: "created_at",
|
|
199
208
|
startedAt: "started_at",
|