SmartDataEntryAdapter
Wisej.AI.Adapters.SmartDataEntryAdapter
Namespace: Wisej.AI.Adapters
Assembly: Wisej.AI (3.5.0.0)
Enhances all the controls in the associated container with the AI-powered capability to extract structured data from unstructured text.
public class SmartDataEntryAdapter : SmartAdapter, IExtenderProvider
Works with:
AzureAI/OpenAI gpt-4
AzureAI/OpenAI gpt-4o
AzureAI/OpenAI gpt-3.5
AzureAI/Anthropic Claude
Google Gemini
Llama3:8b and 70b
Supports several types of sources for the input text: Clipboard (text or image), PDF stream, Text, Word, Excel. Uses the Tesseract extension to run the OCR text extraction on the user's browser in JavaScript.
Constructors
SmartDataEntryAdapter()

Initializes a new instance of the SmartDataEntryAdapter class.
SmartDataEntryAdapter(container)

Initializes a new instance of the SmartDataEntryAdapter class with the specified container.
Properties
ExcludeReadOnly

Boolean: Gets or sets a value indicating whether read-only controls should be excluded. (Default: False
)
MaxIterations

Int32: Gets or sets the maximum number of times the adapter will try to use the available tools to complete the missing values. (Default: 2
)
If the adapter was not provided any tool, this property is ignored since it will not try to resolve missing values.
UseOCR

Boolean: Gets or sets a value indicating whether OCR should be used for image processing. (Default: False
)
Methods
Dispose(disposing)

Releases the unmanaged resources used by the SmartDataEntryAdapter and optionally releases the managed resources.
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
FromClipboardAsync()

Asynchronously processes data from the clipboard and extracts structured data.
Returns: Task. A task representing the asynchronous operation.
Throws:
InvalidOperationException Thrown when the SmartAdapter is busy.
FromImageAsync(image)

Asynchronously processes the provided image and extracts structured data.
Returns: Task. A task representing the asynchronous operation.
Throws:
ArgumentNullException Thrown when the image is null.
InvalidOperationException Thrown when the SmartAdapter is busy.
FromStreamAsync(stream, streamType)

Asynchronously processes the provided stream and extracts text and image data. If an image is detected without associated text, the method attempts to perform OCR to extract text.
Returns: Task. A task representing the asynchronous operation.
Throws:
ArgumentNullException Thrown when the stream is null.
InvalidOperationException Thrown when the SmartAdapter is busy.
FromTextAsync(text)

Asynchronously processes the provided text and extracts structured data.
Returns: Task. A task representing the asynchronous operation.
Throws:
ArgumentNullException Thrown when the text is null.
InvalidOperationException Thrown when the SmartAdapter is busy.
GetFieldName(component)

Gets the name of the field to extract for the specified component.
Returns: String. The name of the field to extract.
Throws:
ArgumentNullException Thrown when the component is null.
GetFieldPrompt(component)

Returns: String.
GetFieldRectangle(component)

Gets the rectangle that defines the area of the field to extract for the specified component.
Returns: Nullable<Rectangle>. The rectangle that defines the area of the field to extract.
Throws:
ArgumentNullException Thrown when the component is null.
OnParseValue(e)

Raises the ParseValue event.
OnUpdateField(e)

Raises the UpdateField event.
RunAsyncCore(control)

Asynchronously runs the core logic of the adapter on the specified control.
Returns: Task<Message>. A task representing the asynchronous operation.
SetFieldName(component, value)

Sets the name of the field to extract for the specified component.
Throws:
ArgumentNullException Thrown when the component is null.
SetFieldPrompt(component, value)

Sets the prompt to instruct the AI on how to extract the value for the field for the specified component.
Throws:
ArgumentNullException Thrown when the component is null.
SetFieldRectangle(component, value)

Sets the rectangle that defines the area of the field to extract for the specified component.
Throws:
ArgumentNullException Thrown when the component is null.
Events
ParseValue

ParseValueEventHandler Occurs when a value is parsed from the input data.
UpdateField

UpdateFieldEventHandler Occurs when a field is updated with a new value.
Implements
Represents a provider that supplies tools.
Last updated