@chainfuse/types 1.7.2 → 2.0.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/ai-tools/azure/catalog.d.ts +573 -0
- package/dist/ai-tools/azure/catalog.js +708 -0
- package/dist/ai-tools/azure/index.d.ts +3 -0
- package/dist/ai-tools/azure/index.js +1 -0
- package/dist/ai-tools/index.d.ts +4 -12
- package/dist/ai-tools/index.js +3 -3
- package/dist/ai-tools/{workers-ai-catalog.d.ts → workers-ai/catalog.d.ts} +69 -44
- package/dist/ai-tools/{workers-ai-catalog.js → workers-ai/catalog.js} +77 -48
- package/dist/ai-tools/workers-ai/index.d.ts +23 -0
- package/dist/ai-tools/workers-ai/index.js +7 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +10 -15
- package/dist/super-ai/index.d.ts +0 -630
- package/dist/super-ai/index.js +0 -27
package/dist/ai-tools/index.d.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export
|
|
1
|
+
import { type CloudflareFunctionModelsEnum, type CloudflareModelsEnum } from './workers-ai/index.js';
|
|
2
|
+
export * from './azure/index.js';
|
|
3
|
+
export * from './workers-ai/index.js';
|
|
4
|
+
export interface Coordinate {
|
|
3
5
|
lat: string;
|
|
4
6
|
lon: string;
|
|
5
7
|
}
|
|
6
|
-
export declare const enabledCloudflareLlmImageProviders: cloudflareModelPossibilities<'Text-to-Image'>[];
|
|
7
|
-
export type CloudflareModelsEnum<M extends cloudflareModelTypes = cloudflareModelTypes> = {
|
|
8
|
-
[K in cloudflareModelPossibilities<M>]: `workersai:${K}`;
|
|
9
|
-
};
|
|
10
|
-
export type CloudflareFunctionModelsEnum = {
|
|
11
|
-
[K in cloudflareFilteredModelPossibilities<'Text Generation', 'function_calling', true>]: `workersai:${K}`;
|
|
12
|
-
};
|
|
13
|
-
export type AzureChatModels = 'gpt-35-turbo' | 'gpt-4-turbo' | 'gpt-4o' | 'gpt-4o-mini' | 'o1' | 'o3-mini';
|
|
14
|
-
export type AzureImageModels = 'dall-e-3';
|
|
15
|
-
export type AzureEmbeddingModels = 'text-embedding-3-small' | 'text-embedding-3-large';
|
|
16
8
|
export declare namespace AiModels {
|
|
17
9
|
namespace LanguageModels {
|
|
18
10
|
enum Azure {
|
package/dist/ai-tools/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { enabledCloudflareLlmEmbeddingProviders, enabledCloudflareLlmFunctionProviders, enabledCloudflareLlmProviders } from '
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { enabledCloudflareLlmEmbeddingProviders, enabledCloudflareLlmFunctionProviders, enabledCloudflareLlmImageProviders, enabledCloudflareLlmProviders } from './workers-ai/index.js';
|
|
2
|
+
export * from './azure/index.js';
|
|
3
|
+
export * from './workers-ai/index.js';
|
|
4
4
|
export var AiModels;
|
|
5
5
|
(function (AiModels) {
|
|
6
6
|
let LanguageModels;
|
|
@@ -271,6 +271,7 @@ export declare const workersAiCatalog: {
|
|
|
271
271
|
readonly tags: readonly [];
|
|
272
272
|
readonly properties: {
|
|
273
273
|
readonly context_window: 24000;
|
|
274
|
+
readonly function_calling: true;
|
|
274
275
|
readonly terms: "https://github.com/meta-llama/llama-models/blob/main/models/llama3_3/LICENSE";
|
|
275
276
|
};
|
|
276
277
|
}, {
|
|
@@ -471,6 +472,54 @@ export declare const workersAiCatalog: {
|
|
|
471
472
|
};
|
|
472
473
|
}];
|
|
473
474
|
};
|
|
475
|
+
readonly 'Text Embeddings': {
|
|
476
|
+
readonly id: "0137cdcf-162a-4108-94f2-1ca59e8c65ee";
|
|
477
|
+
readonly description: "Feature extraction models transform raw data into numerical features that can be processed while preserving the information in the original dataset. These models are ideal as part of building vector search applications or Retrieval Augmented Generation workflows with Large Language Models (LLM).";
|
|
478
|
+
readonly models: readonly [{
|
|
479
|
+
readonly id: "eed32bc1-8775-4985-89ce-dd1405508ad8";
|
|
480
|
+
readonly source: 1;
|
|
481
|
+
readonly name: "@cf/baai/bge-m3";
|
|
482
|
+
readonly description: "Multi-Functionality, Multi-Linguality, and Multi-Granularity embeddings model.";
|
|
483
|
+
readonly tags: readonly [];
|
|
484
|
+
readonly properties: {};
|
|
485
|
+
}, {
|
|
486
|
+
readonly id: "57fbd08a-a4c4-411c-910d-b9459ff36c20";
|
|
487
|
+
readonly source: 1;
|
|
488
|
+
readonly name: "@cf/baai/bge-small-en-v1.5";
|
|
489
|
+
readonly description: "BAAI general embedding (Small) model that transforms any given text into a 384-dimensional vector";
|
|
490
|
+
readonly tags: readonly [];
|
|
491
|
+
readonly properties: {
|
|
492
|
+
readonly beta: true;
|
|
493
|
+
readonly info: "https://huggingface.co/BAAI/bge-base-en-v1.5";
|
|
494
|
+
readonly max_input_tokens: 512;
|
|
495
|
+
readonly output_dimensions: 384;
|
|
496
|
+
};
|
|
497
|
+
}, {
|
|
498
|
+
readonly id: "429b9e8b-d99e-44de-91ad-706cf8183658";
|
|
499
|
+
readonly source: 1;
|
|
500
|
+
readonly name: "@cf/baai/bge-base-en-v1.5";
|
|
501
|
+
readonly description: "BAAI general embedding (Base) model that transforms any given text into a 768-dimensional vector";
|
|
502
|
+
readonly tags: readonly [];
|
|
503
|
+
readonly properties: {
|
|
504
|
+
readonly beta: true;
|
|
505
|
+
readonly info: "https://huggingface.co/BAAI/bge-base-en-v1.5";
|
|
506
|
+
readonly max_input_tokens: 512;
|
|
507
|
+
readonly output_dimensions: 768;
|
|
508
|
+
};
|
|
509
|
+
}, {
|
|
510
|
+
readonly id: "01bc2fb0-4bca-4598-b985-d2584a3f46c0";
|
|
511
|
+
readonly source: 1;
|
|
512
|
+
readonly name: "@cf/baai/bge-large-en-v1.5";
|
|
513
|
+
readonly description: "BAAI general embedding (Large) model that transforms any given text into a 1024-dimensional vector";
|
|
514
|
+
readonly tags: readonly [];
|
|
515
|
+
readonly properties: {
|
|
516
|
+
readonly beta: true;
|
|
517
|
+
readonly info: "https://huggingface.co/BAAI/bge-base-en-v1.5";
|
|
518
|
+
readonly max_input_tokens: 512;
|
|
519
|
+
readonly output_dimensions: 1024;
|
|
520
|
+
};
|
|
521
|
+
}];
|
|
522
|
+
};
|
|
474
523
|
readonly 'Text Classification': {
|
|
475
524
|
readonly id: "19606750-23ed-4371-aab2-c20349b53a60";
|
|
476
525
|
readonly description: "Sentiment analysis or text classification is a common NLP task that classifies a text input into labels or classes.";
|
|
@@ -484,6 +533,13 @@ export declare const workersAiCatalog: {
|
|
|
484
533
|
readonly beta: true;
|
|
485
534
|
readonly info: "https://huggingface.co/Intel/distilbert-base-uncased-finetuned-sst-2-english-int8-static";
|
|
486
535
|
};
|
|
536
|
+
}, {
|
|
537
|
+
readonly id: "145337e7-cec3-4ebb-8e78-16ddfc75e580";
|
|
538
|
+
readonly source: 1;
|
|
539
|
+
readonly name: "@cf/baai/bge-reranker-base";
|
|
540
|
+
readonly description: "Different from embedding model, reranker uses question and document as input and directly output similarity instead of embedding. You can get a relevance score by inputting query and passage to the reranker. And the score can be mapped to a float value in [0,1] by sigmoid function.\n\n";
|
|
541
|
+
readonly tags: readonly [];
|
|
542
|
+
readonly properties: {};
|
|
487
543
|
}];
|
|
488
544
|
};
|
|
489
545
|
readonly 'Object Detection': {
|
|
@@ -500,6 +556,18 @@ export declare const workersAiCatalog: {
|
|
|
500
556
|
};
|
|
501
557
|
}];
|
|
502
558
|
};
|
|
559
|
+
readonly 'Text-to-Speech': {
|
|
560
|
+
readonly id: "b52660a1-9a95-4ab2-8b1d-f232be34604a";
|
|
561
|
+
readonly description: "Text-to-Speech (TTS) is the task of generating natural sounding speech given text input. TTS models can be extended to have a single model that generates speech for multiple speakers and multiple languages.";
|
|
562
|
+
readonly models: readonly [{
|
|
563
|
+
readonly id: "c837b2ac-4d9b-4d37-8811-34de60f0c44f";
|
|
564
|
+
readonly source: 1;
|
|
565
|
+
readonly name: "@cf/myshell-ai/melotts";
|
|
566
|
+
readonly description: "MeloTTS is a high-quality multi-lingual text-to-speech library by MyShell.ai.";
|
|
567
|
+
readonly tags: readonly [];
|
|
568
|
+
readonly properties: {};
|
|
569
|
+
}];
|
|
570
|
+
};
|
|
503
571
|
readonly 'Automatic Speech Recognition': {
|
|
504
572
|
readonly id: "dfce1c48-2a81-462e-a7fd-de97ce985207";
|
|
505
573
|
readonly description: "Automatic speech recognition (ASR) models convert a speech signal, typically an audio input, to text.";
|
|
@@ -528,9 +596,7 @@ export declare const workersAiCatalog: {
|
|
|
528
596
|
readonly name: "@cf/openai/whisper-large-v3-turbo";
|
|
529
597
|
readonly description: "Whisper is a pre-trained model for automatic speech recognition (ASR) and speech translation. ";
|
|
530
598
|
readonly tags: readonly [];
|
|
531
|
-
readonly properties: {
|
|
532
|
-
readonly beta: true;
|
|
533
|
-
};
|
|
599
|
+
readonly properties: {};
|
|
534
600
|
}];
|
|
535
601
|
};
|
|
536
602
|
readonly 'Image-to-Text': {
|
|
@@ -654,47 +720,6 @@ export declare const workersAiCatalog: {
|
|
|
654
720
|
};
|
|
655
721
|
}];
|
|
656
722
|
};
|
|
657
|
-
readonly 'Text Embeddings': {
|
|
658
|
-
readonly id: "0137cdcf-162a-4108-94f2-1ca59e8c65ee";
|
|
659
|
-
readonly description: "Feature extraction models transform raw data into numerical features that can be processed while preserving the information in the original dataset. These models are ideal as part of building vector search applications or Retrieval Augmented Generation workflows with Large Language Models (LLM).";
|
|
660
|
-
readonly models: readonly [{
|
|
661
|
-
readonly id: "57fbd08a-a4c4-411c-910d-b9459ff36c20";
|
|
662
|
-
readonly source: 1;
|
|
663
|
-
readonly name: "@cf/baai/bge-small-en-v1.5";
|
|
664
|
-
readonly description: "BAAI general embedding (Small) model that transforms any given text into a 384-dimensional vector";
|
|
665
|
-
readonly tags: readonly [];
|
|
666
|
-
readonly properties: {
|
|
667
|
-
readonly beta: true;
|
|
668
|
-
readonly info: "https://huggingface.co/BAAI/bge-base-en-v1.5";
|
|
669
|
-
readonly max_input_tokens: 512;
|
|
670
|
-
readonly output_dimensions: 384;
|
|
671
|
-
};
|
|
672
|
-
}, {
|
|
673
|
-
readonly id: "429b9e8b-d99e-44de-91ad-706cf8183658";
|
|
674
|
-
readonly source: 1;
|
|
675
|
-
readonly name: "@cf/baai/bge-base-en-v1.5";
|
|
676
|
-
readonly description: "BAAI general embedding (Base) model that transforms any given text into a 768-dimensional vector";
|
|
677
|
-
readonly tags: readonly [];
|
|
678
|
-
readonly properties: {
|
|
679
|
-
readonly beta: true;
|
|
680
|
-
readonly info: "https://huggingface.co/BAAI/bge-base-en-v1.5";
|
|
681
|
-
readonly max_input_tokens: 512;
|
|
682
|
-
readonly output_dimensions: 768;
|
|
683
|
-
};
|
|
684
|
-
}, {
|
|
685
|
-
readonly id: "01bc2fb0-4bca-4598-b985-d2584a3f46c0";
|
|
686
|
-
readonly source: 1;
|
|
687
|
-
readonly name: "@cf/baai/bge-large-en-v1.5";
|
|
688
|
-
readonly description: "BAAI general embedding (Large) model that transforms any given text into a 1024-dimensional vector";
|
|
689
|
-
readonly tags: readonly [];
|
|
690
|
-
readonly properties: {
|
|
691
|
-
readonly beta: true;
|
|
692
|
-
readonly info: "https://huggingface.co/BAAI/bge-base-en-v1.5";
|
|
693
|
-
readonly max_input_tokens: 512;
|
|
694
|
-
readonly output_dimensions: 1024;
|
|
695
|
-
};
|
|
696
|
-
}];
|
|
697
|
-
};
|
|
698
723
|
readonly Summarization: {
|
|
699
724
|
readonly id: "6f4e65d8-da0f-40d2-9aa4-db582a5a04fd";
|
|
700
725
|
readonly description: "Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text.";
|
|
@@ -296,6 +296,7 @@ export const workersAiCatalog = {
|
|
|
296
296
|
tags: [],
|
|
297
297
|
properties: {
|
|
298
298
|
context_window: 24000,
|
|
299
|
+
function_calling: true,
|
|
299
300
|
terms: 'https://github.com/meta-llama/llama-models/blob/main/models/llama3_3/LICENSE',
|
|
300
301
|
},
|
|
301
302
|
},
|
|
@@ -515,6 +516,59 @@ export const workersAiCatalog = {
|
|
|
515
516
|
},
|
|
516
517
|
],
|
|
517
518
|
},
|
|
519
|
+
'Text Embeddings': {
|
|
520
|
+
id: '0137cdcf-162a-4108-94f2-1ca59e8c65ee',
|
|
521
|
+
description: 'Feature extraction models transform raw data into numerical features that can be processed while preserving the information in the original dataset. These models are ideal as part of building vector search applications or Retrieval Augmented Generation workflows with Large Language Models (LLM).',
|
|
522
|
+
models: [
|
|
523
|
+
{
|
|
524
|
+
id: 'eed32bc1-8775-4985-89ce-dd1405508ad8',
|
|
525
|
+
source: 1,
|
|
526
|
+
name: '@cf/baai/bge-m3',
|
|
527
|
+
description: 'Multi-Functionality, Multi-Linguality, and Multi-Granularity embeddings model.',
|
|
528
|
+
tags: [],
|
|
529
|
+
properties: {},
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
id: '57fbd08a-a4c4-411c-910d-b9459ff36c20',
|
|
533
|
+
source: 1,
|
|
534
|
+
name: '@cf/baai/bge-small-en-v1.5',
|
|
535
|
+
description: 'BAAI general embedding (Small) model that transforms any given text into a 384-dimensional vector',
|
|
536
|
+
tags: [],
|
|
537
|
+
properties: {
|
|
538
|
+
beta: true,
|
|
539
|
+
info: 'https://huggingface.co/BAAI/bge-base-en-v1.5',
|
|
540
|
+
max_input_tokens: 512,
|
|
541
|
+
output_dimensions: 384,
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
id: '429b9e8b-d99e-44de-91ad-706cf8183658',
|
|
546
|
+
source: 1,
|
|
547
|
+
name: '@cf/baai/bge-base-en-v1.5',
|
|
548
|
+
description: 'BAAI general embedding (Base) model that transforms any given text into a 768-dimensional vector',
|
|
549
|
+
tags: [],
|
|
550
|
+
properties: {
|
|
551
|
+
beta: true,
|
|
552
|
+
info: 'https://huggingface.co/BAAI/bge-base-en-v1.5',
|
|
553
|
+
max_input_tokens: 512,
|
|
554
|
+
output_dimensions: 768,
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
id: '01bc2fb0-4bca-4598-b985-d2584a3f46c0',
|
|
559
|
+
source: 1,
|
|
560
|
+
name: '@cf/baai/bge-large-en-v1.5',
|
|
561
|
+
description: 'BAAI general embedding (Large) model that transforms any given text into a 1024-dimensional vector',
|
|
562
|
+
tags: [],
|
|
563
|
+
properties: {
|
|
564
|
+
beta: true,
|
|
565
|
+
info: 'https://huggingface.co/BAAI/bge-base-en-v1.5',
|
|
566
|
+
max_input_tokens: 512,
|
|
567
|
+
output_dimensions: 1024,
|
|
568
|
+
},
|
|
569
|
+
},
|
|
570
|
+
],
|
|
571
|
+
},
|
|
518
572
|
'Text Classification': {
|
|
519
573
|
id: '19606750-23ed-4371-aab2-c20349b53a60',
|
|
520
574
|
description: 'Sentiment analysis or text classification is a common NLP task that classifies a text input into labels or classes.',
|
|
@@ -530,6 +584,14 @@ export const workersAiCatalog = {
|
|
|
530
584
|
info: 'https://huggingface.co/Intel/distilbert-base-uncased-finetuned-sst-2-english-int8-static',
|
|
531
585
|
},
|
|
532
586
|
},
|
|
587
|
+
{
|
|
588
|
+
id: '145337e7-cec3-4ebb-8e78-16ddfc75e580',
|
|
589
|
+
source: 1,
|
|
590
|
+
name: '@cf/baai/bge-reranker-base',
|
|
591
|
+
description: 'Different from embedding model, reranker uses question and document as input and directly output similarity instead of embedding. You can get a relevance score by inputting query and passage to the reranker. And the score can be mapped to a float value in [0,1] by sigmoid function.\n\n',
|
|
592
|
+
tags: [],
|
|
593
|
+
properties: {},
|
|
594
|
+
},
|
|
533
595
|
],
|
|
534
596
|
},
|
|
535
597
|
'Object Detection': {
|
|
@@ -548,6 +610,20 @@ export const workersAiCatalog = {
|
|
|
548
610
|
},
|
|
549
611
|
],
|
|
550
612
|
},
|
|
613
|
+
'Text-to-Speech': {
|
|
614
|
+
id: 'b52660a1-9a95-4ab2-8b1d-f232be34604a',
|
|
615
|
+
description: 'Text-to-Speech (TTS) is the task of generating natural sounding speech given text input. TTS models can be extended to have a single model that generates speech for multiple speakers and multiple languages.',
|
|
616
|
+
models: [
|
|
617
|
+
{
|
|
618
|
+
id: 'c837b2ac-4d9b-4d37-8811-34de60f0c44f',
|
|
619
|
+
source: 1,
|
|
620
|
+
name: '@cf/myshell-ai/melotts',
|
|
621
|
+
description: 'MeloTTS is a high-quality multi-lingual text-to-speech library by MyShell.ai.',
|
|
622
|
+
tags: [],
|
|
623
|
+
properties: {},
|
|
624
|
+
},
|
|
625
|
+
],
|
|
626
|
+
},
|
|
551
627
|
'Automatic Speech Recognition': {
|
|
552
628
|
id: 'dfce1c48-2a81-462e-a7fd-de97ce985207',
|
|
553
629
|
description: 'Automatic speech recognition (ASR) models convert a speech signal, typically an audio input, to text.',
|
|
@@ -579,9 +655,7 @@ export const workersAiCatalog = {
|
|
|
579
655
|
name: '@cf/openai/whisper-large-v3-turbo',
|
|
580
656
|
description: 'Whisper is a pre-trained model for automatic speech recognition (ASR) and speech translation. ',
|
|
581
657
|
tags: [],
|
|
582
|
-
properties: {
|
|
583
|
-
beta: true,
|
|
584
|
-
},
|
|
658
|
+
properties: {},
|
|
585
659
|
},
|
|
586
660
|
],
|
|
587
661
|
},
|
|
@@ -720,51 +794,6 @@ export const workersAiCatalog = {
|
|
|
720
794
|
},
|
|
721
795
|
],
|
|
722
796
|
},
|
|
723
|
-
'Text Embeddings': {
|
|
724
|
-
id: '0137cdcf-162a-4108-94f2-1ca59e8c65ee',
|
|
725
|
-
description: 'Feature extraction models transform raw data into numerical features that can be processed while preserving the information in the original dataset. These models are ideal as part of building vector search applications or Retrieval Augmented Generation workflows with Large Language Models (LLM).',
|
|
726
|
-
models: [
|
|
727
|
-
{
|
|
728
|
-
id: '57fbd08a-a4c4-411c-910d-b9459ff36c20',
|
|
729
|
-
source: 1,
|
|
730
|
-
name: '@cf/baai/bge-small-en-v1.5',
|
|
731
|
-
description: 'BAAI general embedding (Small) model that transforms any given text into a 384-dimensional vector',
|
|
732
|
-
tags: [],
|
|
733
|
-
properties: {
|
|
734
|
-
beta: true,
|
|
735
|
-
info: 'https://huggingface.co/BAAI/bge-base-en-v1.5',
|
|
736
|
-
max_input_tokens: 512,
|
|
737
|
-
output_dimensions: 384,
|
|
738
|
-
},
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
id: '429b9e8b-d99e-44de-91ad-706cf8183658',
|
|
742
|
-
source: 1,
|
|
743
|
-
name: '@cf/baai/bge-base-en-v1.5',
|
|
744
|
-
description: 'BAAI general embedding (Base) model that transforms any given text into a 768-dimensional vector',
|
|
745
|
-
tags: [],
|
|
746
|
-
properties: {
|
|
747
|
-
beta: true,
|
|
748
|
-
info: 'https://huggingface.co/BAAI/bge-base-en-v1.5',
|
|
749
|
-
max_input_tokens: 512,
|
|
750
|
-
output_dimensions: 768,
|
|
751
|
-
},
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
id: '01bc2fb0-4bca-4598-b985-d2584a3f46c0',
|
|
755
|
-
source: 1,
|
|
756
|
-
name: '@cf/baai/bge-large-en-v1.5',
|
|
757
|
-
description: 'BAAI general embedding (Large) model that transforms any given text into a 1024-dimensional vector',
|
|
758
|
-
tags: [],
|
|
759
|
-
properties: {
|
|
760
|
-
beta: true,
|
|
761
|
-
info: 'https://huggingface.co/BAAI/bge-base-en-v1.5',
|
|
762
|
-
max_input_tokens: 512,
|
|
763
|
-
output_dimensions: 1024,
|
|
764
|
-
},
|
|
765
|
-
},
|
|
766
|
-
],
|
|
767
|
-
},
|
|
768
797
|
Summarization: {
|
|
769
798
|
id: '6f4e65d8-da0f-40d2-9aa4-db582a5a04fd',
|
|
770
799
|
description: 'Summarization is the task of producing a shorter version of a document while preserving its important information. Some models can extract text from the original input, while other models can generate entirely new text.',
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { workersAiCatalog } from './catalog.js';
|
|
2
|
+
type cloudflareModelTypes = keyof typeof workersAiCatalog.modelGroups;
|
|
3
|
+
type cloudflareModelPossibilitiesRaw<M extends cloudflareModelTypes = cloudflareModelTypes> = (typeof workersAiCatalog.modelGroups)[M]['models'][number];
|
|
4
|
+
export type cloudflareModelPossibilities<M extends cloudflareModelTypes = cloudflareModelTypes> = cloudflareModelPossibilitiesRaw<M>['name'];
|
|
5
|
+
type cloudflareModelProperties<Model> = Model extends {
|
|
6
|
+
properties: infer Props;
|
|
7
|
+
} ? keyof Props : never;
|
|
8
|
+
type cloudflareModelPossibilitiesProperties<M extends cloudflareModelTypes = cloudflareModelTypes> = cloudflareModelProperties<cloudflareModelPossibilitiesRaw<M>>;
|
|
9
|
+
type cloudflareFilteredModelPossibilitiesRaw<M extends cloudflareModelTypes = cloudflareModelTypes, K extends cloudflareModelPossibilitiesProperties<M> = cloudflareModelPossibilitiesProperties<M>, V extends cloudflareModelPossibilitiesRaw<M>['properties'][K] = any> = cloudflareModelPossibilitiesRaw<M> extends infer Model ? (Model extends {
|
|
10
|
+
properties: Record<K, V>;
|
|
11
|
+
} ? Model : never) : never;
|
|
12
|
+
type cloudflareFilteredModelPossibilities<M extends cloudflareModelTypes = cloudflareModelTypes, K extends cloudflareModelPossibilitiesProperties<M> = cloudflareModelPossibilitiesProperties<M>, V extends cloudflareModelPossibilitiesRaw<M>['properties'][K] = any> = cloudflareFilteredModelPossibilitiesRaw<M, K, V>['name'];
|
|
13
|
+
export declare const enabledCloudflareLlmEmbeddingProviders: cloudflareModelPossibilities<'Text Embeddings'>[];
|
|
14
|
+
export declare const enabledCloudflareLlmProviders: cloudflareModelPossibilities<'Text Generation'>[];
|
|
15
|
+
export declare const enabledCloudflareLlmFunctionProviders: ("@cf/meta/llama-3.3-70b-instruct-fp8-fast" | "@hf/nousresearch/hermes-2-pro-mistral-7b")[];
|
|
16
|
+
export declare const enabledCloudflareLlmImageProviders: cloudflareModelPossibilities<'Text-to-Image'>[];
|
|
17
|
+
export type CloudflareModelsEnum<M extends cloudflareModelTypes = cloudflareModelTypes> = {
|
|
18
|
+
[K in cloudflareModelPossibilities<M>]: `workersai:${K}`;
|
|
19
|
+
};
|
|
20
|
+
export type CloudflareFunctionModelsEnum = {
|
|
21
|
+
[K in cloudflareFilteredModelPossibilities<'Text Generation', 'function_calling', true>]: `workersai:${K}`;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { workersAiCatalog } from './catalog.js';
|
|
2
|
+
// const enabledCloudflareLlmSummaryProviders: cloudflareModelPossibilities<'Summarization'>[] = workersAiCatalog.modelGroups.Summarization.models.map((model) => model.name);
|
|
3
|
+
// const enabledCloudflareLlmClassificationProviders: cloudflareModelPossibilities<'Text Classification'>[] = workersAiCatalog.modelGroups['Text Classification'].models.map((model) => model.name);
|
|
4
|
+
export const enabledCloudflareLlmEmbeddingProviders = workersAiCatalog.modelGroups['Text Embeddings'].models.map((model) => model.name);
|
|
5
|
+
export const enabledCloudflareLlmProviders = workersAiCatalog.modelGroups['Text Generation'].models.map((model) => model.name);
|
|
6
|
+
export const enabledCloudflareLlmFunctionProviders = workersAiCatalog.modelGroups['Text Generation'].models.filter((model) => 'function_calling' in model.properties && model.properties.function_calling).map((model) => model.name);
|
|
7
|
+
export const enabledCloudflareLlmImageProviders = workersAiCatalog.modelGroups['Text-to-Image'].models.map((model) => model.name);
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainfuse/types",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "ChainFuse",
|
|
6
6
|
"homepage": "https://github.com/ChainFuse/packages/tree/main/packages/types#readme",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"fmt": "prettier --check .",
|
|
26
26
|
"fmt:fix": "prettier --write .",
|
|
27
|
-
"lint": "eslint
|
|
27
|
+
"lint": "eslint src",
|
|
28
28
|
"lint:fix": "npm run lint -- --fix",
|
|
29
29
|
"clean": "npx -y rimraf@latest ./dist ./.tsbuildinfo",
|
|
30
30
|
"build": "tsc",
|
|
@@ -67,27 +67,22 @@
|
|
|
67
67
|
"import": "./dist/discourse/topic/index.js",
|
|
68
68
|
"types": "./dist/discourse/topic/index.d.ts"
|
|
69
69
|
},
|
|
70
|
-
"./super-ai": {
|
|
71
|
-
"import": "./dist/super-ai/index.js",
|
|
72
|
-
"types": "./dist/super-ai/index.d.ts"
|
|
73
|
-
},
|
|
74
|
-
"./super-ai/catalog/workers-ai": {
|
|
75
|
-
"import": "./dist/ai-tools/workers-ai-catalog.js",
|
|
76
|
-
"types": "./dist/ai-tools/workers-ai-catalog.d.ts"
|
|
77
|
-
},
|
|
78
70
|
"./ai-tools": {
|
|
79
71
|
"import": "./dist/ai-tools/index.js",
|
|
80
72
|
"types": "./dist/ai-tools/index.d.ts"
|
|
81
73
|
},
|
|
82
74
|
"./ai-tools/catalog/workers-ai": {
|
|
83
|
-
"import": "./dist/ai-tools/workers-ai
|
|
84
|
-
"types": "./dist/ai-tools/workers-ai
|
|
75
|
+
"import": "./dist/ai-tools/workers-ai/catalog.js",
|
|
76
|
+
"types": "./dist/ai-tools/workers-ai/catalog.d.ts"
|
|
77
|
+
},
|
|
78
|
+
"./ai-tools/catalog/azure": {
|
|
79
|
+
"import": "./dist/ai-tools/azure/catalog.js",
|
|
80
|
+
"types": "./dist/ai-tools/azure/catalog.d.ts"
|
|
85
81
|
}
|
|
86
82
|
},
|
|
87
83
|
"prettier": "@demosjarco/prettier-config",
|
|
88
84
|
"devDependencies": {
|
|
89
|
-
"@cloudflare/workers-types": "^4.
|
|
90
|
-
"@types/json-schema": "^7.0.15"
|
|
85
|
+
"@cloudflare/workers-types": "^4.20250320.0"
|
|
91
86
|
},
|
|
92
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "60babb051a4005d8495655784427e446fc7c7bcb"
|
|
93
88
|
}
|