SmartTextBoxAdapter
Last updated
Last updated
The SmartTextBoxAdapter enhances the Wisej.Web.TextBox control, incorporating artificial intelligence capabilities. As an component, once it is placed onto a design surface, it automatically augments all TextBox controls within the designer with additional AI-specific properties.
In addition to the properties inherited from the , the SmartTextBoxAdapter exposes the following additional properties.
This parameter specifies the delay, measured in milliseconds, before suggestions are displayed. It controls how soon the suggestions appear after the user pauses typing after pressing the space bar.
Suggestions are generated when the user types a space character. This approach ensures that the system sends more complete input to the AI model, avoiding the transmission of incomplete or partial text.
The AcceptIconSource property specifies the icon that appears next to the suggested text. By default, this icon is represented by a small icon, which provides a visual cue to the user. On mobile devices, tapping this icon allows users to accept the suggestion seamlessly.
Wisej.AI offers two accept icons: "tab-icon-dark.png" and "tab-icon-light.png." These icons can be used as themed icons under the names "tab-icon-dark" and "tab-icon-light," or accessed as embedded resources within the Wisej.AI assembly. The default setting uses "resource.wx/Wisej.AI/Icons/tab-icon-dark.png."
The CSS style applied to the suggested text defines its appearance once it is appended after the cursor. By default, this style is set to "opacity: 0.4," giving the text a lighter color to distinguish it from the regular input text.
This property determines whether the suggestions feature is activated for a specific control. When enabled, Wisej.AI attempts to predict and suggest the next piece of text based on the values provided in the UserRole and UserPhrases properties.
The UserRole property informs the AI model of the "role" it should emulate when generating suggestions. This contextual guidance allows the AI to tailor its suggestions according to the specified role, such as "Account Manager" or "Tech Support Specialist."
The UserPhrases property consists of a list of suggested completion lines for text. These phrases serve as contextual information for the AI model, guiding it on how to complete the user's sentences effectively.
This property can be used to define guidelines and potential answer templates, helping to shape more relevant and context-aware suggestions. For example, phrases like "Next service due at ___" and "Could you please post a screenshot of the issue" can be included to tailor the AI's responses.
This feature enables automatic translation of text within the TextBox. When the AutoRun property is set to true
, the translation process is triggered whenever the TextBox.Text property changes.
With this setting enabled, Wisej.AI utilizes the TranslateFromLanguage and TranslateToLanguage properties to inform the AI model of the original language and the desired target language, facilitating seamless translation.
This property holds a string that specifies the language of the original text. Acceptable values include language codes like "de," language names such as "German," or other identifiers like "en." Any value that the AI model can interpret for translation is suitable for this property.
This property holds a string that specifies the language of the target translated text. Acceptable values include language codes like "de," language names such as "German," or other identifiers like "en." Any value that the AI model can interpret for translation is suitable for this property.
This feature offers automatic correction of text within the TextBox. When enabled, Wisej.AI autonomously rectifies any typographical errors in the text entered by the user, ensuring that the original meaning is preserved. Note that this feature focuses solely on correcting errors and does not involve translating the text.
The ProcessingIconSource property specifies an icon that appears at the bottom right corner of the TextBox while the AI model is processing a request. By default, this is set to "resource.wx/Wisej.AI/Icons/processing.svg," which features an animated icon to visually indicate activity.