Skip to content

Latest commit

 

History

History
370 lines (223 loc) · 42.9 KB

File metadata and controls

370 lines (223 loc) · 42.9 KB

Supported API's

This package supports many of the API's within the Microsoft.Windows.AI.Text, Microsoft.Windows.AI.Imaging, and Microsoft.Windows.AI namespaces. This package is designed to expose a JavaScript API surface of the native Windows AI API's. Class, method, enum, and parameter names in this package are designed to replicate their native counterparts in WinAppSDK.

Below is the list of supported API's for the @microsoft/windows-ai-electron package. For usage information, see the Usage Guide.

Core Classes

LanguageModel

Main class for text generation and AI model interactions. Maps to WinAppSDK Microsoft.Windows.AI.Text.LanguageModel

Static Methods:

Instance Methods:

Important

This method uses a Windows API which is a part of a Limited Access Feature. To request an unlock token, please use the LAF Access Token Request Form. To use this method, you must first call LimitedAccessFeature.TryUnlockToken. See Usage.md for usage examples.

LanguageModelOptions

Configuration options for language model behavior. Maps to WinAppSDK Microsoft.Windows.AI.Text.LanguageModelOptions

Properties:

LanguageModelResponseResult

Contains the result of a text generation operation. Maps to WinAppSDK Microsoft.Windows.AI.Text.LanguageModelResponseResult

Properties:

TextSummarizer

Main class for AI-powered text and conversation summarization. Maps to WinAppSDK Microsoft.Windows.AI.Text.TextSummarizer

Constructor:

Instance Methods:

ConversationItem

Represents a single message in a conversation for summarization. Maps to WinAppSDK Microsoft.Windows.AI.Text.ConversationItem

Constructor:

Properties:

ConversationSummaryOptions

Configuration options for conversation summarization. Maps to WinAppSDK Microsoft.Windows.AI.Text.ConversationSummaryOptions

Properties:

TextRewriter

Main class for AI-powered text rewriting and tone adjustment. Maps to WinAppSDK Microsoft.Windows.AI.Text.TextRewriter

Constructor:

Instance Methods:

TextToTableConverter

Main class for AI-powered conversion of text content into structured table format. Maps to WinAppSDK Microsoft.Windows.AI.Text.TextToTableConverter

Constructor:

Instance Methods:

TextToTableResponseResult

Result object containing structured table data from text conversion operations. Maps to WinAppSDK Microsoft.Windows.AI.Text.TextToTableResponseResult

Properties:

Methods:

TextToTableRow

Represents a single row in a converted table structure. Maps to WinAppSDK Microsoft.Windows.AI.Text.TextToTableRow

Methods:

AIFeatureReadyResult

Result object for AI feature readiness operations. Maps to WinAppSDK Microsoft.Windows.AI.AIFeatureReadyResult

Properties:

Imaging Classes

ImageDescriptionGenerator

Main class for generating descriptions and captions for images. Maps to WinAppSDK Microsoft.Windows.AI.Imaging.ImageDescriptionGenerator

Static Methods:

Instance Methods:

ImageDescriptionResult

Contains the result of an image description operation. Maps to WinAppSDK Microsoft.Windows.AI.Imaging.ImageDescriptionResult

Properties:

TextRecognizer

Main class for optical character recognition (OCR) on images. Maps to WinAppSDK Microsoft.Windows.AI.Imaging.TextRecognizer

Static Methods:

Instance Methods:

RecognizedText

Contains the complete text recognition results from an image. Maps to WinAppSDK Microsoft.Windows.AI.Imaging.RecognizedText

Properties:

RecognizedLine

Represents a single line of recognized text. Maps to WinAppSDK Microsoft.Windows.AI.Imaging.RecognizedLine

Properties:

RecognizedWord

Represents a single recognized word. Maps to WinAppSDK Microsoft.Windows.AI.Imaging.RecognizedWord

Properties:

RecognizedTextBoundingBox

Defines the bounding box coordinates for recognized text elements. Maps to WinAppSDK Microsoft.Windows.AI.Imaging.RecognizedTextBoundingBox

Properties:

Content Safety Classes

ContentFilterOptions

Configuration for content filtering policies. Maps to WinAppSDK Microsoft.Windows.AI.ContentSafety.ContentFilterOptions

Properties:

ImageContentFilterSeverity

Severity levels for different types of image content. Maps to WinAppSDK Microsoft.Windows.AI.ContentSafety.ImageContentFilterSeverity

Properties:

TextContentFilterSeverity

Severity levels for different types of text content. Maps to WinAppSDK Microsoft.Windows.AI.ContentSafety.TextContentFilterSeverity

Properties:

Limited Access Features Classes

Important

This class is currently needed to be able to use GenerateResponseAsync. To use this class, you will need to request an unlock token, please use the LAF Access Token Request Form.

LimitedAccessFeatures

Provides access to Windows limited access features that require special permissions or tokens. Maps to WinAppSDK Windows.ApplicationModel.LimitedAccessFeatures

Static Methods:

Important

When attempting to gain access to GenerateResponseAsync, the feature ID should be com.microsoft.windows.ai.languagemodel and the developer signature should be <insert-app-id> has registered their use of com.microsoft.windows.ai.languagemodel with Microsoft and agrees to the terms of use..

LimitedAccessFeatureRequestResult

Contains the result of a limited access feature unlock request. Maps to WinAppSDK Windows.ApplicationModel.LimitedAccessFeatureRequestResult

Properties:

Enums and Constants

AIFeatureReadyState

Maps to WinAppSDK Microsoft.Windows.AI.AIFeatureReadyState

LanguageModelResponseStatus

Maps to WinAppSDK Microsoft.Windows.AI.Text.LanguageModelResponseStatus

SeverityLevel

Maps to WinAppSDK Microsoft.Windows.AI.ContentSafety.SeverityLevel

AIFeatureReadyResultState

Maps to WinAppSDK Microsoft.Windows.AI.AIFeatureReadyResultState

ImageDescriptionKind

Maps to WinAppSDK Microsoft.Windows.AI.Imaging.ImageDescriptionKind

TextRewriteTone

Maps to WinAppSDK Microsoft.Windows.AI.Text.TextRewriteTone

ImageDescriptionResultStatus

Maps to WinAppSDK Microsoft.Windows.AI.Imaging.ImageDescriptionResultStatus

RecognizedLineStyle

Maps to WinAppSDK Microsoft.Windows.AI.Imaging.RecognizedLineStyle

LimitedAccessFeatureStatus

Maps to WinAppSDK Windows.ApplicationModel.LimitedAccessFeatureStatus