Constructors
constructor
- new AI(ai: Ai): AI
Returns AI
Properties
Accessors
binding
- get binding(): Ai
Returns Ai
Methods
imageClassification
- imageClassification(
model: "@cf/microsoft/resnet-50",
inputs: AiImageClassificationInput,
options?: AI.Options,
): Promise<AiImageClassificationOutput> Parameters
- model: "@cf/microsoft/resnet-50"
- inputs: AiImageClassificationInput
Optional
options: AI.Options
Returns Promise<AiImageClassificationOutput>
imageToText
- imageToText(
model: BaseAiImageToTextModels,
inputs: AiImageToTextInput,
options?: AI.Options,
): Promise<AiImageToTextOutput> Parameters
- model: BaseAiImageToTextModels
- inputs: AiImageToTextInput
Optional
options: AI.Options
Returns Promise<AiImageToTextOutput>
objectDetection
- objectDetection(
model: "@cf/facebook/detr-resnet-50",
inputs: AiObjectDetectionInput,
options?: AI.Options,
): Promise<AiObjectDetectionOutput> Parameters
- model: "@cf/facebook/detr-resnet-50"
- inputs: AiObjectDetectionInput
Optional
options: AI.Options
Returns Promise<AiObjectDetectionOutput>
speechRecognition
- speechRecognition(
model: BaseAiSpeechRecognitionModels,
inputs: AiSpeechRecognitionInput,
options?: AI.Options,
): Promise<AiSpeechRecognitionOutput> Parameters
- model: BaseAiSpeechRecognitionModels
- inputs: AiSpeechRecognitionInput
Optional
options: AI.Options
Returns Promise<AiSpeechRecognitionOutput>
summarization
- summarization(
model: "@cf/facebook/bart-large-cnn",
inputs: AiSummarizationInput,
options?: AI.Options,
): Promise<AiSummarizationOutput> Parameters
- model: "@cf/facebook/bart-large-cnn"
- inputs: AiSummarizationInput
Optional
options: AI.Options
Returns Promise<AiSummarizationOutput>
textClassification
- textClassification(
model: "@cf/huggingface/distilbert-sst-2-int8",
inputs: AiTextClassificationInput,
options?: AI.Options,
): Promise<AiTextClassificationOutput> Parameters
- model: "@cf/huggingface/distilbert-sst-2-int8"
- inputs: AiTextClassificationInput
Optional
options: AI.Options
Returns Promise<AiTextClassificationOutput>
textEmbeddings
- textEmbeddings(
model: BaseAiTextEmbeddingsModels,
inputs: AiTextEmbeddingsInput,
options?: AI.Options,
): Promise<AiTextEmbeddingsOutput> Parameters
- model: BaseAiTextEmbeddingsModels
- inputs: AiTextEmbeddingsInput
Optional
options: AI.Options
Returns Promise<AiTextEmbeddingsOutput>
textGeneration
- textGeneration(
model: BaseAiTextGenerationModels,
inputs: AiTextGenerationInput,
options?: AI.Options,
): Promise<AiTextGenerationOutput> Parameters
- model: BaseAiTextGenerationModels
- inputs: AiTextGenerationInput
Optional
options: AI.Options
Returns Promise<AiTextGenerationOutput>
textToImage
- textToImage(
model: BaseAiTextToImageModels,
inputs: AiTextToImageInput,
options?: AI.Options,
): Promise<AiTextToImageOutput> Parameters
- model: BaseAiTextToImageModels
- inputs: AiTextToImageInput
Optional
options: AI.Options
Returns Promise<AiTextToImageOutput>
translation
- translation(
model: "@cf/meta/m2m100-1.2b",
inputs: AiTranslationInput,
options?: AI.Options,
): Promise<AiTranslationOutput> Parameters
- model: "@cf/meta/m2m100-1.2b"
- inputs: AiTranslationInput
Optional
options: AI.Options
Returns Promise<AiTranslationOutput>
Run machine learning models, such as LLMs in your Edge-first application.