@meetkai/mka1 0.51.33 → 0.51.35

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.
Files changed (140) hide show
  1. package/README.md +229 -226
  2. package/bin/mcp-server.js +1590 -1370
  3. package/bin/mcp-server.js.map +14 -10
  4. package/dist/commonjs/funcs/llmEvalsGetSampleAudio.d.ts +18 -0
  5. package/dist/commonjs/funcs/llmEvalsGetSampleAudio.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/llmEvalsGetSampleAudio.js +141 -0
  7. package/dist/commonjs/funcs/llmEvalsGetSampleAudio.js.map +1 -0
  8. package/dist/commonjs/funcs/llmEvalsListSamples.js +5 -0
  9. package/dist/commonjs/funcs/llmEvalsListSamples.js.map +1 -1
  10. package/dist/commonjs/lib/config.d.ts +2 -2
  11. package/dist/commonjs/lib/config.js +2 -2
  12. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  13. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  14. package/dist/commonjs/mcp-server/server.js +3 -1
  15. package/dist/commonjs/mcp-server/server.js.map +1 -1
  16. package/dist/commonjs/mcp-server/tools/llmEvalsGetSampleAudio.d.ts +8 -0
  17. package/dist/commonjs/mcp-server/tools/llmEvalsGetSampleAudio.d.ts.map +1 -0
  18. package/dist/commonjs/mcp-server/tools/llmEvalsGetSampleAudio.js +64 -0
  19. package/dist/commonjs/mcp-server/tools/llmEvalsGetSampleAudio.js.map +1 -0
  20. package/dist/commonjs/models/components/evalsampleaudioobject.d.ts +37 -0
  21. package/dist/commonjs/models/components/evalsampleaudioobject.d.ts.map +1 -0
  22. package/dist/commonjs/models/components/evalsampleaudioobject.js +77 -0
  23. package/dist/commonjs/models/components/evalsampleaudioobject.js.map +1 -0
  24. package/dist/commonjs/models/components/index.d.ts +1 -0
  25. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/index.js +1 -0
  27. package/dist/commonjs/models/components/index.js.map +1 -1
  28. package/dist/commonjs/models/operations/getevalsampleaudio.d.ts +28 -0
  29. package/dist/commonjs/models/operations/getevalsampleaudio.d.ts.map +1 -0
  30. package/dist/commonjs/models/operations/getevalsampleaudio.js +81 -0
  31. package/dist/commonjs/models/operations/getevalsampleaudio.js.map +1 -0
  32. package/dist/commonjs/models/operations/index.d.ts +1 -0
  33. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  34. package/dist/commonjs/models/operations/index.js +1 -0
  35. package/dist/commonjs/models/operations/index.js.map +1 -1
  36. package/dist/commonjs/models/operations/listevalsamples.d.ts +10 -0
  37. package/dist/commonjs/models/operations/listevalsamples.d.ts.map +1 -1
  38. package/dist/commonjs/models/operations/listevalsamples.js +20 -0
  39. package/dist/commonjs/models/operations/listevalsamples.js.map +1 -1
  40. package/dist/commonjs/react-query/index.d.ts +1 -0
  41. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  42. package/dist/commonjs/react-query/index.js +1 -0
  43. package/dist/commonjs/react-query/index.js.map +1 -1
  44. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.core.d.ts +17 -0
  45. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.core.d.ts.map +1 -0
  46. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.core.js +45 -0
  47. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.core.js.map +1 -0
  48. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.d.ts +44 -0
  49. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.d.ts.map +1 -0
  50. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.js +60 -0
  51. package/dist/commonjs/react-query/llmEvalsGetSampleAudio.js.map +1 -0
  52. package/dist/commonjs/react-query/llmEvalsListSamples.core.d.ts +5 -0
  53. package/dist/commonjs/react-query/llmEvalsListSamples.core.d.ts.map +1 -1
  54. package/dist/commonjs/react-query/llmEvalsListSamples.core.js +5 -0
  55. package/dist/commonjs/react-query/llmEvalsListSamples.core.js.map +1 -1
  56. package/dist/commonjs/react-query/llmEvalsListSamples.d.ts +10 -0
  57. package/dist/commonjs/react-query/llmEvalsListSamples.d.ts.map +1 -1
  58. package/dist/commonjs/react-query/llmEvalsListSamples.js.map +1 -1
  59. package/dist/commonjs/sdk/evals.d.ts +7 -0
  60. package/dist/commonjs/sdk/evals.d.ts.map +1 -1
  61. package/dist/commonjs/sdk/evals.js +10 -0
  62. package/dist/commonjs/sdk/evals.js.map +1 -1
  63. package/dist/esm/funcs/llmEvalsGetSampleAudio.d.ts +18 -0
  64. package/dist/esm/funcs/llmEvalsGetSampleAudio.d.ts.map +1 -0
  65. package/dist/esm/funcs/llmEvalsGetSampleAudio.js +105 -0
  66. package/dist/esm/funcs/llmEvalsGetSampleAudio.js.map +1 -0
  67. package/dist/esm/funcs/llmEvalsListSamples.js +5 -0
  68. package/dist/esm/funcs/llmEvalsListSamples.js.map +1 -1
  69. package/dist/esm/lib/config.d.ts +2 -2
  70. package/dist/esm/lib/config.js +2 -2
  71. package/dist/esm/mcp-server/mcp-server.js +1 -1
  72. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  73. package/dist/esm/mcp-server/server.js +3 -1
  74. package/dist/esm/mcp-server/server.js.map +1 -1
  75. package/dist/esm/mcp-server/tools/llmEvalsGetSampleAudio.d.ts +8 -0
  76. package/dist/esm/mcp-server/tools/llmEvalsGetSampleAudio.d.ts.map +1 -0
  77. package/dist/esm/mcp-server/tools/llmEvalsGetSampleAudio.js +28 -0
  78. package/dist/esm/mcp-server/tools/llmEvalsGetSampleAudio.js.map +1 -0
  79. package/dist/esm/models/components/evalsampleaudioobject.d.ts +37 -0
  80. package/dist/esm/models/components/evalsampleaudioobject.d.ts.map +1 -0
  81. package/dist/esm/models/components/evalsampleaudioobject.js +39 -0
  82. package/dist/esm/models/components/evalsampleaudioobject.js.map +1 -0
  83. package/dist/esm/models/components/index.d.ts +1 -0
  84. package/dist/esm/models/components/index.d.ts.map +1 -1
  85. package/dist/esm/models/components/index.js +1 -0
  86. package/dist/esm/models/components/index.js.map +1 -1
  87. package/dist/esm/models/operations/getevalsampleaudio.d.ts +28 -0
  88. package/dist/esm/models/operations/getevalsampleaudio.d.ts.map +1 -0
  89. package/dist/esm/models/operations/getevalsampleaudio.js +43 -0
  90. package/dist/esm/models/operations/getevalsampleaudio.js.map +1 -0
  91. package/dist/esm/models/operations/index.d.ts +1 -0
  92. package/dist/esm/models/operations/index.d.ts.map +1 -1
  93. package/dist/esm/models/operations/index.js +1 -0
  94. package/dist/esm/models/operations/index.js.map +1 -1
  95. package/dist/esm/models/operations/listevalsamples.d.ts +10 -0
  96. package/dist/esm/models/operations/listevalsamples.d.ts.map +1 -1
  97. package/dist/esm/models/operations/listevalsamples.js +20 -0
  98. package/dist/esm/models/operations/listevalsamples.js.map +1 -1
  99. package/dist/esm/react-query/index.d.ts +1 -0
  100. package/dist/esm/react-query/index.d.ts.map +1 -1
  101. package/dist/esm/react-query/index.js +1 -0
  102. package/dist/esm/react-query/index.js.map +1 -1
  103. package/dist/esm/react-query/llmEvalsGetSampleAudio.core.d.ts +17 -0
  104. package/dist/esm/react-query/llmEvalsGetSampleAudio.core.d.ts.map +1 -0
  105. package/dist/esm/react-query/llmEvalsGetSampleAudio.core.js +40 -0
  106. package/dist/esm/react-query/llmEvalsGetSampleAudio.core.js.map +1 -0
  107. package/dist/esm/react-query/llmEvalsGetSampleAudio.d.ts +44 -0
  108. package/dist/esm/react-query/llmEvalsGetSampleAudio.d.ts.map +1 -0
  109. package/dist/esm/react-query/llmEvalsGetSampleAudio.js +50 -0
  110. package/dist/esm/react-query/llmEvalsGetSampleAudio.js.map +1 -0
  111. package/dist/esm/react-query/llmEvalsListSamples.core.d.ts +5 -0
  112. package/dist/esm/react-query/llmEvalsListSamples.core.d.ts.map +1 -1
  113. package/dist/esm/react-query/llmEvalsListSamples.core.js +5 -0
  114. package/dist/esm/react-query/llmEvalsListSamples.core.js.map +1 -1
  115. package/dist/esm/react-query/llmEvalsListSamples.d.ts +10 -0
  116. package/dist/esm/react-query/llmEvalsListSamples.d.ts.map +1 -1
  117. package/dist/esm/react-query/llmEvalsListSamples.js.map +1 -1
  118. package/dist/esm/sdk/evals.d.ts +7 -0
  119. package/dist/esm/sdk/evals.d.ts.map +1 -1
  120. package/dist/esm/sdk/evals.js +10 -0
  121. package/dist/esm/sdk/evals.js.map +1 -1
  122. package/jsr.json +1 -1
  123. package/package.json +1 -1
  124. package/src/funcs/llmEvalsGetSampleAudio.ts +195 -0
  125. package/src/funcs/llmEvalsListSamples.ts +5 -0
  126. package/src/lib/config.ts +2 -2
  127. package/src/mcp-server/mcp-server.ts +1 -1
  128. package/src/mcp-server/server.ts +3 -1
  129. package/src/mcp-server/tools/llmEvalsGetSampleAudio.ts +37 -0
  130. package/src/models/components/evalsampleaudioobject.ts +90 -0
  131. package/src/models/components/index.ts +1 -0
  132. package/src/models/operations/getevalsampleaudio.ts +85 -0
  133. package/src/models/operations/index.ts +1 -0
  134. package/src/models/operations/listevalsamples.ts +30 -0
  135. package/src/react-query/index.ts +1 -0
  136. package/src/react-query/llmEvalsGetSampleAudio.core.ts +94 -0
  137. package/src/react-query/llmEvalsGetSampleAudio.ts +154 -0
  138. package/src/react-query/llmEvalsListSamples.core.ts +10 -0
  139. package/src/react-query/llmEvalsListSamples.ts +10 -0
  140. package/src/sdk/evals.ts +18 -0
