SmartObjectAdapter

Wisej.AI.Adapters.SmartObjectAdapter

Namespace: Wisej.AI.Adapters

Assembly: Wisej.AI (3.5.0.0)

Converts unstructured text into a structured .NET object.

public class SmartObjectAdapter : SmartAdapter

This class provides methods to convert text, images, streams, and clipboard content into .NET objects. It supports OCR for image processing and can handle multiple iterations to resolve missing values.

Constructors

SmartObjectAdapter()

Initializes a new instance of the SmartObjectAdapter class.

SmartObjectAdapter(container)

Initializes a new instance of the SmartObjectAdapter class with the specified container.

Name
Type
Description

container

An IContainer that represents the container of the component.

Properties

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 SmartObjectAdapter and optionally releases the managed resources.

Parameter
Type
Description

disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources.

FromClipboardAsync<T>()

Converts the clipboard content to an object of type T .

Parameter
Type
Description

T

The type of the object to return.

Returns: Task<T>. A task that represents the asynchronous operation. The task result contains the converted object.

FromClipboardAsync(objectType)

Converts the clipboard content to an object of the specified type.

Parameter
Type
Description

objectType

The type of the object to return.

Returns: Task<Object>. A task that represents the asynchronous operation. The task result contains the converted object.

FromImageAsync<T>(image)

Converts the specified image to an object of type T .

Parameter
Type
Description

T

The type of the object to return.

image

The image to convert.

Returns: Task<T>. A task that represents the asynchronous operation. The task result contains the converted object.

FromImageAsync(image, objectType)

Converts the specified image to an object of the specified type.

Parameter
Type
Description

image

The image to convert.

objectType

The type of the object to return.

Returns: Task<Object>. A task that represents the asynchronous operation. The task result contains the converted object.

FromStreamAsync<T>(stream, streamType)

Converts the specified stream to an object of type T .

Parameter
Type
Description

T

The type of the object to return.

stream

The stream to convert.

streamType

The type of the stream. Default is null.

Returns: Task<T>. A task that represents the asynchronous operation. The task result contains the converted object.

FromStreamAsync(stream, objectType, streamType)

Converts the specified stream to an object of the specified type.

Parameter
Type
Description

stream

The stream to convert.

objectType

The type of the object to return.

streamType

The type of the stream. Default is null.

Returns: Task<Object>. A task that represents the asynchronous operation. The task result contains the converted object.

FromTextAsync<T>(text)

Converts the specified text to an object of type T .

Parameter
Type
Description

T

The type of the object to return.

text

The text to convert.

Returns: Task<T>. A task that represents the asynchronous operation. The task result contains the converted object.

FromTextAsync(text, objectType)

Converts the specified text to an object of the specified type.

Parameter
Type
Description

text

The text to convert.

objectType

The type of the object to return.

Returns: Task<Object>. A task that represents the asynchronous operation. The task result contains the converted object.

OnObjectParsed(args)

Raises the ObjectParsed event.

Parameter
Type
Description

args

The ObjectParsedEventArgs instance containing the event data.

RunAsyncCore(control)

Executes the core logic of the adapter asynchronously.

Parameter
Type
Description

control

The control to use for the operation.

Returns: Task<Message>. A task that represents the asynchronous operation. The task result contains the response message.

Events

ObjectParsed

ObjectParsedEventHandler Occurs when an object is parsed.

Implements

Name
Description

Represents a provider that supplies tools.

Last updated