bailian-cli-core 1.4.2 → 1.6.0

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/dist/index.d.mts CHANGED
@@ -469,6 +469,90 @@ interface DashScopeKnowledgeRetrieveResponse {
469
469
  }>;
470
470
  };
471
471
  }
472
+ interface KnowledgeSearchRequest {
473
+ query: string;
474
+ agent_id: string;
475
+ images?: string[];
476
+ query_history?: Array<{
477
+ role: "user" | "assistant";
478
+ content: string;
479
+ }>;
480
+ }
481
+ interface KnowledgeSearchResponse {
482
+ code: string;
483
+ status_code: number;
484
+ request_id: string;
485
+ data: {
486
+ total: number;
487
+ cost_time: number;
488
+ nodes: Array<{
489
+ score: number;
490
+ text: string;
491
+ metadata: {
492
+ content?: string;
493
+ title?: string;
494
+ doc_id?: string;
495
+ doc_name?: string;
496
+ doc_url?: string;
497
+ pipeline_id?: string;
498
+ workspace_id?: string;
499
+ page_number?: number;
500
+ image_url?: string;
501
+ _knowledge_type?: string;
502
+ _citation_index?: number;
503
+ _score?: number;
504
+ };
505
+ }>;
506
+ };
507
+ }
508
+ type KnowledgeChatContentPart = {
509
+ type: "text";
510
+ text: string;
511
+ } | {
512
+ type: "image_url";
513
+ image_url: {
514
+ url: string;
515
+ };
516
+ };
517
+ interface KnowledgeChatMessage {
518
+ role: "user" | "assistant";
519
+ content: string | KnowledgeChatContentPart[];
520
+ }
521
+ interface KnowledgeChatRequest {
522
+ input: {
523
+ messages: KnowledgeChatMessage[];
524
+ };
525
+ parameters: {
526
+ agent_options: {
527
+ agent_id: string;
528
+ user?: {
529
+ user_id?: string;
530
+ workspace_id?: string;
531
+ };
532
+ };
533
+ };
534
+ stream: boolean;
535
+ }
536
+ interface KnowledgeChatStreamChunk {
537
+ output: {
538
+ choices: Array<{
539
+ message: {
540
+ role: string;
541
+ content: string;
542
+ tool_calls?: unknown[];
543
+ extra?: {
544
+ group?: string;
545
+ step_change?: string;
546
+ step?: string;
547
+ };
548
+ };
549
+ finish_reason: string;
550
+ }>;
551
+ };
552
+ code: string;
553
+ message: string;
554
+ request_id: string;
555
+ }
472
556
  interface DashScopeTTSRequest {
473
557
  model: string;
474
558
  input: {
@@ -625,6 +709,10 @@ declare function parseConfigFile(raw: unknown): ConfigFile;
625
709
  interface Config {
626
710
  clientName?: string;
627
711
  clientVersion?: string;
712
+ /** Product binary name (e.g. "bl", "rag"), injected by createCli for command-facing output. */
713
+ binName?: string;
714
+ /** npm package name for self-update (e.g. "bailian-cli", "bailian-cli-rag"), injected by createCli. */
715
+ npmPackage?: string;
628
716
  apiKey?: string;
629
717
  /** `DASHSCOPE_ACCESS_TOKEN` env (explicit override). */
630
718
  accessTokenEnv?: string;
@@ -713,6 +801,8 @@ declare function speechRecognizeEndpoint(baseUrl: string): string;
713
801
  declare function profileSchemaEndpoint(baseUrl: string): string;
714
802
  declare function userProfileEndpoint(baseUrl: string, schemaId: string): string;
715
803
  declare function knowledgeRetrieveEndpoint(baseUrl: string): string;
804
+ declare function knowledgeSearchEndpoint(workspaceId: string): string;
805
+ declare function knowledgeChatEndpoint(workspaceId: string): string;
716
806
  declare function mcpWebSearchEndpoint(baseUrl: string): string;
717
807
  //#endregion
718
808
  //#region src/client/headers.d.ts
@@ -906,6 +996,886 @@ declare function resolveFileUrl(input: string, apiKey: string, model: string, op
906
996
  signal?: AbortSignal;
907
997
  }): Promise<string>;
908
998
  //#endregion
999
+ //#region src/dataset/types.d.ts
1000
+ /**
1001
+ * Dataset API types.
1002
+ *
1003
+ * Maps DashScope `/api/v1/files` responses. The same endpoint backs every
1004
+ * dataset purpose the platform supports today (fine-tune training,
1005
+ * evaluation, etc.) — these types are deliberately purpose-agnostic so new
1006
+ * purposes can be plugged in without schema changes.
1007
+ */
1008
+ /** A single uploaded dataset file as returned by the platform. */
1009
+ interface DatasetFile {
1010
+ /** File ID — the only stable handle for downstream consumers. */
1011
+ file_id: string;
1012
+ /** Original filename uploaded by the user. */
1013
+ name: string;
1014
+ /** Bytes. */
1015
+ size?: number;
1016
+ /** Content hash (server-computed). */
1017
+ md5?: string;
1018
+ /** Free-form purpose tag, e.g. "fine-tune", "evaluation". */
1019
+ purpose?: string;
1020
+ /** Optional internal/external URL (kept for parity with the API). */
1021
+ url?: string;
1022
+ /** Free-form description if the user supplied one at upload time. */
1023
+ description?: string;
1024
+ /** Server-side creation timestamp (string, format per platform). */
1025
+ gmt_create?: string;
1026
+ }
1027
+ /** GET /api/v1/files response. */
1028
+ interface DatasetListResponse {
1029
+ request_id?: string;
1030
+ data?: {
1031
+ files?: DatasetFile[];
1032
+ total?: number;
1033
+ page_no?: number;
1034
+ page_size?: number;
1035
+ };
1036
+ }
1037
+ /** GET /api/v1/files/{file_id} response. */
1038
+ interface DatasetGetResponse {
1039
+ request_id?: string;
1040
+ data?: DatasetFile;
1041
+ }
1042
+ /**
1043
+ * POST /compatible-mode/v1/files response (OpenAI-compatible).
1044
+ *
1045
+ * Flat shape — there is no `data` envelope on success. `id` is the file handle
1046
+ * to pass to fine-tune jobs; `purpose` is echoed back so callers can confirm
1047
+ * it landed. On business-level failure (HTTP 200 + `data.failed_uploads`)
1048
+ * `id` is absent and `data.failed_uploads[]` carries the platform's reason.
1049
+ */
1050
+ interface DatasetUploadResponse {
1051
+ request_id?: string;
1052
+ /** File ID — the handle returned to callers (e.g. `file-ft-…`). */
1053
+ id?: string;
1054
+ /** Always `"file"` for this endpoint. */
1055
+ object?: string;
1056
+ /** Bytes. */
1057
+ bytes?: number;
1058
+ /** Original filename uploaded by the user. */
1059
+ filename?: string;
1060
+ /** Purpose tag, e.g. `"fine-tune"`, `"file-extract"`, `"batch"`. */
1061
+ purpose?: string;
1062
+ /** Platform processing state, e.g. `"processed"`. */
1063
+ status?: string;
1064
+ /** Creation timestamp (Unix seconds). */
1065
+ created_at?: number;
1066
+ /**
1067
+ * Failure envelope: HTTP 200 + business failure. When present the upload
1068
+ * did NOT produce a file_id; callers must treat this as an error. Common
1069
+ * cause: server-side schema rejection (e.g. malformed JSONL slipped past
1070
+ * the local pre-flight).
1071
+ */
1072
+ data?: {
1073
+ failed_uploads?: Array<{
1074
+ code?: string;
1075
+ message?: string;
1076
+ file_name?: string;
1077
+ }>;
1078
+ };
1079
+ }
1080
+ /** DELETE /api/v1/files/{file_id} response. */
1081
+ interface DatasetDeleteResponse {
1082
+ request_id?: string;
1083
+ data?: {
1084
+ deleted?: boolean;
1085
+ file_id?: string;
1086
+ };
1087
+ }
1088
+ //#endregion
1089
+ //#region src/dataset/api.d.ts
1090
+ interface DatasetUploadParams {
1091
+ filePath: string;
1092
+ /**
1093
+ * Purpose tag forwarded to the platform. Defaults to "fine-tune" because
1094
+ * the API requires the field, but callers should set this explicitly when
1095
+ * uploading evaluation or other dataset kinds.
1096
+ */
1097
+ purpose?: string;
1098
+ signal?: AbortSignal;
1099
+ }
1100
+ /**
1101
+ * POST /compatible-mode/v1/files (multipart/form-data)
1102
+ *
1103
+ * Streams the file from disk so we don't buffer 300MB into memory. Node's
1104
+ * `fetch` accepts a `Blob` produced from a Readable stream via `Response`'s
1105
+ * body shim, but the simplest portable approach (and the one used in
1106
+ * `files/upload.ts`) is to wrap the buffer in a Blob. Here we use `Blob`
1107
+ * with a stream-backed lazy `arrayBuffer()` for >50MB files via
1108
+ * `Response`'s helper to avoid the buffer doubling. Fall back to readFileSync
1109
+ * for small files where streaming overhead isn't worth it.
1110
+ */
1111
+ declare function uploadDataset(config: Config, params: DatasetUploadParams): Promise<DatasetFile>;
1112
+ interface DatasetListParams {
1113
+ pageNo?: number;
1114
+ pageSize?: number;
1115
+ purpose?: string;
1116
+ signal?: AbortSignal;
1117
+ }
1118
+ /** GET /api/v1/files */
1119
+ declare function listDatasets(config: Config, params?: DatasetListParams): Promise<DatasetListResponse>;
1120
+ /** GET /api/v1/files/{file_id} */
1121
+ declare function getDataset(config: Config, fileId: string, signal?: AbortSignal): Promise<DatasetGetResponse>;
1122
+ /** DELETE /api/v1/files/{file_id} */
1123
+ declare function deleteDataset(config: Config, fileId: string, signal?: AbortSignal): Promise<DatasetDeleteResponse>;
1124
+ //#endregion
1125
+ //#region src/dataset/validate/types.d.ts
1126
+ /**
1127
+ * Validator types — the registry contract that every format adheres to.
1128
+ *
1129
+ * Design (Plan B from the architecture review):
1130
+ * - A `ValidatorSpec` is a plain object, not a class. Adding a new format =
1131
+ * one new file exporting one constant + one line in the registry.
1132
+ * - Common pre-flight checks (existence, size, extension) live in `common.ts`
1133
+ * and are applied by `validateDataset` before the format-specific validator
1134
+ * runs, so individual specs only handle structural concerns.
1135
+ */
1136
+ interface ValidateOpts {
1137
+ /** When true, validators should do exhaustive checks (e.g. parse every line). */
1138
+ fullValidate?: boolean;
1139
+ /** Optional max bytes override (defaults to 300MB at the registry level). */
1140
+ maxBytes?: number;
1141
+ /** Optional abort signal for long-running scans. */
1142
+ signal?: AbortSignal;
1143
+ /**
1144
+ * Record-schema selector for formats that carry more than one schema under
1145
+ * the same extension. Today only the `.jsonl` ChatML family honors it:
1146
+ * - `"chatml"` — `{messages: [...]}` (SFT). `chosen`/`rejected` ignored.
1147
+ * - `"dpo"` — `{messages: [...], chosen: {role,content}, rejected: {...}}`.
1148
+ * Every record MUST carry `chosen` + `rejected`.
1149
+ * - `"cpt"` — `{text: "..."}` (continual pre-training). Raw text only,
1150
+ * no `messages[]`.
1151
+ * - `undefined` — auto-detect per record: a record with `chosen` or
1152
+ * `rejected` is validated as DPO, one with `text` (and no
1153
+ * `messages`) as CPT, otherwise as ChatML.
1154
+ * `finetune create` sets this from `--training-type` (dpo* → "dpo",
1155
+ * cpt → "cpt") so a malformed dataset fails at validate time, not on the
1156
+ * platform ten minutes in.
1157
+ */
1158
+ schema?: DatasetSchema;
1159
+ }
1160
+ /** The schemas a `.jsonl` record can be validated against. */
1161
+ type DatasetSchema = "chatml" | "dpo" | "cpt";
1162
+ type ValidationSeverity = "error" | "warning";
1163
+ interface ValidationIssue {
1164
+ severity: ValidationSeverity;
1165
+ /** Stable machine-readable key, e.g. "EMPTY_FILE", "MALFORMED_JSON". */
1166
+ code: string;
1167
+ /** Human-readable message. */
1168
+ message: string;
1169
+ /** 1-indexed line number for line-oriented formats. */
1170
+ line?: number;
1171
+ /** Optional path inside the offending row, e.g. "messages[2].role". */
1172
+ path?: string;
1173
+ }
1174
+ interface ValidationStats {
1175
+ /** Total observed records (rows / samples / messages, depending on format). */
1176
+ totalRecords?: number;
1177
+ /** Records actually deep-checked (sampled). */
1178
+ sampledRecords?: number;
1179
+ /** Total file bytes. */
1180
+ bytes?: number;
1181
+ /** Wall time spent in the scan (ms). */
1182
+ durationMs?: number;
1183
+ }
1184
+ interface ValidationResult {
1185
+ valid: boolean;
1186
+ format: string;
1187
+ filePath: string;
1188
+ errors: ValidationIssue[];
1189
+ warnings: ValidationIssue[];
1190
+ stats: ValidationStats;
1191
+ }
1192
+ interface ValidatorSpec {
1193
+ /** Human-readable format identifier, e.g. "jsonl". */
1194
+ format: string;
1195
+ /** Lower-cased file extensions handled by this validator (include dot). */
1196
+ extensions: string[];
1197
+ /** Format-specific check. Pre-flight (existence/size) is applied by the registry. */
1198
+ validate(filePath: string, opts: ValidateOpts): Promise<ValidationResult>;
1199
+ }
1200
+ //#endregion
1201
+ //#region src/dataset/validate/registry.d.ts
1202
+ /** Lookup the validator that handles a given file extension. */
1203
+ declare function pickValidator(filePath: string): ValidatorSpec;
1204
+ /** Allow tests / future plugins to inject extra validators. Idempotent. */
1205
+ declare function registerValidator(spec: ValidatorSpec): void;
1206
+ /**
1207
+ * Top-level entry point. Applies common pre-flight (existence/size/extension)
1208
+ * then defers to the format-specific validator.
1209
+ */
1210
+ declare function validateDataset(filePath: string, opts?: ValidateOpts): Promise<ValidationResult>;
1211
+ /** Read-only view of the active registry — handy for tests / `--help`. */
1212
+ declare function listSupportedFormats(): {
1213
+ format: string;
1214
+ extensions: string[];
1215
+ }[];
1216
+ //#endregion
1217
+ //#region src/dataset/validate/common.d.ts
1218
+ /**
1219
+ * The platform caps dataset uploads at 300MB per file. `bl dataset upload`
1220
+ * enforces this client-side so users learn early. Update if the platform
1221
+ * raises the cap or differentiates per-purpose limits.
1222
+ */
1223
+ declare const MAX_DATASET_BYTES: number;
1224
+ /**
1225
+ * Parse a `--schema` CLI value into a `DatasetSchema` (or `undefined` for
1226
+ * auto-detect). Single source of truth for the schema vocabulary so `dataset
1227
+ * validate`, `dataset upload`, and any future caller agree on accepted values
1228
+ * and error wording. Throws USAGE for anything unrecognized.
1229
+ */
1230
+ declare function parseDatasetSchemaFlag(value: string | undefined): DatasetSchema | undefined;
1231
+ //#endregion
1232
+ //#region src/dataset/validate/format.d.ts
1233
+ /**
1234
+ * Format a single validation issue as a one-line string.
1235
+ *
1236
+ * Shared across every entry point that surfaces dataset validation results
1237
+ * (`dataset validate`, `dataset upload`, `finetune create`) so the error
1238
+ * presentation stays consistent regardless of which command ran the validator.
1239
+ */
1240
+ declare function formatIssue(issue: ValidationIssue): string;
1241
+ //#endregion
1242
+ //#region src/finetune/types.d.ts
1243
+ /**
1244
+ * Fine-tune job API types.
1245
+ *
1246
+ * Maps DashScope `/api/v1/fine-tunes` request/response shapes (snake_case
1247
+ * preserved verbatim — callers decide how to surface fields).
1248
+ */
1249
+ /** Hyper-parameters honored by text/thinking/vision SFT models. */
1250
+ interface FineTuneHyperParameters {
1251
+ /** Number of training epochs. */
1252
+ n_epochs?: number;
1253
+ batch_size?: number;
1254
+ /** Sent as a string to avoid JSON-number precision loss (e.g. "1.6e-5"). */
1255
+ learning_rate?: string;
1256
+ max_length?: number;
1257
+ /** Train/validation split ratio when no validation file is provided. */
1258
+ split?: number;
1259
+ lr_scheduler_type?: string;
1260
+ /** Future-compat: arbitrary additional fields are forwarded as-is. */
1261
+ [k: string]: unknown;
1262
+ }
1263
+ /** POST /api/v1/fine-tunes request body. */
1264
+ interface CreateFineTuneRequest {
1265
+ /** Base model ID, or a previously fine-tuned model ID for continued training. */
1266
+ model: string;
1267
+ training_file_ids: string[];
1268
+ /**
1269
+ * Server-supported values: `cpt | sft | efficient_sft | dpo_full | dpo_lora`.
1270
+ *
1271
+ * NOTE — current bailian-cli scope: `sft` (default) and `efficient_sft`.
1272
+ * Other values are rejected by the CLI at parse time so users get an
1273
+ * immediate error instead of a vague server-side rejection. This type
1274
+ * stays open as `string` for forward compatibility (so adding `dpo_lora`
1275
+ * later is a CLI-only change).
1276
+ */
1277
+ training_type: string;
1278
+ validation_file_ids?: string[];
1279
+ hyper_parameters?: FineTuneHyperParameters;
1280
+ /** Display name for the job (optional, server generates if omitted). */
1281
+ job_name?: string;
1282
+ /** Output model name. Either bring your own or let the server generate one. */
1283
+ model_name?: string;
1284
+ /** Suffix appended by the platform; field is `finetuned_output_suffix` (NOT `suffix`). */
1285
+ finetuned_output_suffix?: string;
1286
+ }
1287
+ /** GET /api/v1/fine-tunes/{id}/logs response. */
1288
+ interface FineTuneLogEntry {
1289
+ /** Server-defined log line — schema varies; preserve as-is. */
1290
+ [k: string]: unknown;
1291
+ }
1292
+ interface GetFineTuneLogsResponse {
1293
+ request_id?: string;
1294
+ output?: {
1295
+ logs?: Array<FineTuneLogEntry | string>;
1296
+ total?: number;
1297
+ page_no?: number;
1298
+ page_size?: number;
1299
+ [k: string]: unknown;
1300
+ };
1301
+ data?: {
1302
+ logs?: Array<FineTuneLogEntry | string>;
1303
+ total?: number;
1304
+ page_no?: number;
1305
+ page_size?: number;
1306
+ [k: string]: unknown;
1307
+ };
1308
+ }
1309
+ /** A single checkpoint as returned by the platform. */
1310
+ interface FineTuneCheckpoint {
1311
+ checkpoint?: string;
1312
+ checkpoint_id?: string;
1313
+ full_name?: string;
1314
+ job_id?: string;
1315
+ model_name?: string;
1316
+ model_display_name?: string;
1317
+ /** SUCCEEDED | PENDING | FAILED | … */
1318
+ status?: string;
1319
+ step?: number;
1320
+ epoch?: number;
1321
+ create_time?: string;
1322
+ expire_time?: string;
1323
+ output_model_deleted?: boolean;
1324
+ metrics?: Record<string, unknown>;
1325
+ [k: string]: unknown;
1326
+ }
1327
+ /**
1328
+ * GET /api/v1/fine-tunes/{job_id}/checkpoints response.
1329
+ *
1330
+ * Real shape: `output` is an array of checkpoints directly (NOT wrapped in
1331
+ * `{ checkpoints: [...] }`). The wrapped form is preserved as a fallback for
1332
+ * older deployments.
1333
+ */
1334
+ interface ListCheckpointsResponse {
1335
+ request_id?: string;
1336
+ output?: FineTuneCheckpoint[] | {
1337
+ checkpoints?: FineTuneCheckpoint[];
1338
+ total?: number;
1339
+ [k: string]: unknown;
1340
+ };
1341
+ data?: FineTuneCheckpoint[] | {
1342
+ checkpoints?: FineTuneCheckpoint[];
1343
+ total?: number;
1344
+ [k: string]: unknown;
1345
+ };
1346
+ }
1347
+ /** GET /api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name= response. */
1348
+ interface ExportCheckpointResponse {
1349
+ request_id?: string;
1350
+ output?: {
1351
+ /** Resulting deployable model name. */model_name?: string;
1352
+ [k: string]: unknown;
1353
+ };
1354
+ data?: {
1355
+ model_name?: string;
1356
+ [k: string]: unknown;
1357
+ };
1358
+ }
1359
+ /** POST /api/v1/fine-tunes/{id}/cancel response. */
1360
+ interface CancelFineTuneResponse {
1361
+ request_id?: string;
1362
+ output?: FineTuneJob;
1363
+ data?: FineTuneJob;
1364
+ }
1365
+ /** DELETE /api/v1/fine-tunes/{id} response. */
1366
+ interface DeleteFineTuneResponse {
1367
+ request_id?: string;
1368
+ output?: {
1369
+ deleted?: boolean;
1370
+ job_id?: string;
1371
+ [k: string]: unknown;
1372
+ };
1373
+ data?: {
1374
+ deleted?: boolean;
1375
+ job_id?: string;
1376
+ [k: string]: unknown;
1377
+ };
1378
+ }
1379
+ /** A single fine-tune job record as returned by the platform. */
1380
+ interface FineTuneJob {
1381
+ job_id?: string;
1382
+ job_name?: string;
1383
+ model?: string;
1384
+ base_model?: string;
1385
+ training_type?: string;
1386
+ /** PENDING | RUNNING | SUCCEEDED | FAILED | CANCELED */
1387
+ status?: string;
1388
+ finetuned_output?: string;
1389
+ finetuned_output_suffix?: string;
1390
+ model_name?: string;
1391
+ training_file_ids?: string[];
1392
+ validation_file_ids?: string[];
1393
+ hyper_parameters?: FineTuneHyperParameters;
1394
+ /** Server-side timestamps (DashScope uses snake_case `create_time` / `end_time`). */
1395
+ create_time?: string;
1396
+ end_time?: string;
1397
+ /** Legacy field names — kept for backward compatibility with older deployments. */
1398
+ gmt_create?: string;
1399
+ gmt_modified?: string;
1400
+ /** Free-form additional fields are preserved by callers. */
1401
+ [k: string]: unknown;
1402
+ }
1403
+ /** POST /api/v1/fine-tunes response. */
1404
+ interface CreateFineTuneResponse {
1405
+ request_id?: string;
1406
+ /** Modern DashScope shape. */
1407
+ output?: FineTuneJob;
1408
+ /** Legacy shape for older platform builds. */
1409
+ data?: FineTuneJob;
1410
+ }
1411
+ /** GET /api/v1/fine-tunes response. */
1412
+ interface ListFineTunesResponse {
1413
+ request_id?: string;
1414
+ output?: {
1415
+ jobs?: FineTuneJob[];
1416
+ total?: number;
1417
+ page_no?: number;
1418
+ page_size?: number;
1419
+ };
1420
+ data?: {
1421
+ jobs?: FineTuneJob[];
1422
+ total?: number;
1423
+ page_no?: number;
1424
+ page_size?: number;
1425
+ };
1426
+ }
1427
+ /** GET /api/v1/fine-tunes/{job_id} response. */
1428
+ interface GetFineTuneResponse {
1429
+ request_id?: string;
1430
+ output?: FineTuneJob;
1431
+ data?: FineTuneJob;
1432
+ }
1433
+ //#endregion
1434
+ //#region src/finetune/api.d.ts
1435
+ /** POST /api/v1/fine-tunes */
1436
+ declare function createFineTune(config: Config, body: CreateFineTuneRequest, signal?: AbortSignal): Promise<CreateFineTuneResponse>;
1437
+ interface ListFineTunesParams {
1438
+ pageNo?: number;
1439
+ pageSize?: number;
1440
+ status?: string;
1441
+ signal?: AbortSignal;
1442
+ }
1443
+ /** GET /api/v1/fine-tunes */
1444
+ declare function listFineTunes(config: Config, params?: ListFineTunesParams): Promise<ListFineTunesResponse>;
1445
+ /** GET /api/v1/fine-tunes/{job_id} */
1446
+ declare function getFineTune(config: Config, jobId: string, signal?: AbortSignal): Promise<GetFineTuneResponse>;
1447
+ /** POST /api/v1/fine-tunes/{job_id}/cancel */
1448
+ declare function cancelFineTune(config: Config, jobId: string, signal?: AbortSignal): Promise<CancelFineTuneResponse>;
1449
+ /** DELETE /api/v1/fine-tunes/{job_id} */
1450
+ declare function deleteFineTune(config: Config, jobId: string, signal?: AbortSignal): Promise<DeleteFineTuneResponse>;
1451
+ interface GetFineTuneLogsParams {
1452
+ pageNo?: number;
1453
+ pageSize?: number;
1454
+ signal?: AbortSignal;
1455
+ }
1456
+ /** GET /api/v1/fine-tunes/{job_id}/logs */
1457
+ declare function getFineTuneLogs(config: Config, jobId: string, params?: GetFineTuneLogsParams): Promise<GetFineTuneLogsResponse>;
1458
+ /** GET /api/v1/fine-tunes/{job_id}/checkpoints */
1459
+ declare function listCheckpoints(config: Config, jobId: string, signal?: AbortSignal): Promise<ListCheckpointsResponse>;
1460
+ /**
1461
+ * GET /api/v1/fine-tunes/{job_id}/export/{checkpoint}?model_name={name}
1462
+ *
1463
+ * Publishes a training checkpoint as a deployable model — required before
1464
+ * `bl deploy create` can target it. The platform may auto-export the best
1465
+ * checkpoint on SUCCEEDED, but explicit export is the canonical path.
1466
+ */
1467
+ declare function exportCheckpoint(config: Config, jobId: string, checkpoint: string, modelName: string, signal?: AbortSignal): Promise<ExportCheckpointResponse>;
1468
+ //#endregion
1469
+ //#region src/finetune/capability.d.ts
1470
+ /**
1471
+ * Training-type vocabulary exposed to users.
1472
+ *
1473
+ * Convention: the bare method name is **full-parameter** tuning; the `-lora`
1474
+ * suffix is the LoRA variant. This holds for `sft` and `dpo` (both have a
1475
+ * full + lora pair). `cpt` is the exception — the platform only supports
1476
+ * full-parameter CPT (no `cpt-lora` exists server-side), so it has no lora
1477
+ * sibling.
1478
+ *
1479
+ * Each CLI value maps 1:1 to a server `training_type`. The mapping happens at
1480
+ * the interface boundary (request body), so the rest of the CLI never sees the
1481
+ * raw server strings (`efficient_sft`, `dpo_full`, ...).
1482
+ */
1483
+ declare const TRAINING_TYPE_MAP: {
1484
+ readonly sft: {
1485
+ readonly server: "sft";
1486
+ readonly method: "sft";
1487
+ readonly variant: "full";
1488
+ };
1489
+ readonly "sft-lora": {
1490
+ readonly server: "efficient_sft";
1491
+ readonly method: "sft";
1492
+ readonly variant: "lora";
1493
+ };
1494
+ readonly dpo: {
1495
+ readonly server: "dpo_full";
1496
+ readonly method: "dpo";
1497
+ readonly variant: "full";
1498
+ };
1499
+ readonly "dpo-lora": {
1500
+ readonly server: "dpo_lora";
1501
+ readonly method: "dpo";
1502
+ readonly variant: "lora";
1503
+ };
1504
+ readonly cpt: {
1505
+ readonly server: "cpt";
1506
+ readonly method: "cpt";
1507
+ readonly variant: "full";
1508
+ };
1509
+ };
1510
+ type TrainingTypeCli = keyof typeof TRAINING_TYPE_MAP;
1511
+ /** All accepted CLI training-type values (for whitelisting / help text). */
1512
+ declare const TRAINING_TYPES_CLI: readonly TrainingTypeCli[];
1513
+ /** Default training type when `--training-type` is omitted. */
1514
+ declare const DEFAULT_TRAINING_TYPE: TrainingTypeCli;
1515
+ /** Subset of `supports` relevant to training capability. */
1516
+ interface ModelSupports {
1517
+ sft?: boolean;
1518
+ dpo?: boolean;
1519
+ cpt?: boolean;
1520
+ [key: string]: unknown;
1521
+ }
1522
+ /**
1523
+ * A model record's training-capability fields. The full listFoundationModels
1524
+ * item carries many more fields; only these are consulted here.
1525
+ */
1526
+ interface ModelCapability {
1527
+ model?: string;
1528
+ supports?: ModelSupports;
1529
+ trainingTypes?: Record<string, string[]>;
1530
+ [key: string]: unknown;
1531
+ }
1532
+ /** True when `value` is one of the accepted CLI training types. */
1533
+ declare function isTrainingTypeCli(value: string): value is TrainingTypeCli;
1534
+ /** Map a CLI training type to the server `training_type` for the request body. */
1535
+ declare function toServerTrainingType(value: TrainingTypeCli): string;
1536
+ /** The (method, variant) pair a CLI training type resolves to. */
1537
+ declare function trainingTypeMethodVariant(value: TrainingTypeCli): {
1538
+ method: string;
1539
+ variant: string;
1540
+ };
1541
+ /**
1542
+ * Whether a model supports the given CLI training type.
1543
+ *
1544
+ * A model supports `<method>[-lora]` when both:
1545
+ * 1. `supports.<method> === true` (the high-level capability gate), and
1546
+ * 2. `trainingTypes.<method>` includes the corresponding variant
1547
+ * (`full` for the bare name, `lora` for the `-lora` suffix).
1548
+ */
1549
+ declare function modelSupportsTrainingType(model: ModelCapability | undefined | null, value: TrainingTypeCli): boolean;
1550
+ /**
1551
+ * Every CLI training type a model supports, in canonical order
1552
+ * (sft, sft-lora, dpo, dpo-lora, cpt). Empty when the model carries no
1553
+ * capability metadata or supports none.
1554
+ */
1555
+ declare function listSupportedTrainingTypes(model: ModelCapability | undefined | null): TrainingTypeCli[];
1556
+ /**
1557
+ * Fetch a single model's foundation metadata by name (console gateway
1558
+ * `listFoundationModels` with a `name` filter). No console login required —
1559
+ * `listFoundationModels` is a public API, so only a DashScope API key is needed.
1560
+ *
1561
+ * Returns the first exact-model match, or `null` when nothing matches (the
1562
+ * server's `name` filter is a substring match, so we additionally require an
1563
+ * exact `model` equality to avoid e.g. `qwen3-8b` matching `qwen3-8b-v2`).
1564
+ */
1565
+ declare function fetchModelCapability(config: Config, modelName: string): Promise<ModelCapability | null>;
1566
+ //#endregion
1567
+ //#region src/finetune/preflight.d.ts
1568
+ /** Stable issue code for "too few training samples for the batch size". */
1569
+ declare const INSUFFICIENT_SAMPLES_CODE = "INSUFFICIENT_SAMPLES";
1570
+ interface BatchSizeGateInput {
1571
+ /**
1572
+ * Total training-sample count across all `--datasets` files. Sourced from
1573
+ * `validateDataset`'s `stats.totalRecords` (summed per file). The gate only
1574
+ * fires when this is known — i.e. every dataset token was a local file that
1575
+ * was validated; bare file-id tokens yield no count and fall through to the
1576
+ * platform.
1577
+ */
1578
+ recordCount: number;
1579
+ /**
1580
+ * Effective batch_size the job will run with — after the CLI's clamp
1581
+ * ([8, 1024]) and small-file auto-adjust, or the platform default (16) when
1582
+ * neither the user nor auto-adjust set one.
1583
+ */
1584
+ batchSize: number;
1585
+ }
1586
+ interface BatchSizeGateResult {
1587
+ ok: boolean;
1588
+ /** Present when `!ok`, in the same shape `validateDataset` issues use. */
1589
+ issue?: ValidationIssue;
1590
+ /** Actionable guidance; callers surface it as the `BailianError` detail. */
1591
+ hint?: string;
1592
+ }
1593
+ /**
1594
+ * Pre-flight the platform's "training samples must exceed batch_size" rule.
1595
+ *
1596
+ * The platform rejects a job whose number of training samples is not greater
1597
+ * than batch_size, but only surfaces that ~10 minutes into the run (after data
1598
+ * processing). This gate fails fast, before upload or quota consumption.
1599
+ *
1600
+ * Conservative by design — never false-positives: with the platform's default
1601
+ * 0.9 train split, training samples = 0.9 * recordCount <= recordCount, so
1602
+ * `recordCount <= batchSize` implies training samples <= batchSize implies
1603
+ * certain platform failure. Borderline counts (records just above batchSize)
1604
+ * may still fail on the platform; that's an acceptable false negative for a
1605
+ * pre-check, and the hint nudges users to leave margin for the split.
1606
+ */
1607
+ declare function preflightBatchSizeGate(input: BatchSizeGateInput): BatchSizeGateResult;
1608
+ //#endregion
1609
+ //#region src/deploy/types.d.ts
1610
+ /**
1611
+ * Model-deployment API types.
1612
+ *
1613
+ * Maps DashScope `/api/v1/deployments` request/response shapes (snake_case
1614
+ * preserved verbatim — callers decide how to surface fields).
1615
+ */
1616
+ /** A single deployment record as returned by the platform. */
1617
+ interface Deployment {
1618
+ /** Unique deployed-model identifier — used as the `model` parameter when invoking the deployed model. */
1619
+ deployed_model?: string;
1620
+ /** Human-friendly display name set at creation time. */
1621
+ name?: string;
1622
+ /** Underlying model identifier (e.g. fine-tuned output or catalog model). */
1623
+ model_name?: string;
1624
+ /** Catalog base model. */
1625
+ base_model?: string;
1626
+ /** PENDING | RUNNING | STOPPED | FAILED */
1627
+ status?: string;
1628
+ /** Billing plan: mu | cu | ptu | lora (Token-billed). */
1629
+ plan?: string;
1630
+ /** Spec descriptor for MU plan, e.g. "MU1". */
1631
+ model_unit_spec?: string;
1632
+ /** Charge type, e.g. "post_paid". */
1633
+ charge_type?: string;
1634
+ /** Capacity in plan units. */
1635
+ capacity?: number;
1636
+ base_capacity?: number;
1637
+ ready_capacity?: number;
1638
+ /** Rate limits (per minute). */
1639
+ rpm_limit?: number;
1640
+ tpm_limit?: number;
1641
+ /** PTU-only token-rate limits. */
1642
+ input_tpm?: number;
1643
+ output_tpm?: number;
1644
+ enable_thinking?: boolean;
1645
+ max_context_length?: number;
1646
+ workspace_id?: string;
1647
+ creator?: string;
1648
+ modifier?: string;
1649
+ gmt_create?: string;
1650
+ gmt_modified?: string;
1651
+ /** Free-form additional fields are preserved by callers. */
1652
+ [k: string]: unknown;
1653
+ }
1654
+ /** A single deployable model record (GET /deployments/models). */
1655
+ interface DeployableModel {
1656
+ model_name?: string;
1657
+ base_model?: string;
1658
+ /** custom | public | base | … */
1659
+ model_source?: string;
1660
+ /** Supported plans for `custom` (fine-tuned) models, e.g. ["mu","lora"]. */
1661
+ supported_plans?: string[];
1662
+ /**
1663
+ * Nested plan info for `base` (catalog) models. Each entry describes one
1664
+ * plan and (when applicable) its deployment templates.
1665
+ * - plan: "mu" | "ptu_v2" | "cu" | …
1666
+ * - templates: required when plan="mu" — picks deploy_spec / charge_type / role configs
1667
+ * - cu_specs: required when plan="cu" — light/basic etc
1668
+ */
1669
+ plans?: Array<{
1670
+ plan?: string;
1671
+ templates?: Array<DeployableTemplate>;
1672
+ cu_specs?: string[];
1673
+ [k: string]: unknown;
1674
+ }>;
1675
+ display_name?: string;
1676
+ description?: string;
1677
+ version?: string;
1678
+ status?: string;
1679
+ gmt_create?: string;
1680
+ gmt_modified?: string;
1681
+ [k: string]: unknown;
1682
+ }
1683
+ /** A single deployment template (only used by `plan=mu` base models). */
1684
+ interface DeployableTemplate {
1685
+ template_id?: string;
1686
+ template_name?: string;
1687
+ template_desc?: string;
1688
+ /** pre_paid | post_paid */
1689
+ charge_type?: string;
1690
+ /** SYSTEM | CUSTOM */
1691
+ template_source?: string;
1692
+ /** COUPLED | SEPERATED */
1693
+ template_type?: string;
1694
+ template_version?: string;
1695
+ deploy_spec?: string;
1696
+ /** Role-specific resource specs. Either `unified` (COUPLED) or `prefill` + `decode` (SEPERATED). */
1697
+ roles?: {
1698
+ unified?: {
1699
+ model_unit_spec?: string;
1700
+ capacity_unit_per_instance?: number;
1701
+ capacity_unit_init?: number;
1702
+ };
1703
+ prefill?: {
1704
+ model_unit_spec?: string;
1705
+ capacity_unit_per_instance?: number;
1706
+ capacity_unit_init?: number;
1707
+ };
1708
+ decode?: {
1709
+ model_unit_spec?: string;
1710
+ capacity_unit_per_instance?: number;
1711
+ capacity_unit_init?: number;
1712
+ };
1713
+ [k: string]: unknown;
1714
+ };
1715
+ [k: string]: unknown;
1716
+ }
1717
+ /** POST /api/v1/deployments request body. */
1718
+ interface CreateDeploymentRequest {
1719
+ /** Required. The catalog or fine-tuned model identifier. */
1720
+ model_name: string;
1721
+ /** Required. Display name shown in the console. */
1722
+ name: string;
1723
+ /** Required. Billing plan: mu | cu | ptu | lora. CLI defaults to "lora". */
1724
+ plan: string;
1725
+ /** Required by API even for token-billed (lora) plans where it is ignored — CLI injects 1. */
1726
+ capacity?: number;
1727
+ /** Optional template id for advanced configurations. */
1728
+ template_id?: string;
1729
+ /**
1730
+ * PTU capacity (provisioned throughput limits). Only effective when
1731
+ * `plan === "ptu"`. The doc says this defaults to 10000/1000 when omitted,
1732
+ * but the platform currently rejects creation without it ("Miss ptu capacity
1733
+ * info"), so the CLI treats it as required for ptu.
1734
+ */
1735
+ ptu_capacity?: PtuCapacity;
1736
+ /** Future-compat: arbitrary additional fields are forwarded as-is. */
1737
+ [k: string]: unknown;
1738
+ }
1739
+ /** PTU throughput limits — only used when `plan === "ptu"`. */
1740
+ interface PtuCapacity {
1741
+ /** Max input tokens per minute (all models). */
1742
+ input_tpm?: number;
1743
+ /** Max output tokens per minute (all models). */
1744
+ output_tpm?: number;
1745
+ /** Max thinking-output tokens per minute (some models only). */
1746
+ thinking_output_tpm?: number;
1747
+ }
1748
+ /** POST /api/v1/deployments response. */
1749
+ interface CreateDeploymentResponse {
1750
+ request_id?: string;
1751
+ output?: Deployment;
1752
+ data?: Deployment;
1753
+ }
1754
+ /** GET /api/v1/deployments response. */
1755
+ interface ListDeploymentsResponse {
1756
+ request_id?: string;
1757
+ output?: {
1758
+ deployments?: Deployment[];
1759
+ total?: number;
1760
+ page_no?: number;
1761
+ page_size?: number;
1762
+ [k: string]: unknown;
1763
+ };
1764
+ data?: {
1765
+ deployments?: Deployment[];
1766
+ total?: number;
1767
+ page_no?: number;
1768
+ page_size?: number;
1769
+ [k: string]: unknown;
1770
+ };
1771
+ }
1772
+ /** GET /api/v1/deployments/{deployed_model} response. */
1773
+ interface GetDeploymentResponse {
1774
+ request_id?: string;
1775
+ output?: Deployment;
1776
+ data?: Deployment;
1777
+ }
1778
+ /** DELETE /api/v1/deployments/{deployed_model} response. */
1779
+ interface DeleteDeploymentResponse {
1780
+ request_id?: string;
1781
+ output?: {
1782
+ deleted?: boolean;
1783
+ deployed_model?: string;
1784
+ [k: string]: unknown;
1785
+ };
1786
+ data?: {
1787
+ deleted?: boolean;
1788
+ deployed_model?: string;
1789
+ [k: string]: unknown;
1790
+ };
1791
+ }
1792
+ /** GET /api/v1/deployments/models response. */
1793
+ interface ListDeployableModelsResponse {
1794
+ request_id?: string;
1795
+ output?: {
1796
+ models?: DeployableModel[];
1797
+ total?: number;
1798
+ page_no?: number;
1799
+ page_size?: number;
1800
+ [k: string]: unknown;
1801
+ };
1802
+ data?: {
1803
+ models?: DeployableModel[];
1804
+ total?: number;
1805
+ page_no?: number;
1806
+ page_size?: number;
1807
+ [k: string]: unknown;
1808
+ };
1809
+ }
1810
+ /** PUT /api/v1/deployments/{deployed_model}/scale request body. */
1811
+ interface ScaleDeploymentRequest {
1812
+ /** New capacity in plan units. Server-side constraint: integer multiple of `base_capacity`, < 1000. */
1813
+ capacity?: number;
1814
+ /** PTU-only token-rate adjustments. */
1815
+ input_tpm?: number;
1816
+ output_tpm?: number;
1817
+ [k: string]: unknown;
1818
+ }
1819
+ /** PUT /api/v1/deployments/{deployed_model}/scale response. */
1820
+ interface ScaleDeploymentResponse {
1821
+ request_id?: string;
1822
+ output?: Deployment;
1823
+ data?: Deployment;
1824
+ }
1825
+ /**
1826
+ * PUT /api/v1/deployments/{deployed_model} request body.
1827
+ *
1828
+ * Update rate limits — at least one of `rpm_limit` / `tpm_limit` is required.
1829
+ * - rpm_limit: requests per minute
1830
+ * - tpm_limit: tokens per minute
1831
+ */
1832
+ interface UpdateDeploymentRequest {
1833
+ rpm_limit?: number;
1834
+ tpm_limit?: number;
1835
+ [k: string]: unknown;
1836
+ }
1837
+ /** PUT /api/v1/deployments/{deployed_model} response. */
1838
+ interface UpdateDeploymentResponse {
1839
+ request_id?: string;
1840
+ output?: Deployment;
1841
+ data?: Deployment;
1842
+ }
1843
+ //#endregion
1844
+ //#region src/deploy/api.d.ts
1845
+ /** POST /api/v1/deployments */
1846
+ declare function createDeployment(config: Config, body: CreateDeploymentRequest, signal?: AbortSignal): Promise<CreateDeploymentResponse>;
1847
+ interface ListDeploymentsParams {
1848
+ pageNo?: number;
1849
+ pageSize?: number;
1850
+ status?: string;
1851
+ signal?: AbortSignal;
1852
+ }
1853
+ /** GET /api/v1/deployments */
1854
+ declare function listDeployments(config: Config, params?: ListDeploymentsParams): Promise<ListDeploymentsResponse>;
1855
+ /** GET /api/v1/deployments/{deployed_model} */
1856
+ declare function getDeployment(config: Config, deployedModel: string, signal?: AbortSignal): Promise<GetDeploymentResponse>;
1857
+ /** DELETE /api/v1/deployments/{deployed_model} */
1858
+ declare function deleteDeployment(config: Config, deployedModel: string, signal?: AbortSignal): Promise<DeleteDeploymentResponse>;
1859
+ interface ListDeployableModelsParams {
1860
+ pageNo?: number;
1861
+ pageSize?: number;
1862
+ /** Catalog version filter, e.g. "v1.0". */
1863
+ version?: string;
1864
+ /** Source filter: "custom" (fine-tuned outputs) | "public" | …. */
1865
+ modelSource?: string;
1866
+ signal?: AbortSignal;
1867
+ }
1868
+ /** GET /api/v1/deployments/models */
1869
+ declare function listDeployableModels(config: Config, params?: ListDeployableModelsParams): Promise<ListDeployableModelsResponse>;
1870
+ /** PUT /api/v1/deployments/{deployed_model}/scale */
1871
+ declare function scaleDeployment(config: Config, deployedModel: string, body: ScaleDeploymentRequest, signal?: AbortSignal): Promise<ScaleDeploymentResponse>;
1872
+ /**
1873
+ * PUT /api/v1/deployments/{deployed_model}/update
1874
+ *
1875
+ * Update rate limits. At least one of `rpm_limit` / `tpm_limit` must be set.
1876
+ */
1877
+ declare function updateDeployment(config: Config, deployedModel: string, body: UpdateDeploymentRequest, signal?: AbortSignal): Promise<UpdateDeploymentResponse>;
1878
+ //#endregion
909
1879
  //#region src/types/command.d.ts
910
1880
  interface OptionDef {
911
1881
  flag: string;
@@ -914,21 +1884,32 @@ interface OptionDef {
914
1884
  required?: boolean;
915
1885
  }
916
1886
  interface Command {
917
- name: string;
918
1887
  description: string;
919
- usage?: string;
1888
+ /**
1889
+ * Argument portion of the usage line, WITHOUT the `<bin> <path>` prefix
1890
+ * (e.g. "--index-id <id> --query <text> [flags]"). The runtime prepends the
1891
+ * product binary name and the command's actual path when rendering help, so
1892
+ * the same command renders correctly under any product (bl / rag / …).
1893
+ */
1894
+ usageArgs?: string;
920
1895
  options?: OptionDef[];
921
- examples?: string[];
1896
+ /**
1897
+ * Example argument strings, each WITHOUT the `<bin> <path>` prefix
1898
+ * (e.g. '--index-id idx_xxx --query "..."'). The runtime prepends
1899
+ * `<bin> <path>` per product when rendering help.
1900
+ */
1901
+ exampleArgs?: string[];
922
1902
  skipDefaultApiKeySetup?: boolean;
923
1903
  notes?: string[];
924
1904
  execute: (config: Config, flags: GlobalFlags) => Promise<void>;
925
1905
  }
926
1906
  interface CommandSpec {
927
- name: string;
928
1907
  description: string;
929
- usage?: string;
1908
+ /** See {@link Command.usageArgs} — argument portion only, no `<bin> <path>` prefix. */
1909
+ usageArgs?: string;
930
1910
  options?: OptionDef[];
931
- examples?: string[];
1911
+ /** See {@link Command.exampleArgs} — argument strings only, no `<bin> <path>` prefix. */
1912
+ exampleArgs?: string[];
932
1913
  skipDefaultApiKeySetup?: boolean;
933
1914
  notes?: string[];
934
1915
  run: (config: Config, flags: GlobalFlags) => Promise<void>;
@@ -957,9 +1938,6 @@ declare function resolveOutputDir(config: Config, options?: {
957
1938
  subDir?: string;
958
1939
  }): string;
959
1940
  //#endregion
960
- //#region src/utils/schema.d.ts
961
- declare function generateToolSchema(cmd: Command): Record<string, unknown>;
962
- //#endregion
963
1941
  //#region src/utils/token.d.ts
964
1942
  declare function maskToken(token: string): string;
965
1943
  //#endregion
@@ -1251,4 +2229,4 @@ interface ModelSource {
1251
2229
  load(): Promise<ModelProfile[]>;
1252
2230
  }
1253
2231
  //#endregion
1254
- export { AkSignConfig, type ApiErrorBody, AppCompletionRequest, AppCompletionResponse, AppStreamChunk, AuthMethod, BAILIAN_HOST, BailianError, Budget, Budgets, CHANNEL, CONSOLE_GATEWAY_NO_TOKEN_MESSAGE, Capabilities, Capability, ChatChoice, ChatMessage, ChatMessageContent, ChatRequest, ChatResponse, ChatTool, Command, CommandSpec, Complexities, Complexity, Config, ConfigFile, ConsoleGatewayRequest, ConsoleSite, ContextNeed, ContextNeeds, DOCS_HOSTS, DashScopeASRRequest, DashScopeASRTaskResult, DashScopeAsyncResponse, DashScopeImageRequest, DashScopeImageSyncResponse, DashScopeKnowledgeRetrieveRequest, DashScopeKnowledgeRetrieveResponse, DashScopeTTSRequest, DashScopeTTSResponse, DashScopeTTSStreamChunk, DashScopeTaskResponse, DashScopeVideoEditRequest, DashScopeVideoRefRequest, DashScopeVideoRequest, ExitCode, Feature, Features, GLOBAL_OPTIONS, GetModelsOptions, GlobalFlags, IntentProfile, IntentSegment, KnowledgeRetrieveRequest, KnowledgeRetrieveResponse, McpClient, McpTool, McpToolResult, MemoryAddRequest, MemoryAddResponse, MemoryMessage, MemoryNode, MemoryNodeListResponse, MemoryNodeUpdateRequest, MemorySearchRequest, MemorySearchResponse, Modalities, Modality, ModelCategories, ModelCategory, ModelListParams, ModelListResult, ModelPreference, ModelPrice, ModelProfile, ModelSource, OptionDef, OutputFormat, PipelineResult, PipelineStep, PreferenceMode, ProfileAttribute, ProfileSchemaCreateRequest, ProfileSchemaCreateResponse, QpmLimit, QualityPreference, QualityPreferences, REGIONS, RecommendOptions, RecommendResult, RecommendedModel, Region, RequestOpts, ResolvedCredential, SOURCE_CONFIG, ScoredCandidate, ServerSentEvent, SingleResult, StreamChoice, StreamChunk, TAGS, TrackingEvent, UserProfileResponse, analyzeIntent, appCompletionEndpoint, bailianMcpUrl, buildDocLink, callConsoleGateway, chatEndpoint, clearApiKey, createTrackingEvent, defineCommand, detectOutputFormat, effectiveConsoleGatewayConfig, ensureConfigDir, fetchModelList, flushTelemetry, formatErrorJson, formatJson, formatOutput, formatText, generateFilename, generateToolSchema, getConfigDir, getConfigPath, getCredentialsPath, getModels, imageEndpoint, imageSyncEndpoint, isCI, isInteractive, isLocalFile, isSemanticAvailable, knowledgeRetrieveEndpoint, loadApiKeyFromConfig, loadConfig, localSink, mapApiError, maskToken, mcpWebSearchEndpoint, memoryAddEndpoint, memoryListEndpoint, memoryNodeEndpoint, memorySearchEndpoint, parseBooleanValue, parseConfigFile, parseOptionalBooleanValue, parseSSE, profileSchemaEndpoint, rankModels, readConfigFile, recallCandidates, recallSemantic, remoteSink, request, requestJson, resolveBooleanFlag, resolveConsoleGatewayCredential, resolveCredential, resolveFileUrl, resolveOutputDir, resolveWatermark, saveApiKeyToConfig, signRequest, speechRecognizeEndpoint, speechSynthesizeEndpoint, stripUndefined, taskEndpoint, trackCommandExecution, trackingHeaders, uploadFile, userProfileEndpoint, videoGenerateEndpoint, writeConfigFile };
2232
+ export { AkSignConfig, type ApiErrorBody, AppCompletionRequest, AppCompletionResponse, AppStreamChunk, AuthMethod, BAILIAN_HOST, BailianError, BatchSizeGateInput, BatchSizeGateResult, Budget, Budgets, CHANNEL, CONSOLE_GATEWAY_NO_TOKEN_MESSAGE, CancelFineTuneResponse, Capabilities, Capability, ChatChoice, ChatMessage, ChatMessageContent, ChatRequest, ChatResponse, ChatTool, Command, CommandSpec, Complexities, Complexity, Config, ConfigFile, ConsoleGatewayRequest, ConsoleSite, ContextNeed, ContextNeeds, CreateDeploymentRequest, CreateDeploymentResponse, CreateFineTuneRequest, CreateFineTuneResponse, DEFAULT_TRAINING_TYPE, DOCS_HOSTS, DashScopeASRRequest, DashScopeASRTaskResult, DashScopeAsyncResponse, DashScopeImageRequest, DashScopeImageSyncResponse, DashScopeKnowledgeRetrieveRequest, DashScopeKnowledgeRetrieveResponse, DashScopeTTSRequest, DashScopeTTSResponse, DashScopeTTSStreamChunk, DashScopeTaskResponse, DashScopeVideoEditRequest, DashScopeVideoRefRequest, DashScopeVideoRequest, DatasetDeleteResponse, DatasetFile, DatasetGetResponse, DatasetListParams, DatasetListResponse, DatasetSchema, DatasetUploadParams, DatasetUploadResponse, DeleteDeploymentResponse, DeleteFineTuneResponse, DeployableModel, DeployableTemplate, Deployment, ExitCode, ExportCheckpointResponse, Feature, Features, FineTuneCheckpoint, FineTuneHyperParameters, FineTuneJob, FineTuneLogEntry, GLOBAL_OPTIONS, GetDeploymentResponse, GetFineTuneLogsParams, GetFineTuneLogsResponse, GetFineTuneResponse, GetModelsOptions, GlobalFlags, INSUFFICIENT_SAMPLES_CODE, IntentProfile, IntentSegment, KnowledgeChatContentPart, KnowledgeChatMessage, KnowledgeChatRequest, KnowledgeChatStreamChunk, KnowledgeRetrieveRequest, KnowledgeRetrieveResponse, KnowledgeSearchRequest, KnowledgeSearchResponse, ListCheckpointsResponse, ListDeployableModelsParams, ListDeployableModelsResponse, ListDeploymentsParams, ListDeploymentsResponse, ListFineTunesParams, ListFineTunesResponse, MAX_DATASET_BYTES, McpClient, McpTool, McpToolResult, MemoryAddRequest, MemoryAddResponse, MemoryMessage, MemoryNode, MemoryNodeListResponse, MemoryNodeUpdateRequest, MemorySearchRequest, MemorySearchResponse, Modalities, Modality, ModelCapability, ModelCategories, ModelCategory, ModelListParams, ModelListResult, ModelPreference, ModelPrice, ModelProfile, ModelSource, OptionDef, OutputFormat, PipelineResult, PipelineStep, PreferenceMode, ProfileAttribute, ProfileSchemaCreateRequest, ProfileSchemaCreateResponse, PtuCapacity, QpmLimit, QualityPreference, QualityPreferences, REGIONS, RecommendOptions, RecommendResult, RecommendedModel, Region, RequestOpts, ResolvedCredential, SOURCE_CONFIG, ScaleDeploymentRequest, ScaleDeploymentResponse, ScoredCandidate, ServerSentEvent, SingleResult, StreamChoice, StreamChunk, TAGS, TRAINING_TYPES_CLI, TRAINING_TYPE_MAP, TrackingEvent, TrainingTypeCli, UpdateDeploymentRequest, UpdateDeploymentResponse, UserProfileResponse, ValidateOpts, ValidationIssue, ValidationResult, ValidationSeverity, ValidationStats, ValidatorSpec, analyzeIntent, appCompletionEndpoint, bailianMcpUrl, buildDocLink, callConsoleGateway, cancelFineTune, chatEndpoint, clearApiKey, createDeployment, createFineTune, createTrackingEvent, defineCommand, deleteDataset, deleteDeployment, deleteFineTune, detectOutputFormat, effectiveConsoleGatewayConfig, ensureConfigDir, exportCheckpoint, fetchModelCapability, fetchModelList, flushTelemetry, formatErrorJson, formatIssue, formatJson, formatOutput, formatText, generateFilename, getConfigDir, getConfigPath, getCredentialsPath, getDataset, getDeployment, getFineTune, getFineTuneLogs, getModels, imageEndpoint, imageSyncEndpoint, isCI, isInteractive, isLocalFile, isSemanticAvailable, isTrainingTypeCli, knowledgeChatEndpoint, knowledgeRetrieveEndpoint, knowledgeSearchEndpoint, listCheckpoints, listDatasets, listDeployableModels, listDeployments, listFineTunes, listSupportedFormats, listSupportedTrainingTypes, loadApiKeyFromConfig, loadConfig, localSink, mapApiError, maskToken, mcpWebSearchEndpoint, memoryAddEndpoint, memoryListEndpoint, memoryNodeEndpoint, memorySearchEndpoint, modelSupportsTrainingType, parseBooleanValue, parseConfigFile, parseDatasetSchemaFlag, parseOptionalBooleanValue, parseSSE, pickValidator, preflightBatchSizeGate, profileSchemaEndpoint, rankModels, readConfigFile, recallCandidates, recallSemantic, registerValidator, remoteSink, request, requestJson, resolveBooleanFlag, resolveConsoleGatewayCredential, resolveCredential, resolveFileUrl, resolveOutputDir, resolveWatermark, saveApiKeyToConfig, scaleDeployment, signRequest, speechRecognizeEndpoint, speechSynthesizeEndpoint, stripUndefined, taskEndpoint, toServerTrainingType, trackCommandExecution, trackingHeaders, trainingTypeMethodVariant, updateDeployment, uploadDataset, uploadFile, userProfileEndpoint, validateDataset, videoGenerateEndpoint, writeConfigFile };