@@ -0,0 +1,195 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SDKCore } from "../core.js";
6
+ import { encodeFormQuery, 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
+ * Get eval sample audio
31
+ *
32
+ * @remarks
33
+ * Returns `{ object, audio, sample_index, task_id, model }` for a single transcription sample — the clip reference (a base64 `data:` URI or a URL) read from the un-redacted `dataset_row` (list responses redact inline `data:` blobs), plus the resolved task/model. Prefers the task's configured `audio_column`, falling back to a heuristic scan. The clip differs across tasks, so pass `task_id` when a run has more than one transcription task; if the index spans multiple tasks and `task_id` is omitted, returns 400 rather than guessing. `model` is optional (the clip is identical across models) and only extends the index prefix. Returns 404 when the sample or its audio is absent, 413 when the inline clip is too large.
34
+ */
35
+ export function llmEvalsGetSampleAudio(
36
+ client: SDKCore,
37
+ request: operations.GetEvalSampleAudioRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.EvalSampleAudioObject,
42
+ | SDKError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: SDKCore,
61
+ request: operations.GetEvalSampleAudioRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.EvalSampleAudioObject,
67
+ | SDKError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) => operations.GetEvalSampleAudioRequest$outboundSchema.parse(value),
82
+ "Input validation failed",
83
+ );
84
+ if (!parsed.ok) {
85
+ return [parsed, { status: "invalid" }];
86
+ }
87
+ const payload = parsed.value;
88
+ const body = null;
89
+
90
+ const pathParams = {
91
+ run_id: encodeSimple("run_id", payload.run_id, {
92
+ explode: false,
93
+ charEncoding: "percent",
94
+ }),
95
+ sample_index: encodeSimple("sample_index", payload.sample_index, {
96
+ explode: false,
97
+ charEncoding: "percent",
98
+ }),
99
+ };
100
+ const path = pathToFunc(
101
+ "/api/v1/llm/evals/runs/{run_id}/samples/{sample_index}/audio",
102
+ )(pathParams);
103
+
104
+ const query = encodeFormQuery({
105
+ "model": payload.model,
106
+ "task_id": payload.task_id,
107
+ });
108
+
109
+ const headers = new Headers(compactMap({
110
+ Accept: "application/json",
111
+ "X-On-Behalf-Of": encodeSimple(
112
+ "X-On-Behalf-Of",
113
+ payload["X-On-Behalf-Of"],
114
+ { explode: false, charEncoding: "none" },
115
+ ),
116
+ }));
117
+
118
+ const secConfig = await extractSecurity(client._options.bearerAuth);
119
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
120
+ const requestSecurity = resolveGlobalSecurity(securityInput);
121
+
122
+ const context = {
123
+ options: client._options,
124
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
125
+ operationID: "getEvalSampleAudio",
126
+ oAuth2Scopes: null,
127
+
128
+ resolvedSecurity: requestSecurity,
129
+
130
+ securitySource: client._options.bearerAuth,
131
+ retryConfig: options?.retries
132
+ || client._options.retryConfig
133
+ || {
134
+ strategy: "backoff",
135
+ backoff: {
136
+ initialInterval: 500,
137
+ maxInterval: 5000,
138
+ exponent: 1.5,
139
+ maxElapsedTime: 15000,
140
+ },
141
+ retryConnectionErrors: true,
142
+ }
143
+ || { strategy: "none" },
144
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
145
+ };
146
+
147
+ const requestRes = client._createRequest(context, {
148
+ security: requestSecurity,
149
+ method: "GET",
150
+ baseURL: options?.serverURL,
151
+ path: path,
152
+ headers: headers,
153
+ query: query,
154
+ body: body,
155
+ userAgent: client._options.userAgent,
156
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
157
+ }, options);
158
+ if (!requestRes.ok) {
159
+ return [requestRes, { status: "invalid" }];
160
+ }
161
+ const req = requestRes.value;
162
+
163
+ const doResult = await client._do(req, {
164
+ context,
165
+ isErrorStatusCode: (statusCode: number) =>
166
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
167
+ retryConfig: context.retryConfig,
168
+ retryCodes: context.retryCodes,
169
+ });
170
+ if (!doResult.ok) {
171
+ return [doResult, { status: "request-error", request: req }];
172
+ }
173
+ const response = doResult.value;
174
+
175
+ const [result] = await M.match<
176
+ components.EvalSampleAudioObject,
177
+ | SDKError
178
+ | ResponseValidationError
179
+ | ConnectionError
180
+ | RequestAbortedError
181
+ | RequestTimeoutError
182
+ | InvalidRequestError
183
+ | UnexpectedClientError
184
+ | SDKValidationError
185
+ >(
186
+ M.json(200, components.EvalSampleAudioObject$inboundSchema),
187
+ M.fail("4XX"),
188
+ M.fail("5XX"),
189
+ )(response, req);
190
+ if (!result.ok) {
191
+ return [result, { status: "complete", request: req, response }];
192
+ }
193
+
194
+ return [result, { status: "complete", request: req, response }];
195
+ }
@@ -99,8 +99,13 @@ async function $do(
99
99
 
100
100
  const query = encodeFormQuery({
101
101
  "after": payload.after,
102
+ "include_dataset_row": payload.include_dataset_row,
102
103
  "limit": payload.limit,
103
104
  "model": payload.model,
105
+ "sample_index": payload.sample_index,
106
+ "score_max": payload.score_max,
107
+ "score_metric": payload.score_metric,
108
+ "score_min": payload.score_min,
104
109
  "status": payload.status,
105
110
  "task_id": payload.task_id,
106
111
  });
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.51.33",
68
+ sdkVersion: "0.51.35",
69
69
  genVersion: "2.924.0",
70
- userAgent: "speakeasy-sdk/typescript 0.51.33 2.924.0 1.1.0 @meetkai/mka1",
70
+ userAgent: "speakeasy-sdk/typescript 0.51.35 2.924.0 1.1.0 @meetkai/mka1",
71
71
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.51.33",
22
+ currentVersion: "0.51.35",
23
23
  },
