@easbot/local-model-sdk 0.3.28 → 0.3.29
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.en.md +1 -1
- package/README.md +1 -1
- package/dist/index.cjs +26 -26
- package/dist/index.d.cts +1145 -25
- package/dist/index.d.ts +1145 -25
- package/dist/index.mjs +26 -26
- package/package.json +6 -5
package/dist/index.d.cts
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import { LanguageModelV3StreamPart, LanguageModelV3GenerateResult, LanguageModelV3, LanguageModelV3FinishReason, EmbeddingModelV3, RerankingModelV3, LanguageModelV3CallOptions, LanguageModelV3StreamResult, EmbeddingModelV3CallOptions, EmbeddingModelV3Result, RerankingModelV3CallOptions, SharedV3ProviderMetadata, SharedV3Warning, SharedV3Headers } from '@ai-sdk/provider';
|
|
2
2
|
import { PipelineType } from '@huggingface/transformers';
|
|
3
3
|
export { PipelineType } from '@huggingface/transformers';
|
|
4
|
+
import z from 'zod';
|
|
5
|
+
import { NamedError } from '@easbot/utils';
|
|
4
6
|
|
|
5
|
-
declare enum ErrorCode {
|
|
6
|
-
MODEL_NOT_FOUND = "MODEL_NOT_FOUND",
|
|
7
|
-
MODEL_LOAD_ERROR = "MODEL_LOAD_ERROR",
|
|
8
|
-
MODEL_NOT_INITIALIZED = "MODEL_NOT_INITIALIZED",
|
|
9
|
-
GENERATION_ERROR = "GENERATION_ERROR",
|
|
10
|
-
EMBEDDING_ERROR = "EMBEDDING_ERROR",
|
|
11
|
-
INVALID_INPUT = "INVALID_INPUT",
|
|
12
|
-
UNSUPPORTED_FEATURE = "UNSUPPORTED_FEATURE",
|
|
13
|
-
CACHE_ERROR = "CACHE_ERROR",
|
|
14
|
-
PROCESSING_ERROR = "PROCESSING_ERROR",
|
|
15
|
-
ABORTED = "ABORTED",
|
|
16
|
-
OUT_OF_MEMORY = "OUT_OF_MEMORY",
|
|
17
|
-
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
18
|
-
}
|
|
19
7
|
interface ModelCacheConfig {
|
|
20
8
|
cacheDir?: string;
|
|
21
9
|
}
|
|
@@ -270,22 +258,1154 @@ declare class LLMRerankingModel implements RerankingModelV3 {
|
|
|
270
258
|
private parseRerankResult;
|
|
271
259
|
}
|
|
272
260
|
|
|
273
|
-
declare
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
261
|
+
declare namespace LocalModelErrors {
|
|
262
|
+
const NamedError: typeof NamedError;
|
|
263
|
+
const ModelNotFoundError: {
|
|
264
|
+
new (data: {
|
|
265
|
+
message: string;
|
|
266
|
+
modelId?: string | undefined;
|
|
267
|
+
huggingFaceId?: string | undefined;
|
|
268
|
+
}, options?: ErrorOptions): {
|
|
269
|
+
readonly name: "LocalModelNotFoundError";
|
|
270
|
+
readonly data: {
|
|
271
|
+
message: string;
|
|
272
|
+
modelId?: string | undefined;
|
|
273
|
+
huggingFaceId?: string | undefined;
|
|
274
|
+
};
|
|
275
|
+
schema(): z.ZodObject<{
|
|
276
|
+
name: z.ZodLiteral<"LocalModelNotFoundError">;
|
|
277
|
+
data: z.ZodObject<{
|
|
278
|
+
message: z.ZodString;
|
|
279
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
280
|
+
huggingFaceId: z.ZodOptional<z.ZodString>;
|
|
281
|
+
}, z.core.$strip>;
|
|
282
|
+
}, z.core.$strip>;
|
|
283
|
+
toObject(): {
|
|
284
|
+
name: "LocalModelNotFoundError";
|
|
285
|
+
data: {
|
|
286
|
+
message: string;
|
|
287
|
+
modelId?: string | undefined;
|
|
288
|
+
huggingFaceId?: string | undefined;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
message: string;
|
|
292
|
+
stack?: string;
|
|
293
|
+
cause?: unknown;
|
|
294
|
+
};
|
|
295
|
+
readonly Schema: z.ZodObject<{
|
|
296
|
+
name: z.ZodLiteral<"LocalModelNotFoundError">;
|
|
297
|
+
data: z.ZodObject<{
|
|
298
|
+
message: z.ZodString;
|
|
299
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
300
|
+
huggingFaceId: z.ZodOptional<z.ZodString>;
|
|
301
|
+
}, z.core.$strip>;
|
|
302
|
+
}, z.core.$strip>;
|
|
303
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
304
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
305
|
+
readonly Unknown: {
|
|
306
|
+
new (data: {
|
|
307
|
+
message: string;
|
|
308
|
+
}, options?: ErrorOptions): {
|
|
309
|
+
readonly name: "UnknownError";
|
|
310
|
+
readonly data: {
|
|
311
|
+
message: string;
|
|
312
|
+
};
|
|
313
|
+
schema(): z.ZodObject<{
|
|
314
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
315
|
+
data: z.ZodObject<{
|
|
316
|
+
message: z.ZodString;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
toObject(): {
|
|
320
|
+
name: "UnknownError";
|
|
321
|
+
data: {
|
|
322
|
+
message: string;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
message: string;
|
|
326
|
+
stack?: string;
|
|
327
|
+
cause?: unknown;
|
|
328
|
+
};
|
|
329
|
+
readonly Schema: z.ZodObject<{
|
|
330
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
331
|
+
data: z.ZodObject<{
|
|
332
|
+
message: z.ZodString;
|
|
333
|
+
}, z.core.$strip>;
|
|
334
|
+
}, z.core.$strip>;
|
|
335
|
+
isInstance(input: any): input is {
|
|
336
|
+
readonly name: "UnknownError";
|
|
337
|
+
readonly data: {
|
|
338
|
+
message: string;
|
|
339
|
+
};
|
|
340
|
+
schema(): z.ZodObject<{
|
|
341
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
342
|
+
data: z.ZodObject<{
|
|
343
|
+
message: z.ZodString;
|
|
344
|
+
}, z.core.$strip>;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
toObject(): {
|
|
347
|
+
name: "UnknownError";
|
|
348
|
+
data: {
|
|
349
|
+
message: string;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
message: string;
|
|
353
|
+
stack?: string;
|
|
354
|
+
cause?: unknown;
|
|
355
|
+
};
|
|
356
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
357
|
+
readonly Unknown: any;
|
|
358
|
+
isError(error: unknown): error is Error;
|
|
359
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
360
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
361
|
+
stackTraceLimit: number;
|
|
362
|
+
};
|
|
363
|
+
isError(error: unknown): error is Error;
|
|
364
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
365
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
366
|
+
stackTraceLimit: number;
|
|
367
|
+
};
|
|
368
|
+
const ModelLoadError: {
|
|
369
|
+
new (data: {
|
|
370
|
+
message: string;
|
|
371
|
+
modelId?: string | undefined;
|
|
372
|
+
huggingFaceId?: string | undefined;
|
|
373
|
+
}, options?: ErrorOptions): {
|
|
374
|
+
readonly name: "LocalModelLoadError";
|
|
375
|
+
readonly data: {
|
|
376
|
+
message: string;
|
|
377
|
+
modelId?: string | undefined;
|
|
378
|
+
huggingFaceId?: string | undefined;
|
|
379
|
+
};
|
|
380
|
+
schema(): z.ZodObject<{
|
|
381
|
+
name: z.ZodLiteral<"LocalModelLoadError">;
|
|
382
|
+
data: z.ZodObject<{
|
|
383
|
+
message: z.ZodString;
|
|
384
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
385
|
+
huggingFaceId: z.ZodOptional<z.ZodString>;
|
|
386
|
+
}, z.core.$strip>;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
toObject(): {
|
|
389
|
+
name: "LocalModelLoadError";
|
|
390
|
+
data: {
|
|
391
|
+
message: string;
|
|
392
|
+
modelId?: string | undefined;
|
|
393
|
+
huggingFaceId?: string | undefined;
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
message: string;
|
|
397
|
+
stack?: string;
|
|
398
|
+
cause?: unknown;
|
|
399
|
+
};
|
|
400
|
+
readonly Schema: z.ZodObject<{
|
|
401
|
+
name: z.ZodLiteral<"LocalModelLoadError">;
|
|
402
|
+
data: z.ZodObject<{
|
|
403
|
+
message: z.ZodString;
|
|
404
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
405
|
+
huggingFaceId: z.ZodOptional<z.ZodString>;
|
|
406
|
+
}, z.core.$strip>;
|
|
407
|
+
}, z.core.$strip>;
|
|
408
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
409
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
410
|
+
readonly Unknown: {
|
|
411
|
+
new (data: {
|
|
412
|
+
message: string;
|
|
413
|
+
}, options?: ErrorOptions): {
|
|
414
|
+
readonly name: "UnknownError";
|
|
415
|
+
readonly data: {
|
|
416
|
+
message: string;
|
|
417
|
+
};
|
|
418
|
+
schema(): z.ZodObject<{
|
|
419
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
420
|
+
data: z.ZodObject<{
|
|
421
|
+
message: z.ZodString;
|
|
422
|
+
}, z.core.$strip>;
|
|
423
|
+
}, z.core.$strip>;
|
|
424
|
+
toObject(): {
|
|
425
|
+
name: "UnknownError";
|
|
426
|
+
data: {
|
|
427
|
+
message: string;
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
message: string;
|
|
431
|
+
stack?: string;
|
|
432
|
+
cause?: unknown;
|
|
433
|
+
};
|
|
434
|
+
readonly Schema: z.ZodObject<{
|
|
435
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
436
|
+
data: z.ZodObject<{
|
|
437
|
+
message: z.ZodString;
|
|
438
|
+
}, z.core.$strip>;
|
|
439
|
+
}, z.core.$strip>;
|
|
440
|
+
isInstance(input: any): input is {
|
|
441
|
+
readonly name: "UnknownError";
|
|
442
|
+
readonly data: {
|
|
443
|
+
message: string;
|
|
444
|
+
};
|
|
445
|
+
schema(): z.ZodObject<{
|
|
446
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
447
|
+
data: z.ZodObject<{
|
|
448
|
+
message: z.ZodString;
|
|
449
|
+
}, z.core.$strip>;
|
|
450
|
+
}, z.core.$strip>;
|
|
451
|
+
toObject(): {
|
|
452
|
+
name: "UnknownError";
|
|
453
|
+
data: {
|
|
454
|
+
message: string;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
message: string;
|
|
458
|
+
stack?: string;
|
|
459
|
+
cause?: unknown;
|
|
460
|
+
};
|
|
461
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
462
|
+
readonly Unknown: any;
|
|
463
|
+
isError(error: unknown): error is Error;
|
|
464
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
465
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
466
|
+
stackTraceLimit: number;
|
|
467
|
+
};
|
|
468
|
+
isError(error: unknown): error is Error;
|
|
469
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
470
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
471
|
+
stackTraceLimit: number;
|
|
472
|
+
};
|
|
473
|
+
const ModelNotInitializedError: {
|
|
474
|
+
new (data: {
|
|
475
|
+
message: string;
|
|
476
|
+
modelId?: string | undefined;
|
|
477
|
+
}, options?: ErrorOptions): {
|
|
478
|
+
readonly name: "LocalModelNotInitializedError";
|
|
479
|
+
readonly data: {
|
|
480
|
+
message: string;
|
|
481
|
+
modelId?: string | undefined;
|
|
482
|
+
};
|
|
483
|
+
schema(): z.ZodObject<{
|
|
484
|
+
name: z.ZodLiteral<"LocalModelNotInitializedError">;
|
|
485
|
+
data: z.ZodObject<{
|
|
486
|
+
message: z.ZodString;
|
|
487
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
488
|
+
}, z.core.$strip>;
|
|
489
|
+
}, z.core.$strip>;
|
|
490
|
+
toObject(): {
|
|
491
|
+
name: "LocalModelNotInitializedError";
|
|
492
|
+
data: {
|
|
493
|
+
message: string;
|
|
494
|
+
modelId?: string | undefined;
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
message: string;
|
|
498
|
+
stack?: string;
|
|
499
|
+
cause?: unknown;
|
|
500
|
+
};
|
|
501
|
+
readonly Schema: z.ZodObject<{
|
|
502
|
+
name: z.ZodLiteral<"LocalModelNotInitializedError">;
|
|
503
|
+
data: z.ZodObject<{
|
|
504
|
+
message: z.ZodString;
|
|
505
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
506
|
+
}, z.core.$strip>;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
509
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
510
|
+
readonly Unknown: {
|
|
511
|
+
new (data: {
|
|
512
|
+
message: string;
|
|
513
|
+
}, options?: ErrorOptions): {
|
|
514
|
+
readonly name: "UnknownError";
|
|
515
|
+
readonly data: {
|
|
516
|
+
message: string;
|
|
517
|
+
};
|
|
518
|
+
schema(): z.ZodObject<{
|
|
519
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
520
|
+
data: z.ZodObject<{
|
|
521
|
+
message: z.ZodString;
|
|
522
|
+
}, z.core.$strip>;
|
|
523
|
+
}, z.core.$strip>;
|
|
524
|
+
toObject(): {
|
|
525
|
+
name: "UnknownError";
|
|
526
|
+
data: {
|
|
527
|
+
message: string;
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
message: string;
|
|
531
|
+
stack?: string;
|
|
532
|
+
cause?: unknown;
|
|
533
|
+
};
|
|
534
|
+
readonly Schema: z.ZodObject<{
|
|
535
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
536
|
+
data: z.ZodObject<{
|
|
537
|
+
message: z.ZodString;
|
|
538
|
+
}, z.core.$strip>;
|
|
539
|
+
}, z.core.$strip>;
|
|
540
|
+
isInstance(input: any): input is {
|
|
541
|
+
readonly name: "UnknownError";
|
|
542
|
+
readonly data: {
|
|
543
|
+
message: string;
|
|
544
|
+
};
|
|
545
|
+
schema(): z.ZodObject<{
|
|
546
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
547
|
+
data: z.ZodObject<{
|
|
548
|
+
message: z.ZodString;
|
|
549
|
+
}, z.core.$strip>;
|
|
550
|
+
}, z.core.$strip>;
|
|
551
|
+
toObject(): {
|
|
552
|
+
name: "UnknownError";
|
|
553
|
+
data: {
|
|
554
|
+
message: string;
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
message: string;
|
|
558
|
+
stack?: string;
|
|
559
|
+
cause?: unknown;
|
|
560
|
+
};
|
|
561
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
562
|
+
readonly Unknown: any;
|
|
563
|
+
isError(error: unknown): error is Error;
|
|
564
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
565
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
566
|
+
stackTraceLimit: number;
|
|
567
|
+
};
|
|
568
|
+
isError(error: unknown): error is Error;
|
|
569
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
570
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
571
|
+
stackTraceLimit: number;
|
|
572
|
+
};
|
|
573
|
+
const GenerationError: {
|
|
574
|
+
new (data: {
|
|
575
|
+
message: string;
|
|
576
|
+
modelId?: string | undefined;
|
|
577
|
+
}, options?: ErrorOptions): {
|
|
578
|
+
readonly name: "LocalGenerationError";
|
|
579
|
+
readonly data: {
|
|
580
|
+
message: string;
|
|
581
|
+
modelId?: string | undefined;
|
|
582
|
+
};
|
|
583
|
+
schema(): z.ZodObject<{
|
|
584
|
+
name: z.ZodLiteral<"LocalGenerationError">;
|
|
585
|
+
data: z.ZodObject<{
|
|
586
|
+
message: z.ZodString;
|
|
587
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
588
|
+
}, z.core.$strip>;
|
|
589
|
+
}, z.core.$strip>;
|
|
590
|
+
toObject(): {
|
|
591
|
+
name: "LocalGenerationError";
|
|
592
|
+
data: {
|
|
593
|
+
message: string;
|
|
594
|
+
modelId?: string | undefined;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
message: string;
|
|
598
|
+
stack?: string;
|
|
599
|
+
cause?: unknown;
|
|
600
|
+
};
|
|
601
|
+
readonly Schema: z.ZodObject<{
|
|
602
|
+
name: z.ZodLiteral<"LocalGenerationError">;
|
|
603
|
+
data: z.ZodObject<{
|
|
604
|
+
message: z.ZodString;
|
|
605
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
606
|
+
}, z.core.$strip>;
|
|
607
|
+
}, z.core.$strip>;
|
|
608
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
609
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
610
|
+
readonly Unknown: {
|
|
611
|
+
new (data: {
|
|
612
|
+
message: string;
|
|
613
|
+
}, options?: ErrorOptions): {
|
|
614
|
+
readonly name: "UnknownError";
|
|
615
|
+
readonly data: {
|
|
616
|
+
message: string;
|
|
617
|
+
};
|
|
618
|
+
schema(): z.ZodObject<{
|
|
619
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
620
|
+
data: z.ZodObject<{
|
|
621
|
+
message: z.ZodString;
|
|
622
|
+
}, z.core.$strip>;
|
|
623
|
+
}, z.core.$strip>;
|
|
624
|
+
toObject(): {
|
|
625
|
+
name: "UnknownError";
|
|
626
|
+
data: {
|
|
627
|
+
message: string;
|
|
628
|
+
};
|
|
629
|
+
};
|
|
630
|
+
message: string;
|
|
631
|
+
stack?: string;
|
|
632
|
+
cause?: unknown;
|
|
633
|
+
};
|
|
634
|
+
readonly Schema: z.ZodObject<{
|
|
635
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
636
|
+
data: z.ZodObject<{
|
|
637
|
+
message: z.ZodString;
|
|
638
|
+
}, z.core.$strip>;
|
|
639
|
+
}, z.core.$strip>;
|
|
640
|
+
isInstance(input: any): input is {
|
|
641
|
+
readonly name: "UnknownError";
|
|
642
|
+
readonly data: {
|
|
643
|
+
message: string;
|
|
644
|
+
};
|
|
645
|
+
schema(): z.ZodObject<{
|
|
646
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
647
|
+
data: z.ZodObject<{
|
|
648
|
+
message: z.ZodString;
|
|
649
|
+
}, z.core.$strip>;
|
|
650
|
+
}, z.core.$strip>;
|
|
651
|
+
toObject(): {
|
|
652
|
+
name: "UnknownError";
|
|
653
|
+
data: {
|
|
654
|
+
message: string;
|
|
655
|
+
};
|
|
656
|
+
};
|
|
657
|
+
message: string;
|
|
658
|
+
stack?: string;
|
|
659
|
+
cause?: unknown;
|
|
660
|
+
};
|
|
661
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
662
|
+
readonly Unknown: any;
|
|
663
|
+
isError(error: unknown): error is Error;
|
|
664
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
665
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
666
|
+
stackTraceLimit: number;
|
|
667
|
+
};
|
|
668
|
+
isError(error: unknown): error is Error;
|
|
669
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
670
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
671
|
+
stackTraceLimit: number;
|
|
672
|
+
};
|
|
673
|
+
const EmbeddingError: {
|
|
674
|
+
new (data: {
|
|
675
|
+
message: string;
|
|
676
|
+
modelId?: string | undefined;
|
|
677
|
+
}, options?: ErrorOptions): {
|
|
678
|
+
readonly name: "LocalEmbeddingError";
|
|
679
|
+
readonly data: {
|
|
680
|
+
message: string;
|
|
681
|
+
modelId?: string | undefined;
|
|
682
|
+
};
|
|
683
|
+
schema(): z.ZodObject<{
|
|
684
|
+
name: z.ZodLiteral<"LocalEmbeddingError">;
|
|
685
|
+
data: z.ZodObject<{
|
|
686
|
+
message: z.ZodString;
|
|
687
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
688
|
+
}, z.core.$strip>;
|
|
689
|
+
}, z.core.$strip>;
|
|
690
|
+
toObject(): {
|
|
691
|
+
name: "LocalEmbeddingError";
|
|
692
|
+
data: {
|
|
693
|
+
message: string;
|
|
694
|
+
modelId?: string | undefined;
|
|
695
|
+
};
|
|
696
|
+
};
|
|
697
|
+
message: string;
|
|
698
|
+
stack?: string;
|
|
699
|
+
cause?: unknown;
|
|
700
|
+
};
|
|
701
|
+
readonly Schema: z.ZodObject<{
|
|
702
|
+
name: z.ZodLiteral<"LocalEmbeddingError">;
|
|
703
|
+
data: z.ZodObject<{
|
|
704
|
+
message: z.ZodString;
|
|
705
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
706
|
+
}, z.core.$strip>;
|
|
707
|
+
}, z.core.$strip>;
|
|
708
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
709
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
710
|
+
readonly Unknown: {
|
|
711
|
+
new (data: {
|
|
712
|
+
message: string;
|
|
713
|
+
}, options?: ErrorOptions): {
|
|
714
|
+
readonly name: "UnknownError";
|
|
715
|
+
readonly data: {
|
|
716
|
+
message: string;
|
|
717
|
+
};
|
|
718
|
+
schema(): z.ZodObject<{
|
|
719
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
720
|
+
data: z.ZodObject<{
|
|
721
|
+
message: z.ZodString;
|
|
722
|
+
}, z.core.$strip>;
|
|
723
|
+
}, z.core.$strip>;
|
|
724
|
+
toObject(): {
|
|
725
|
+
name: "UnknownError";
|
|
726
|
+
data: {
|
|
727
|
+
message: string;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
message: string;
|
|
731
|
+
stack?: string;
|
|
732
|
+
cause?: unknown;
|
|
733
|
+
};
|
|
734
|
+
readonly Schema: z.ZodObject<{
|
|
735
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
736
|
+
data: z.ZodObject<{
|
|
737
|
+
message: z.ZodString;
|
|
738
|
+
}, z.core.$strip>;
|
|
739
|
+
}, z.core.$strip>;
|
|
740
|
+
isInstance(input: any): input is {
|
|
741
|
+
readonly name: "UnknownError";
|
|
742
|
+
readonly data: {
|
|
743
|
+
message: string;
|
|
744
|
+
};
|
|
745
|
+
schema(): z.ZodObject<{
|
|
746
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
747
|
+
data: z.ZodObject<{
|
|
748
|
+
message: z.ZodString;
|
|
749
|
+
}, z.core.$strip>;
|
|
750
|
+
}, z.core.$strip>;
|
|
751
|
+
toObject(): {
|
|
752
|
+
name: "UnknownError";
|
|
753
|
+
data: {
|
|
754
|
+
message: string;
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
message: string;
|
|
758
|
+
stack?: string;
|
|
759
|
+
cause?: unknown;
|
|
760
|
+
};
|
|
761
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
762
|
+
readonly Unknown: any;
|
|
763
|
+
isError(error: unknown): error is Error;
|
|
764
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
765
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
766
|
+
stackTraceLimit: number;
|
|
767
|
+
};
|
|
768
|
+
isError(error: unknown): error is Error;
|
|
769
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
770
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
771
|
+
stackTraceLimit: number;
|
|
772
|
+
};
|
|
773
|
+
const ProcessingError: {
|
|
774
|
+
new (data: {
|
|
775
|
+
message: string;
|
|
776
|
+
operation?: string | undefined;
|
|
777
|
+
}, options?: ErrorOptions): {
|
|
778
|
+
readonly name: "LocalProcessingError";
|
|
779
|
+
readonly data: {
|
|
780
|
+
message: string;
|
|
781
|
+
operation?: string | undefined;
|
|
782
|
+
};
|
|
783
|
+
schema(): z.ZodObject<{
|
|
784
|
+
name: z.ZodLiteral<"LocalProcessingError">;
|
|
785
|
+
data: z.ZodObject<{
|
|
786
|
+
message: z.ZodString;
|
|
787
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
788
|
+
}, z.core.$strip>;
|
|
789
|
+
}, z.core.$strip>;
|
|
790
|
+
toObject(): {
|
|
791
|
+
name: "LocalProcessingError";
|
|
792
|
+
data: {
|
|
793
|
+
message: string;
|
|
794
|
+
operation?: string | undefined;
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
message: string;
|
|
798
|
+
stack?: string;
|
|
799
|
+
cause?: unknown;
|
|
800
|
+
};
|
|
801
|
+
readonly Schema: z.ZodObject<{
|
|
802
|
+
name: z.ZodLiteral<"LocalProcessingError">;
|
|
803
|
+
data: z.ZodObject<{
|
|
804
|
+
message: z.ZodString;
|
|
805
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
806
|
+
}, z.core.$strip>;
|
|
807
|
+
}, z.core.$strip>;
|
|
808
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
809
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
810
|
+
readonly Unknown: {
|
|
811
|
+
new (data: {
|
|
812
|
+
message: string;
|
|
813
|
+
}, options?: ErrorOptions): {
|
|
814
|
+
readonly name: "UnknownError";
|
|
815
|
+
readonly data: {
|
|
816
|
+
message: string;
|
|
817
|
+
};
|
|
818
|
+
schema(): z.ZodObject<{
|
|
819
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
820
|
+
data: z.ZodObject<{
|
|
821
|
+
message: z.ZodString;
|
|
822
|
+
}, z.core.$strip>;
|
|
823
|
+
}, z.core.$strip>;
|
|
824
|
+
toObject(): {
|
|
825
|
+
name: "UnknownError";
|
|
826
|
+
data: {
|
|
827
|
+
message: string;
|
|
828
|
+
};
|
|
829
|
+
};
|
|
830
|
+
message: string;
|
|
831
|
+
stack?: string;
|
|
832
|
+
cause?: unknown;
|
|
833
|
+
};
|
|
834
|
+
readonly Schema: z.ZodObject<{
|
|
835
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
836
|
+
data: z.ZodObject<{
|
|
837
|
+
message: z.ZodString;
|
|
838
|
+
}, z.core.$strip>;
|
|
839
|
+
}, z.core.$strip>;
|
|
840
|
+
isInstance(input: any): input is {
|
|
841
|
+
readonly name: "UnknownError";
|
|
842
|
+
readonly data: {
|
|
843
|
+
message: string;
|
|
844
|
+
};
|
|
845
|
+
schema(): z.ZodObject<{
|
|
846
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
847
|
+
data: z.ZodObject<{
|
|
848
|
+
message: z.ZodString;
|
|
849
|
+
}, z.core.$strip>;
|
|
850
|
+
}, z.core.$strip>;
|
|
851
|
+
toObject(): {
|
|
852
|
+
name: "UnknownError";
|
|
853
|
+
data: {
|
|
854
|
+
message: string;
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
message: string;
|
|
858
|
+
stack?: string;
|
|
859
|
+
cause?: unknown;
|
|
860
|
+
};
|
|
861
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
862
|
+
readonly Unknown: any;
|
|
863
|
+
isError(error: unknown): error is Error;
|
|
864
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
865
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
866
|
+
stackTraceLimit: number;
|
|
867
|
+
};
|
|
868
|
+
isError(error: unknown): error is Error;
|
|
869
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
870
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
871
|
+
stackTraceLimit: number;
|
|
872
|
+
};
|
|
873
|
+
const InvalidInputError: {
|
|
874
|
+
new (data: {
|
|
875
|
+
message: string;
|
|
876
|
+
field?: string | undefined;
|
|
877
|
+
value?: unknown;
|
|
878
|
+
}, options?: ErrorOptions): {
|
|
879
|
+
readonly name: "LocalInvalidInputError";
|
|
880
|
+
readonly data: {
|
|
881
|
+
message: string;
|
|
882
|
+
field?: string | undefined;
|
|
883
|
+
value?: unknown;
|
|
884
|
+
};
|
|
885
|
+
schema(): z.ZodObject<{
|
|
886
|
+
name: z.ZodLiteral<"LocalInvalidInputError">;
|
|
887
|
+
data: z.ZodObject<{
|
|
888
|
+
message: z.ZodString;
|
|
889
|
+
field: z.ZodOptional<z.ZodString>;
|
|
890
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
891
|
+
}, z.core.$strip>;
|
|
892
|
+
}, z.core.$strip>;
|
|
893
|
+
toObject(): {
|
|
894
|
+
name: "LocalInvalidInputError";
|
|
895
|
+
data: {
|
|
896
|
+
message: string;
|
|
897
|
+
field?: string | undefined;
|
|
898
|
+
value?: unknown;
|
|
899
|
+
};
|
|
900
|
+
};
|
|
901
|
+
message: string;
|
|
902
|
+
stack?: string;
|
|
903
|
+
cause?: unknown;
|
|
904
|
+
};
|
|
905
|
+
readonly Schema: z.ZodObject<{
|
|
906
|
+
name: z.ZodLiteral<"LocalInvalidInputError">;
|
|
907
|
+
data: z.ZodObject<{
|
|
908
|
+
message: z.ZodString;
|
|
909
|
+
field: z.ZodOptional<z.ZodString>;
|
|
910
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
911
|
+
}, z.core.$strip>;
|
|
912
|
+
}, z.core.$strip>;
|
|
913
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
914
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
915
|
+
readonly Unknown: {
|
|
916
|
+
new (data: {
|
|
917
|
+
message: string;
|
|
918
|
+
}, options?: ErrorOptions): {
|
|
919
|
+
readonly name: "UnknownError";
|
|
920
|
+
readonly data: {
|
|
921
|
+
message: string;
|
|
922
|
+
};
|
|
923
|
+
schema(): z.ZodObject<{
|
|
924
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
925
|
+
data: z.ZodObject<{
|
|
926
|
+
message: z.ZodString;
|
|
927
|
+
}, z.core.$strip>;
|
|
928
|
+
}, z.core.$strip>;
|
|
929
|
+
toObject(): {
|
|
930
|
+
name: "UnknownError";
|
|
931
|
+
data: {
|
|
932
|
+
message: string;
|
|
933
|
+
};
|
|
934
|
+
};
|
|
935
|
+
message: string;
|
|
936
|
+
stack?: string;
|
|
937
|
+
cause?: unknown;
|
|
938
|
+
};
|
|
939
|
+
readonly Schema: z.ZodObject<{
|
|
940
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
941
|
+
data: z.ZodObject<{
|
|
942
|
+
message: z.ZodString;
|
|
943
|
+
}, z.core.$strip>;
|
|
944
|
+
}, z.core.$strip>;
|
|
945
|
+
isInstance(input: any): input is {
|
|
946
|
+
readonly name: "UnknownError";
|
|
947
|
+
readonly data: {
|
|
948
|
+
message: string;
|
|
949
|
+
};
|
|
950
|
+
schema(): z.ZodObject<{
|
|
951
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
952
|
+
data: z.ZodObject<{
|
|
953
|
+
message: z.ZodString;
|
|
954
|
+
}, z.core.$strip>;
|
|
955
|
+
}, z.core.$strip>;
|
|
956
|
+
toObject(): {
|
|
957
|
+
name: "UnknownError";
|
|
958
|
+
data: {
|
|
959
|
+
message: string;
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
message: string;
|
|
963
|
+
stack?: string;
|
|
964
|
+
cause?: unknown;
|
|
965
|
+
};
|
|
966
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
967
|
+
readonly Unknown: any;
|
|
968
|
+
isError(error: unknown): error is Error;
|
|
969
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
970
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
971
|
+
stackTraceLimit: number;
|
|
972
|
+
};
|
|
973
|
+
isError(error: unknown): error is Error;
|
|
974
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
975
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
976
|
+
stackTraceLimit: number;
|
|
977
|
+
};
|
|
978
|
+
const UnsupportedFeatureError: {
|
|
979
|
+
new (data: {
|
|
980
|
+
message: string;
|
|
981
|
+
feature?: string | undefined;
|
|
982
|
+
allowed?: string[] | undefined;
|
|
983
|
+
}, options?: ErrorOptions): {
|
|
984
|
+
readonly name: "LocalUnsupportedFeatureError";
|
|
985
|
+
readonly data: {
|
|
986
|
+
message: string;
|
|
987
|
+
feature?: string | undefined;
|
|
988
|
+
allowed?: string[] | undefined;
|
|
989
|
+
};
|
|
990
|
+
schema(): z.ZodObject<{
|
|
991
|
+
name: z.ZodLiteral<"LocalUnsupportedFeatureError">;
|
|
992
|
+
data: z.ZodObject<{
|
|
993
|
+
message: z.ZodString;
|
|
994
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
995
|
+
allowed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
996
|
+
}, z.core.$strip>;
|
|
997
|
+
}, z.core.$strip>;
|
|
998
|
+
toObject(): {
|
|
999
|
+
name: "LocalUnsupportedFeatureError";
|
|
1000
|
+
data: {
|
|
1001
|
+
message: string;
|
|
1002
|
+
feature?: string | undefined;
|
|
1003
|
+
allowed?: string[] | undefined;
|
|
1004
|
+
};
|
|
1005
|
+
};
|
|
1006
|
+
message: string;
|
|
1007
|
+
stack?: string;
|
|
1008
|
+
cause?: unknown;
|
|
1009
|
+
};
|
|
1010
|
+
readonly Schema: z.ZodObject<{
|
|
1011
|
+
name: z.ZodLiteral<"LocalUnsupportedFeatureError">;
|
|
1012
|
+
data: z.ZodObject<{
|
|
1013
|
+
message: z.ZodString;
|
|
1014
|
+
feature: z.ZodOptional<z.ZodString>;
|
|
1015
|
+
allowed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1016
|
+
}, z.core.$strip>;
|
|
1017
|
+
}, z.core.$strip>;
|
|
1018
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
1019
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1020
|
+
readonly Unknown: {
|
|
1021
|
+
new (data: {
|
|
1022
|
+
message: string;
|
|
1023
|
+
}, options?: ErrorOptions): {
|
|
1024
|
+
readonly name: "UnknownError";
|
|
1025
|
+
readonly data: {
|
|
1026
|
+
message: string;
|
|
1027
|
+
};
|
|
1028
|
+
schema(): z.ZodObject<{
|
|
1029
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1030
|
+
data: z.ZodObject<{
|
|
1031
|
+
message: z.ZodString;
|
|
1032
|
+
}, z.core.$strip>;
|
|
1033
|
+
}, z.core.$strip>;
|
|
1034
|
+
toObject(): {
|
|
1035
|
+
name: "UnknownError";
|
|
1036
|
+
data: {
|
|
1037
|
+
message: string;
|
|
1038
|
+
};
|
|
1039
|
+
};
|
|
1040
|
+
message: string;
|
|
1041
|
+
stack?: string;
|
|
1042
|
+
cause?: unknown;
|
|
1043
|
+
};
|
|
1044
|
+
readonly Schema: z.ZodObject<{
|
|
1045
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1046
|
+
data: z.ZodObject<{
|
|
1047
|
+
message: z.ZodString;
|
|
1048
|
+
}, z.core.$strip>;
|
|
1049
|
+
}, z.core.$strip>;
|
|
1050
|
+
isInstance(input: any): input is {
|
|
1051
|
+
readonly name: "UnknownError";
|
|
1052
|
+
readonly data: {
|
|
1053
|
+
message: string;
|
|
1054
|
+
};
|
|
1055
|
+
schema(): z.ZodObject<{
|
|
1056
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1057
|
+
data: z.ZodObject<{
|
|
1058
|
+
message: z.ZodString;
|
|
1059
|
+
}, z.core.$strip>;
|
|
1060
|
+
}, z.core.$strip>;
|
|
1061
|
+
toObject(): {
|
|
1062
|
+
name: "UnknownError";
|
|
1063
|
+
data: {
|
|
1064
|
+
message: string;
|
|
1065
|
+
};
|
|
1066
|
+
};
|
|
1067
|
+
message: string;
|
|
1068
|
+
stack?: string;
|
|
1069
|
+
cause?: unknown;
|
|
1070
|
+
};
|
|
1071
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1072
|
+
readonly Unknown: any;
|
|
1073
|
+
isError(error: unknown): error is Error;
|
|
1074
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1075
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1076
|
+
stackTraceLimit: number;
|
|
1077
|
+
};
|
|
1078
|
+
isError(error: unknown): error is Error;
|
|
1079
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1080
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1081
|
+
stackTraceLimit: number;
|
|
1082
|
+
};
|
|
1083
|
+
const CacheError: {
|
|
1084
|
+
new (data: {
|
|
1085
|
+
message: string;
|
|
1086
|
+
cacheDir?: string | undefined;
|
|
1087
|
+
operation?: string | undefined;
|
|
1088
|
+
}, options?: ErrorOptions): {
|
|
1089
|
+
readonly name: "LocalCacheError";
|
|
1090
|
+
readonly data: {
|
|
1091
|
+
message: string;
|
|
1092
|
+
cacheDir?: string | undefined;
|
|
1093
|
+
operation?: string | undefined;
|
|
1094
|
+
};
|
|
1095
|
+
schema(): z.ZodObject<{
|
|
1096
|
+
name: z.ZodLiteral<"LocalCacheError">;
|
|
1097
|
+
data: z.ZodObject<{
|
|
1098
|
+
message: z.ZodString;
|
|
1099
|
+
cacheDir: z.ZodOptional<z.ZodString>;
|
|
1100
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
1101
|
+
}, z.core.$strip>;
|
|
1102
|
+
}, z.core.$strip>;
|
|
1103
|
+
toObject(): {
|
|
1104
|
+
name: "LocalCacheError";
|
|
1105
|
+
data: {
|
|
1106
|
+
message: string;
|
|
1107
|
+
cacheDir?: string | undefined;
|
|
1108
|
+
operation?: string | undefined;
|
|
1109
|
+
};
|
|
1110
|
+
};
|
|
1111
|
+
message: string;
|
|
1112
|
+
stack?: string;
|
|
1113
|
+
cause?: unknown;
|
|
1114
|
+
};
|
|
1115
|
+
readonly Schema: z.ZodObject<{
|
|
1116
|
+
name: z.ZodLiteral<"LocalCacheError">;
|
|
1117
|
+
data: z.ZodObject<{
|
|
1118
|
+
message: z.ZodString;
|
|
1119
|
+
cacheDir: z.ZodOptional<z.ZodString>;
|
|
1120
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
1121
|
+
}, z.core.$strip>;
|
|
1122
|
+
}, z.core.$strip>;
|
|
1123
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
1124
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1125
|
+
readonly Unknown: {
|
|
1126
|
+
new (data: {
|
|
1127
|
+
message: string;
|
|
1128
|
+
}, options?: ErrorOptions): {
|
|
1129
|
+
readonly name: "UnknownError";
|
|
1130
|
+
readonly data: {
|
|
1131
|
+
message: string;
|
|
1132
|
+
};
|
|
1133
|
+
schema(): z.ZodObject<{
|
|
1134
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1135
|
+
data: z.ZodObject<{
|
|
1136
|
+
message: z.ZodString;
|
|
1137
|
+
}, z.core.$strip>;
|
|
1138
|
+
}, z.core.$strip>;
|
|
1139
|
+
toObject(): {
|
|
1140
|
+
name: "UnknownError";
|
|
1141
|
+
data: {
|
|
1142
|
+
message: string;
|
|
1143
|
+
};
|
|
1144
|
+
};
|
|
1145
|
+
message: string;
|
|
1146
|
+
stack?: string;
|
|
1147
|
+
cause?: unknown;
|
|
1148
|
+
};
|
|
1149
|
+
readonly Schema: z.ZodObject<{
|
|
1150
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1151
|
+
data: z.ZodObject<{
|
|
1152
|
+
message: z.ZodString;
|
|
1153
|
+
}, z.core.$strip>;
|
|
1154
|
+
}, z.core.$strip>;
|
|
1155
|
+
isInstance(input: any): input is {
|
|
1156
|
+
readonly name: "UnknownError";
|
|
1157
|
+
readonly data: {
|
|
1158
|
+
message: string;
|
|
1159
|
+
};
|
|
1160
|
+
schema(): z.ZodObject<{
|
|
1161
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1162
|
+
data: z.ZodObject<{
|
|
1163
|
+
message: z.ZodString;
|
|
1164
|
+
}, z.core.$strip>;
|
|
1165
|
+
}, z.core.$strip>;
|
|
1166
|
+
toObject(): {
|
|
1167
|
+
name: "UnknownError";
|
|
1168
|
+
data: {
|
|
1169
|
+
message: string;
|
|
1170
|
+
};
|
|
1171
|
+
};
|
|
1172
|
+
message: string;
|
|
1173
|
+
stack?: string;
|
|
1174
|
+
cause?: unknown;
|
|
1175
|
+
};
|
|
1176
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1177
|
+
readonly Unknown: any;
|
|
1178
|
+
isError(error: unknown): error is Error;
|
|
1179
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1180
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1181
|
+
stackTraceLimit: number;
|
|
1182
|
+
};
|
|
1183
|
+
isError(error: unknown): error is Error;
|
|
1184
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1185
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1186
|
+
stackTraceLimit: number;
|
|
1187
|
+
};
|
|
1188
|
+
const AbortedError: {
|
|
1189
|
+
new (data: {
|
|
1190
|
+
message: string;
|
|
1191
|
+
}, options?: ErrorOptions): {
|
|
1192
|
+
readonly name: "LocalAbortedError";
|
|
1193
|
+
readonly data: {
|
|
1194
|
+
message: string;
|
|
1195
|
+
};
|
|
1196
|
+
schema(): z.ZodObject<{
|
|
1197
|
+
name: z.ZodLiteral<"LocalAbortedError">;
|
|
1198
|
+
data: z.ZodObject<{
|
|
1199
|
+
message: z.ZodString;
|
|
1200
|
+
}, z.core.$strip>;
|
|
1201
|
+
}, z.core.$strip>;
|
|
1202
|
+
toObject(): {
|
|
1203
|
+
name: "LocalAbortedError";
|
|
1204
|
+
data: {
|
|
1205
|
+
message: string;
|
|
1206
|
+
};
|
|
1207
|
+
};
|
|
1208
|
+
message: string;
|
|
1209
|
+
stack?: string;
|
|
1210
|
+
cause?: unknown;
|
|
1211
|
+
};
|
|
1212
|
+
readonly Schema: z.ZodObject<{
|
|
1213
|
+
name: z.ZodLiteral<"LocalAbortedError">;
|
|
1214
|
+
data: z.ZodObject<{
|
|
1215
|
+
message: z.ZodString;
|
|
1216
|
+
}, z.core.$strip>;
|
|
1217
|
+
}, z.core.$strip>;
|
|
1218
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
1219
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1220
|
+
readonly Unknown: {
|
|
1221
|
+
new (data: {
|
|
1222
|
+
message: string;
|
|
1223
|
+
}, options?: ErrorOptions): {
|
|
1224
|
+
readonly name: "UnknownError";
|
|
1225
|
+
readonly data: {
|
|
1226
|
+
message: string;
|
|
1227
|
+
};
|
|
1228
|
+
schema(): z.ZodObject<{
|
|
1229
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1230
|
+
data: z.ZodObject<{
|
|
1231
|
+
message: z.ZodString;
|
|
1232
|
+
}, z.core.$strip>;
|
|
1233
|
+
}, z.core.$strip>;
|
|
1234
|
+
toObject(): {
|
|
1235
|
+
name: "UnknownError";
|
|
1236
|
+
data: {
|
|
1237
|
+
message: string;
|
|
1238
|
+
};
|
|
1239
|
+
};
|
|
1240
|
+
message: string;
|
|
1241
|
+
stack?: string;
|
|
1242
|
+
cause?: unknown;
|
|
1243
|
+
};
|
|
1244
|
+
readonly Schema: z.ZodObject<{
|
|
1245
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1246
|
+
data: z.ZodObject<{
|
|
1247
|
+
message: z.ZodString;
|
|
1248
|
+
}, z.core.$strip>;
|
|
1249
|
+
}, z.core.$strip>;
|
|
1250
|
+
isInstance(input: any): input is {
|
|
1251
|
+
readonly name: "UnknownError";
|
|
1252
|
+
readonly data: {
|
|
1253
|
+
message: string;
|
|
1254
|
+
};
|
|
1255
|
+
schema(): z.ZodObject<{
|
|
1256
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1257
|
+
data: z.ZodObject<{
|
|
1258
|
+
message: z.ZodString;
|
|
1259
|
+
}, z.core.$strip>;
|
|
1260
|
+
}, z.core.$strip>;
|
|
1261
|
+
toObject(): {
|
|
1262
|
+
name: "UnknownError";
|
|
1263
|
+
data: {
|
|
1264
|
+
message: string;
|
|
1265
|
+
};
|
|
1266
|
+
};
|
|
1267
|
+
message: string;
|
|
1268
|
+
stack?: string;
|
|
1269
|
+
cause?: unknown;
|
|
1270
|
+
};
|
|
1271
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1272
|
+
readonly Unknown: any;
|
|
1273
|
+
isError(error: unknown): error is Error;
|
|
1274
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1275
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1276
|
+
stackTraceLimit: number;
|
|
1277
|
+
};
|
|
1278
|
+
isError(error: unknown): error is Error;
|
|
1279
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1280
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1281
|
+
stackTraceLimit: number;
|
|
1282
|
+
};
|
|
1283
|
+
const OutOfMemoryError: {
|
|
1284
|
+
new (data: {
|
|
1285
|
+
message: string;
|
|
1286
|
+
modelId?: string | undefined;
|
|
1287
|
+
}, options?: ErrorOptions): {
|
|
1288
|
+
readonly name: "LocalOutOfMemoryError";
|
|
1289
|
+
readonly data: {
|
|
1290
|
+
message: string;
|
|
1291
|
+
modelId?: string | undefined;
|
|
1292
|
+
};
|
|
1293
|
+
schema(): z.ZodObject<{
|
|
1294
|
+
name: z.ZodLiteral<"LocalOutOfMemoryError">;
|
|
1295
|
+
data: z.ZodObject<{
|
|
1296
|
+
message: z.ZodString;
|
|
1297
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
1298
|
+
}, z.core.$strip>;
|
|
1299
|
+
}, z.core.$strip>;
|
|
1300
|
+
toObject(): {
|
|
1301
|
+
name: "LocalOutOfMemoryError";
|
|
1302
|
+
data: {
|
|
1303
|
+
message: string;
|
|
1304
|
+
modelId?: string | undefined;
|
|
1305
|
+
};
|
|
1306
|
+
};
|
|
1307
|
+
message: string;
|
|
1308
|
+
stack?: string;
|
|
1309
|
+
cause?: unknown;
|
|
1310
|
+
};
|
|
1311
|
+
readonly Schema: z.ZodObject<{
|
|
1312
|
+
name: z.ZodLiteral<"LocalOutOfMemoryError">;
|
|
1313
|
+
data: z.ZodObject<{
|
|
1314
|
+
message: z.ZodString;
|
|
1315
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
1316
|
+
}, z.core.$strip>;
|
|
1317
|
+
}, z.core.$strip>;
|
|
1318
|
+
isInstance(input: any): input is InstanceType<any>;
|
|
1319
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1320
|
+
readonly Unknown: {
|
|
1321
|
+
new (data: {
|
|
1322
|
+
message: string;
|
|
1323
|
+
}, options?: ErrorOptions): {
|
|
1324
|
+
readonly name: "UnknownError";
|
|
1325
|
+
readonly data: {
|
|
1326
|
+
message: string;
|
|
1327
|
+
};
|
|
1328
|
+
schema(): z.ZodObject<{
|
|
1329
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1330
|
+
data: z.ZodObject<{
|
|
1331
|
+
message: z.ZodString;
|
|
1332
|
+
}, z.core.$strip>;
|
|
1333
|
+
}, z.core.$strip>;
|
|
1334
|
+
toObject(): {
|
|
1335
|
+
name: "UnknownError";
|
|
1336
|
+
data: {
|
|
1337
|
+
message: string;
|
|
1338
|
+
};
|
|
1339
|
+
};
|
|
1340
|
+
message: string;
|
|
1341
|
+
stack?: string;
|
|
1342
|
+
cause?: unknown;
|
|
1343
|
+
};
|
|
1344
|
+
readonly Schema: z.ZodObject<{
|
|
1345
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1346
|
+
data: z.ZodObject<{
|
|
1347
|
+
message: z.ZodString;
|
|
1348
|
+
}, z.core.$strip>;
|
|
1349
|
+
}, z.core.$strip>;
|
|
1350
|
+
isInstance(input: any): input is {
|
|
1351
|
+
readonly name: "UnknownError";
|
|
1352
|
+
readonly data: {
|
|
1353
|
+
message: string;
|
|
1354
|
+
};
|
|
1355
|
+
schema(): z.ZodObject<{
|
|
1356
|
+
name: z.ZodLiteral<"UnknownError">;
|
|
1357
|
+
data: z.ZodObject<{
|
|
1358
|
+
message: z.ZodString;
|
|
1359
|
+
}, z.core.$strip>;
|
|
1360
|
+
}, z.core.$strip>;
|
|
1361
|
+
toObject(): {
|
|
1362
|
+
name: "UnknownError";
|
|
1363
|
+
data: {
|
|
1364
|
+
message: string;
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
message: string;
|
|
1368
|
+
stack?: string;
|
|
1369
|
+
cause?: unknown;
|
|
1370
|
+
};
|
|
1371
|
+
create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
|
|
1372
|
+
readonly Unknown: any;
|
|
1373
|
+
isError(error: unknown): error is Error;
|
|
1374
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1375
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1376
|
+
stackTraceLimit: number;
|
|
1377
|
+
};
|
|
1378
|
+
isError(error: unknown): error is Error;
|
|
1379
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
1380
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
1381
|
+
stackTraceLimit: number;
|
|
1382
|
+
};
|
|
1383
|
+
}
|
|
1384
|
+
declare enum ErrorCode {
|
|
1385
|
+
MODEL_NOT_FOUND = "LocalModelNotFoundError",
|
|
1386
|
+
MODEL_LOAD_ERROR = "LocalModelLoadError",
|
|
1387
|
+
MODEL_NOT_INITIALIZED = "LocalModelNotInitializedError",
|
|
1388
|
+
GENERATION_ERROR = "LocalGenerationError",
|
|
1389
|
+
EMBEDDING_ERROR = "LocalEmbeddingError",
|
|
1390
|
+
INVALID_INPUT = "LocalInvalidInputError",
|
|
1391
|
+
UNSUPPORTED_FEATURE = "LocalUnsupportedFeatureError",
|
|
1392
|
+
CACHE_ERROR = "LocalCacheError",
|
|
1393
|
+
PROCESSING_ERROR = "LocalProcessingError",
|
|
1394
|
+
ABORTED = "LocalAbortedError",
|
|
1395
|
+
OUT_OF_MEMORY = "LocalOutOfMemoryError",
|
|
1396
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
277
1397
|
}
|
|
278
1398
|
declare class ErrorHandler {
|
|
279
|
-
static modelLoadError(cause: Error):
|
|
280
|
-
static generationError(cause: Error):
|
|
281
|
-
static embeddingError(cause: Error):
|
|
282
|
-
static validationError(message: string):
|
|
283
|
-
static abortError():
|
|
284
|
-
static unsupportedFeature(feature: string):
|
|
1399
|
+
static modelLoadError(cause: Error): InstanceType<typeof LocalModelErrors.ModelLoadError>;
|
|
1400
|
+
static generationError(cause: Error): InstanceType<typeof LocalModelErrors.GenerationError>;
|
|
1401
|
+
static embeddingError(cause: Error): InstanceType<typeof LocalModelErrors.EmbeddingError>;
|
|
1402
|
+
static validationError(message: string): InstanceType<typeof LocalModelErrors.InvalidInputError>;
|
|
1403
|
+
static abortError(): InstanceType<typeof LocalModelErrors.AbortedError>;
|
|
1404
|
+
static unsupportedFeature(feature: string): InstanceType<typeof LocalModelErrors.UnsupportedFeatureError>;
|
|
285
1405
|
}
|
|
286
1406
|
|
|
287
1407
|
declare const VERSION = "0.1.0";
|
|
288
1408
|
declare const SDK_NAME = "@easbot/local-model-sdk";
|
|
289
1409
|
declare const SDK_DESCRIPTION = "Complete local model SDK for EASBot - Transformers.js + ONNX implementation";
|
|
290
1410
|
|
|
291
|
-
export { type EmbeddingModelConfig, ErrorCode, ErrorHandler, type GenerateChunk, type GenerateOptions, type GenerateResult, LLMRerankingModel, type LLMRerankingModelOptions, type LanguageModelConfig, type LanguageModelSettings, LocalEmbeddingModel, LocalEnhancedLanguageModel, LocalLanguageModel,
|
|
1411
|
+
export { type EmbeddingModelConfig, ErrorCode, ErrorHandler, type GenerateChunk, type GenerateOptions, type GenerateResult, LLMRerankingModel, type LLMRerankingModelOptions, type LanguageModelConfig, type LanguageModelSettings, LocalEmbeddingModel, LocalEnhancedLanguageModel, LocalLanguageModel, LocalModelErrors, LocalModelProvider, type LocalModelProviderConfig, type LocalProvider, LocalRerankingModel, type ModelCacheConfig, type ModelInfo, type RerankingModelOptions, SDK_DESCRIPTION, SDK_NAME, SUPPORTED_EMBEDDING_MODELS, SUPPORTED_LANGUAGE_MODELS, type TransformersEngineConfig, VERSION, createLocal };
|