SmartComboBoxAdapter
Namespace: Wisej.AI.Adapters
Assembly: Wisej.AI
Adds semantic filtering to the ComboBox auto-complete functionality.
- C#
- VB.NET
public class SmartComboBoxAdapter : SmartAdapter, IExtenderProvider
Public Class SmartComboBoxAdapter
Inherits SmartAdapter
Implements IExtenderProvider
Works with the HuggingFaceJavaScriptEndpoint. Semantic filtering (items embedding) is entirely hosted on the user's browser and runs in JavaScript. Uses the HuggingFace TransformersJs library to run in-browser embeddings.
Constructors
SmartComboBoxAdapter()
Initializes a new instance of the SmartComboBoxAdapter class.
Properties
AutoRun
Boolean: Gets or sets a value indicating whether the adapter should run automatically. (Default: True)
Model
String: Gets or sets the embeddings model. See index for available models. The default is "Xenova/all-MiniLM-L6-v2". (Default: null)
Methods
GetSimilarity(control)
Gets the similarity level threshold needed for an item to qualify, ranging from 0.1 to 1.0 (1 means identical).
| Parameter | Type | Description |
|---|---|---|
| control | Control | The control for which to get the similarity level. |
Returns: Double. The minimum similarity level.
Throws:
- ArgumentNullException Thrown when the control is null.
OnControlCreated(control)
Handles the event when a control is created.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The control that was created. |
OnControlDisposed(control)
Handles the event when a control is disposed.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The control that was disposed. |
SetSimilarity(control, value)
Sets the similarity level threshold for an item to qualify.
| Parameter | Type | Description |
|---|---|---|
| control | Control | The control for which to set the similarity level. |
| value | Double | The similarity level, must be between 0 and 1. |
Throws:
- ArgumentNullException Thrown when the control is null.
- ArgumentException Thrown when the value is not between 0 and 1.
Implements
| Name | Description |
|---|---|
| IToolProvider | Represents a provider that supplies tools. |