24
24
  });
25
25
 
@@ -147,6 +147,7 @@ import { tool$llmEvalsDeleteSchedule } from "./tools/llmEvalsDeleteSchedule.js";
147
147
  import { tool$llmEvalsDeleteSuite } from "./tools/llmEvalsDeleteSuite.js";
148
148
  import { tool$llmEvalsGetArtifacts } from "./tools/llmEvalsGetArtifacts.js";
149
149
  import { tool$llmEvalsGetRun } from "./tools/llmEvalsGetRun.js";
150
+ import { tool$llmEvalsGetSampleAudio } from "./tools/llmEvalsGetSampleAudio.js";
150
151
  import { tool$llmEvalsGetSchedule } from "./tools/llmEvalsGetSchedule.js";
151
152
  import { tool$llmEvalsGetSuite } from "./tools/llmEvalsGetSuite.js";
152
153
  import { tool$llmEvalsGetSuiteVersion } from "./tools/llmEvalsGetSuiteVersion.js";
@@ -346,7 +347,7 @@ export function createMCPServer(deps: {
346
347
  }) {
347
348
  const server = new McpServer({
348
349
  name: "SDK",
349
- version: "0.51.33",
350
+ version: "0.51.35",
350
351
  });
351
352
 
352
353
  const client = new SDKCore({
@@ -502,6 +503,7 @@ export function createMCPServer(deps: {
502
503
  tool(tool$llmEvalsRerunFailedSamples);
503
504
  tool(tool$llmEvalsRetryFailedRun);
504
505
  tool(tool$llmEvalsListSamples);
506
+ tool(tool$llmEvalsGetSampleAudio);
505
507
  tool(tool$llmEvalsGetArtifacts);
506
508
  tool(tool$llmEvalsImportHistoricalResults);
507
509
  tool(tool$llmEvalsCreateSchedule);
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { llmEvalsGetSampleAudio } from "../../funcs/llmEvalsGetSampleAudio.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.GetEvalSampleAudioRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$llmEvalsGetSampleAudio: ToolDefinition<typeof args> = {
14
+ name: "llm-evals-get-sample-audio",
15
+ description: `Get eval sample audio
16
+
17
+ Returns \`{ object, audio, sample_index, task_id, model }\` for a single transcription sample — the clip reference (a base64 \`data:\` URI or a URL) read from the un-redacted \`dataset_row\` (list responses redact inline \`data:\` blobs), plus the resolved task/model. Prefers the task's configured \`audio_column\`, falling back to a heuristic scan. The clip differs across tasks, so pass \`task_id\` when a run has more than one transcription task; if the index spans multiple tasks and \`task_id\` is omitted, returns 400 rather than guessing. \`model\` is optional (the clip is identical across models) and only extends the index prefix. Returns 404 when the sample or its audio is absent, 413 when the inline clip is too large.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await llmEvalsGetSampleAudio(
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
+ };
@@ -0,0 +1,90 @@
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
+
11
+ export type EvalSampleAudioObject = {
12
+ object: "eval.sample.audio";
13
+ /**
14
+ * Playable clip reference: a base64 `data:` URI or an http(s) URL.
15
+ */
16
+ audio: string;
17
+ /**
18
+ * Echoes the requested sample index so the client has a complete cache key without tracking it.
19
+ */
20
+ sampleIndex: number;
21
+ /**
22
+ * The task the clip was resolved from (the clip differs across tasks).
23
+ */
24
+ taskId: string;
25
+ /**
26
+ * The model row the clip was read from. The clip is identical across models within a task.
27
+ */
28
+ model: string;
29
+ };
30
+
31
+ /** @internal */
32
+ export const EvalSampleAudioObject$inboundSchema: z.ZodType<
33
+ EvalSampleAudioObject,
34
+ z.ZodTypeDef,
35
+ unknown
36
+ > = z.object({
37
+ object: z.literal("eval.sample.audio"),
38
+ audio: z.string(),
39
+ sample_index: z.number().int(),
40
+ task_id: z.string(),
41
+ model: z.string(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ "sample_index": "sampleIndex",
45
+ "task_id": "taskId",
46
+ });
47
+ });
48
+ /** @internal */
49
+ export type EvalSampleAudioObject$Outbound = {
50
+ object: "eval.sample.audio";
51
+ audio: string;
52
+ sample_index: number;
53
+ task_id: string;
54
+ model: string;
55
+ };
56
+
57
+ /** @internal */
58
+ export const EvalSampleAudioObject$outboundSchema: z.ZodType<
59
+ EvalSampleAudioObject$Outbound,
60
+ z.ZodTypeDef,
61
+ EvalSampleAudioObject
62
+ > = z.object({
63
+ object: z.literal("eval.sample.audio"),
64
+ audio: z.string(),
65
+ sampleIndex: z.number().int(),
66
+ taskId: z.string(),
67
+ model: z.string(),
68
+ }).transform((v) => {
69
+ return remap$(v, {
70
+ sampleIndex: "sample_index",
71
+ taskId: "task_id",
72
+ });
73
+ });
74
+
75
+ export function evalSampleAudioObjectToJSON(
76
+ evalSampleAudioObject: EvalSampleAudioObject,
77
+ ): string {
78
+ return JSON.stringify(
79
+ EvalSampleAudioObject$outboundSchema.parse(evalSampleAudioObject),
80
+ );
81
+ }
82
+ export function evalSampleAudioObjectFromJSON(
83
+ jsonString: string,
84
+ ): SafeParseResult<EvalSampleAudioObject, SDKValidationError> {
85
+ return safeParse(
86
+ jsonString,
87
+ (x) => EvalSampleAudioObject$inboundSchema.parse(JSON.parse(x)),
88
+ `Failed to parse 'EvalSampleAudioObject' from JSON`,
89
+ );
90
+ }
@@ -207,6 +207,7 @@ export * from "./evalpythongradermodelaccess.js";
207
207
  export * from "./evalpythonpreprocessor.js";
208
208
  export * from "./evalrundeletedobject.js";
209
209
  export * from "./evalrunstatus.js";
210
+ export * from "./evalsampleaudioobject.js";
210
211
  export * from "./evalsamplelist.js";
211
212
  export * from "./evalsampleobject.js";
212
213
  export * from "./evalsamplestatus.js";
@@ -0,0 +1,85 @@
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
+
11
+ export type GetEvalSampleAudioRequest = {
12
+ runId: string;
13
+ sampleIndex: number;
14
+ model?: string | undefined;
15
+ taskId?: string | undefined;
16
+ /**
17
+ * Optional external end-user identifier forwarded by the API gateway.
18
+ */
19
+ xOnBehalfOf?: string | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const GetEvalSampleAudioRequest$inboundSchema: z.ZodType<
24
+ GetEvalSampleAudioRequest,
25
+ z.ZodTypeDef,
26
+ unknown
27
+ > = z.object({
28
+ run_id: z.string(),
29
+ sample_index: z.number().int(),
30
+ model: z.string().optional(),
31
+ task_id: z.string().optional(),
32
+ "X-On-Behalf-Of": z.string().optional(),
33
+ }).transform((v) => {
34
+ return remap$(v, {
35
+ "run_id": "runId",
36
+ "sample_index": "sampleIndex",
37
+ "task_id": "taskId",
38
+ "X-On-Behalf-Of": "xOnBehalfOf",
39
+ });
40
+ });
41
+ /** @internal */
42
+ export type GetEvalSampleAudioRequest$Outbound = {
43
+ run_id: string;
44
+ sample_index: number;
45
+ model?: string | undefined;
46
+ task_id?: string | undefined;
47
+ "X-On-Behalf-Of"?: string | undefined;
48
+ };
49
+
50
+ /** @internal */
51
+ export const GetEvalSampleAudioRequest$outboundSchema: z.ZodType<
52
+ GetEvalSampleAudioRequest$Outbound,
53
+ z.ZodTypeDef,
54
+ GetEvalSampleAudioRequest
55
+ > = z.object({
56
+ runId: z.string(),
57
+ sampleIndex: z.number().int(),
58
+ model: z.string().optional(),
59
+ taskId: z.string().optional(),
60
+ xOnBehalfOf: z.string().optional(),
61
+ }).transform((v) => {
62
+ return remap$(v, {
63
+ runId: "run_id",
64
+ sampleIndex: "sample_index",
65
+ taskId: "task_id",
66
+ xOnBehalfOf: "X-On-Behalf-Of",
67
+ });
68
+ });
69
+
70
+ export function getEvalSampleAudioRequestToJSON(
71
+ getEvalSampleAudioRequest: GetEvalSampleAudioRequest,
72
+ ): string {
73
+ return JSON.stringify(
74
+ GetEvalSampleAudioRequest$outboundSchema.parse(getEvalSampleAudioRequest),
75
+ );
76
+ }
77
+ export function getEvalSampleAudioRequestFromJSON(
78
+ jsonString: string,
79
+ ): SafeParseResult<GetEvalSampleAudioRequest, SDKValidationError> {
80
+ return safeParse(
81
+ jsonString,
82
+ (x) => GetEvalSampleAudioRequest$inboundSchema.parse(JSON.parse(x)),
83
+ `Failed to parse 'GetEvalSampleAudioRequest' from JSON`,
84
+ );
85
+ }
@@ -131,6 +131,7 @@ export * from "./getcurrency.js";
131
131
  export * from "./getembeddingsusage.js";
132
132
  export * from "./getevalartifacts.js";
133
133
  export * from "./getevalrun.js";
134
+ export * from "./getevalsampleaudio.js";
134
135
  export * from "./getevalschedule.js";
135
136
  export * from "./getevalsuite.js";
136
137
  export * from "./getevalsuiteversion.js";
@@ -27,6 +27,11 @@ export type ListEvalSamplesRequest = {
27
27
  taskId?: string | undefined;
28
28
  model?: string | undefined;
29
29
  status?: QueryParamStatus | undefined;
30
+ scoreMetric?: string | undefined;
31
+ scoreMin?: number | undefined;
32
+ scoreMax?: number | undefined;
33
+ includeDatasetRow?: boolean | undefined;
34
+ sampleIndex?: string | undefined;
30
35
  /**
31
36
  * Optional external end-user identifier forwarded by the API gateway.
32
37
  */
@@ -54,11 +59,21 @@ export const ListEvalSamplesRequest$inboundSchema: z.ZodType<
54
59
  task_id: z.string().optional(),
55
60
  model: z.string().optional(),
56
61
  status: QueryParamStatus$inboundSchema.optional(),
62
+ score_metric: z.string().optional(),
63
+ score_min: z.number().optional(),
64
+ score_max: z.number().optional(),
65
+ include_dataset_row: z.boolean().default(true),
66
+ sample_index: z.string().optional(),
57
67
  "X-On-Behalf-Of": z.string().optional(),
58
68
  }).transform((v) => {
59
69
  return remap$(v, {
60
70
  "run_id": "runId",
61
71
  "task_id": "taskId",
72
+ "score_metric": "scoreMetric",
73
+ "score_min": "scoreMin",
74
+ "score_max": "scoreMax",
75
+ "include_dataset_row": "includeDatasetRow",
76
+ "sample_index": "sampleIndex",
62
77
  "X-On-Behalf-Of": "xOnBehalfOf",
63
78
  });
64
79
  });
@@ -70,6 +85,11 @@ export type ListEvalSamplesRequest$Outbound = {
70
85
  task_id?: string | undefined;
71
86
  model?: string | undefined;
72
87
  status?: string | undefined;
88
+ score_metric?: string | undefined;
89
+ score_min?: number | undefined;
90
+ score_max?: number | undefined;
91
+ include_dataset_row: boolean;
92
+ sample_index?: string | undefined;
73
93
  "X-On-Behalf-Of"?: string | undefined;
74
94
  };
75
95
 
@@ -85,11 +105,21 @@ export const ListEvalSamplesRequest$outboundSchema: z.ZodType<
85
105
  taskId: z.string().optional(),
86
106
  model: z.string().optional(),
87
107
  status: QueryParamStatus$outboundSchema.optional(),
108
+ scoreMetric: z.string().optional(),
109
+ scoreMin: z.number().optional(),
110
+ scoreMax: z.number().optional(),
111
+ includeDatasetRow: z.boolean().default(true),
112
+ sampleIndex: z.string().optional(),
88
113
  xOnBehalfOf: z.string().optional(),
89
114
  }).transform((v) => {
90
115
  return remap$(v, {
91
116
  runId: "run_id",
92
117
  taskId: "task_id",
118
+ scoreMetric: "score_metric",
119
+ scoreMin: "score_min",
120
+ scoreMax: "score_max",
121
+ includeDatasetRow: "include_dataset_row",
122
+ sampleIndex: "sample_index",
93
123
  xOnBehalfOf: "X-On-Behalf-Of",
94
124
  });
95
125
  });
@@ -139,6 +139,7 @@ export * from "./llmEvalsDeleteSchedule.js";
139
139
  export * from "./llmEvalsDeleteSuite.js";
140
140
  export * from "./llmEvalsGetArtifacts.js";
141
141
  export * from "./llmEvalsGetRun.js";
142
+ export * from "./llmEvalsGetSampleAudio.js";
142
143
  export * from "./llmEvalsGetSchedule.js";
143
144
  export * from "./llmEvalsGetSuite.js";
144
145
  export * from "./llmEvalsGetSuiteVersion.js";
@@ -0,0 +1,94 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ QueryClient,
7
+ QueryFunctionContext,
8
+ QueryKey,
9
+ } from "@tanstack/react-query";
10
+ import { SDKCore } from "../core.js";
11
+ import { llmEvalsGetSampleAudio } from "../funcs/llmEvalsGetSampleAudio.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as components from "../models/components/index.js";
15
+ import * as operations from "../models/operations/index.js";
16
+ import { unwrapAsync } from "../types/fp.js";
17
+ export type LlmEvalsGetSampleAudioQueryData = components.EvalSampleAudioObject;
18
+
19
+ export function prefetchLlmEvalsGetSampleAudio(
20
+ queryClient: QueryClient,
21
+ client$: SDKCore,
22
+ request: operations.GetEvalSampleAudioRequest,
23
+ options?: RequestOptions,
24
+ ): Promise<void> {
25
+ return queryClient.prefetchQuery({
26
+ ...buildLlmEvalsGetSampleAudioQuery(
27
+ client$,
28
+ request,
29
+ options,
30
+ ),
31
+ });
32
+ }
33
+
34
+ export function buildLlmEvalsGetSampleAudioQuery(
35
+ client$: SDKCore,
36
+ request: operations.GetEvalSampleAudioRequest,
37
+ options?: RequestOptions,
38
+ ): {
39
+ queryKey: QueryKey;
40
+ queryFn: (
41
+ context: QueryFunctionContext,
42
+ ) => Promise<LlmEvalsGetSampleAudioQueryData>;
43
+ } {
44
+ return {
45
+ queryKey: queryKeyLlmEvalsGetSampleAudio(
46
+ request.runId,
47
+ request.sampleIndex,
48
+ {
49
+ model: request.model,
50
+ taskId: request.taskId,
51
+ xOnBehalfOf: request.xOnBehalfOf,
52
+ },
53
+ ),
54
+ queryFn: async function llmEvalsGetSampleAudioQueryFn(
55
+ ctx,
56
+ ): Promise<LlmEvalsGetSampleAudioQueryData> {
57
+ const sig = combineSignals(
58
+ ctx.signal,
59
+ options?.signal,
60
+ options?.fetchOptions?.signal,
61
+ );
62
+ const mergedOptions = {
63
+ ...options?.fetchOptions,
64
+ ...options,
65
+ signal: sig,
66
+ };
67
+
68
+ return unwrapAsync(llmEvalsGetSampleAudio(
69
+ client$,
70
+ request,
71
+ mergedOptions,
72
+ ));
73
+ },
74
+ };
75
+ }
76
+
77
+ export function queryKeyLlmEvalsGetSampleAudio(
78
+ runId: string,
79
+ sampleIndex: number,
80
+ parameters: {
81
+ model?: string | undefined;
82
+ taskId?: string | undefined;
83
+ xOnBehalfOf?: string | undefined;
84
+ },
85
+ ): QueryKey {
86
+ return [
87
+ "@meetkai/mka1",
88
+ "evals",
89
+ "getSampleAudio",
90
+ runId,
91
+ sampleIndex,
92
+ parameters,
93
+ ];
94
+ }