LogoLogo
HomeNewsSupportVideos
  • Welcome
  • Wisej.NET
  • Concepts
    • Getting Started
    • General Concepts
    • Architecture
    • Extensibility
    • AI Providers
    • Vector Databases
    • Usage Metrics
    • Logging & Error Handling
  • Markup
  • Components
    • API
      • SmartAdapter
        • SmartAudioTTSAdapter
        • SmartAudioWhisperAdapter
        • SmartCalendarAdapter
        • SmartChartAdapter
        • SmartChartJS3Adapter
        • SmartChatBoxAdapter
        • SmartComboBoxAdapter
        • SmartCopilotAdapter
        • SmartDataEntryAdapter
        • SmartDocumentAdapter
        • SmartFullCalendarAdapter
        • SmartObjectAdapter
        • SmartPictureBoxAdapter
        • SmartQueryAdapter
        • SmartRealtimeAdapter
        • SmartReportAdapter
        • SmartTextBoxAdapter
        • SmartAdapter.ExtendsAttribute
        • SmartAdapter.FieldNameAttribute
        • SmartAdapter.FieldPromptAttribute
        • SmartAdapter.FieldRectangleAttribute
        • SmartAdapter.WorksWithAttribute
      • SmartEndpoint
        • AmazonBedrockEndpoint
        • AnthropicEndpoint
        • AzureAIEndpoint
        • CerebrasEndpoint
        • DeepSeekEndpoint
        • GoogleAIEndpoint
        • GroqCloudEndpoint
        • GroqCloudEndpointWhisper
        • HuggingFaceEndpoint
        • HuggingFaceJavaScriptEndpoint
        • LocalAIEndpoint
        • LocalAIEndpointImageGen
        • LocalAIEndpointTTS
        • LocalAIEndpointWhisper
        • NvidiaAIEndpoint
        • OllamaEndpoint
        • OpenAIEndpoint
        • OpenAIEndpointDallE
        • OpenAIEndpointRealtime
        • OpenAIEndpointTTS
        • OpenAIEndpointWhisper
        • SambaNovaEndpoint
        • SmartHttpEndpoint
        • TogetherAIEndpoint
        • XAIEndpoint
        • SmartEndpoint.Metrics
        • SmartEndpoint.Response
      • SmartExtensions
      • SmartHub
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartObject
      • SmartPrompt
        • SmartAgentPrompt
        • SmartParallelPrompt
        • SmartPrompt.Parameter
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartRealtimeSession
      • SmartSession
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.Message
        • SmartSession.MessageCollection
        • SmartSession.MessageRole
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
        • SmartSession.TrimmingStrategy
      • SmartTool
        • SmartTool.IToolProvider
        • SmartTool.ToolAttribute
        • SmartTool.ToolContext
      • Markup
        • MarkupExtensions
      • Controls
        • UVLightOverlay
      • Embeddings
        • EmbeddedDocument
        • Embedding
        • Matches
        • Metadata
      • Helpers
        • ApiKeys
        • Markdown
        • TextTokenizer
      • Services
        • DefaultSessionTrimmingService
        • IDocumentConversionService
          • DefaultDocumentConversionService
        • IEmbeddingGenerationService
          • DefaultEmbeddingGenerationService
          • HuggingFaceEmbeddingGenerationService
        • IEmbeddingStorageService
          • AzureAISearchEmbeddingStorageService
          • ChromaEmbeddingStorageService
          • FileSystemEmbeddingStorageService
          • MemoryEmbeddingStorageService
          • PineconeEmbeddingStorageService
          • QdrantEmbeddingStorageService
        • IHttpClientService
          • DefaultHttpClientService
        • ILoggerService
          • DefaultLoggerService
        • IOCRService
          • DefaultOCRService
        • IRerankingService
          • DefaultRerankingService
          • LocalAIRerankingService
          • PineconeRerankingService
        • ISessionTrimmingService
          • DefaultSessionTrimmingService
        • ITextSplitterService
          • RecursiveCharacterTextSplitterService
          • TextSplitterServiceBase
        • ITokenizerService
          • DefaultTokenizerService
        • IWebSearchService
          • BingWebSearchService
          • BraveWebSearchService
          • GoogleWebSearchService
      • Tools
        • ArxivTools
        • ChartJS3Tools
        • DatabaseTools
        • DataTableFilterTools
        • DocumentSearchTools
        • DocumentTools
        • FullCalendarTools
        • IToolsContainer
        • MathTools
        • ToolsContainer
        • UtilityTools
        • WebSearchTools
    • Built-in Services
      • IOCRService
      • ILoggerService
      • ITextSplitterService
      • ITokenizerService
      • IHttpClientService
      • IWebSearchService
      • IRerankingService
      • ISessionTrimmingService
      • IDocumentConversionService
      • IEmbeddingStorageService
      • IEmbeddingGenerationService
    • Built-in SmartTools
      • ToolsContainer
      • MathTools
      • UtilityTools
      • DatabaseTools
      • DocumentTools
      • DocumentSearchTools
      • WebSearchTools
      • ChartJS3Tools
      • FullCalendarTools
    • Built-in SmartAdapters
      • SmartAdapter
      • SmartAudioTTSAdapter
      • SmartAudioWhisperAdapter
      • SmartCalendarAdapter
      • SmartChartAdapter
      • SmartChartJS3Adapter
      • SmartChatBoxAdapter
      • SmartComboBoxAdapter
      • SmartCopilotAdapter
      • SmartDataEntryAdapter
      • SmartDocumentAdapter
      • SmartFullCalendarAdapter
      • SmartObjectAdapter
      • SmartPictureBoxAdapter
      • SmartQueryAdapter
      • SmartRealtimeAdapter
      • SmartReportAdapter
      • SmartTextBoxAdapter
    • Configure Services
    • Using SmartHub
    • Using SmartTools
    • Using SmartPrompt
    • Using SmartSession
    • Using SmartRealTimeAdapter
    • UVLightOverlay Control
Powered by GitBook
On this page
  • Constructors
  • SmartHub()
  • SmartHub(containerControl)
  • SmartHub(container)
  • Properties
  • BindingContext
  • ContainerControl
  • Culture
  • DataSource
  • Endpoint
  • IsDisposed
  • Methods
  • AskAsync(question, image, systemPrompt)
  • Dispose(disposing)
  • EmbedAsync(text)
  • EmbedAsync(chunks)
  • GetAdapter(control)
  • GetAdapter<T>(control)
  • GetAI(control)
  • GetParameterValue(parameter)
  • IngestDocumentAsync(filePath, documentName, collectionName, metadata, overwrite)
  • IngestDocumentAsync(stream, documentName, collectionName, overwrite, metadata)
  • RemoveAdapter(adapter)
  • RemoveTool(tool)
  • SimilarityQueryAsync(query, chunks, topN, minSimilarity, computeSimilarity)
  • SimilarityQueryAsync(query, chunks, vectors, topN, minSimilarity, computeSimilarity)
  • SimilarityScoreAsync(query, chunks, computeSimilarity)
  • SimilarityScoreAsync(query, chunks, embeddings, computeSimilarity)
  • UseTool(tool)
  • UseTools(target)
  • Implements
Export as PDF
  1. Components
  2. API

SmartHub

Wisej.AI.SmartHub

PreviousSmartExtensionsNextSmartSession.ConvertParameterEventArgs

Last updated 5 days ago

Namespace: Wisej.AI

Assembly: Wisej.AI (3.5.0.0)

Represents a SmartHub component that provides AI capabilities to controls within a container.

public class SmartHub : SmartObject, IExtenderProvider, IToolProvider
Public Class SmartHub
    Inherits SmartObject
    Implements IExtenderProvider, IToolProvider

The SmartHub class is an extender provider that allows controls to be extended with AI functionalities. It manages various services and tools to facilitate AI operations, such as embedding generation, document conversion, and similarity queries.

Constructors

SmartHub()

Initializes a new instance of the class.

SmartHub(containerControl)

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

Name
Type
Description

containerControl

The container control to which the SmartHub is attached.

Throws:

  • Thrown when the containerControl is null.

Name
Type
Description

container

Properties

Methods

Asynchronously asks a question and returns a response message.

Parameter
Type
Description

question

The question to ask.

An optional image to include in the question. Default is null.

Option system prompt.

Throws:

Parameter
Type
Description

disposing

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

Asynchronously generates an embedding for a specified text.

Parameter
Type
Description

text

The text to embed.

Asynchronously generates an embedding for a specified array of text chunks.

Parameter
Type
Description

chunks

The text chunks to embed.

Throws:

Gets the adapter associated with a specified control.

Parameter
Type
Description

control

The control for which to get the adapter.

Throws:

Gets the adapter of a specified type associated with a specified control.

Parameter
Type
Description

T

The type of the adapter.

control

The control for which to get the adapter.

Throws:

Gets the AI properties for a specified control.

Parameter
Type
Description

control

The control for which to get the AI properties.

Gets the value of a specified parameter.

Parameter
Type
Description

parameter

The parameter for which to get the value.

Throws:

Asynchronously ingests a document from a specified file path.

Parameter
Type
Description

filePath

The file path of the document to ingest.

documentName

The name of the document.

The name of the collection. Default is null.

The metadata for the document. Default is null.

Whether to overwrite an existing document. Default is false.

Asynchronously ingests a document from a specified stream.

Parameter
Type
Description

stream

The stream of the document to ingest.

documentName

The name of the document.

The name of the collection. Default is null.

Whether to overwrite an existing document. Default is false.

The metadata for the document. Default is null.

Removes a specified adapter from the SmartHub.

Parameter
Type
Description

adapter

The adapter to remove.

Throws:

Removes a tool from the SmartHub.

Parameter
Type
Description

tool

The tool to remove.

Throws:

Asynchronously performs a similarity query on a specified query and text chunks.

Parameter
Type
Description

query

The query text.

chunks

The text chunks to compare against.

topN

The number of top results to return.

minSimilarity

The minimum similarity threshold.

The function to compute similarity. Default is null.

Throws:

Asynchronously performs a similarity query on a specified query, text chunks, and vectors.

Parameter
Type
Description

query

The query text.

chunks

The text chunks to compare against.

vectors

The vectors to compare against.

topN

The number of top results to return.

minSimilarity

The minimum similarity threshold.

The function to compute similarity. Default is null.

Throws:

Asynchronously calculates similarity scores for a specified query and text chunks.

Parameter
Type
Description

query

The query text.

chunks

The text chunks to compare against.

The function to compute similarity. Default is null.

Throws:

Asynchronously calculates similarity scores for a specified query, text chunks, and embeddings.

Parameter
Type
Description

query

The query text.

chunks

The text chunks to compare against.

embeddings

The embeddings to compare against.

The function to compute similarity. Default is null.

Throws:

Adds a tool to the SmartHub.

Parameter
Type
Description

tool

The tool to add.

Throws:

Uses tools from a specified target.

Parameter
Type
Description

target

The target from which to use tools.

Implements

Name
Description

Represents a provider that supplies tools.

SmartHub(container)

Initializes a new instance of the class attached to an implementation.

An that represents the container of the extender.

BindingContext

: Gets the binding context for the SmartHub.

ContainerControl

: Returns or sets the container that provides the for binding to the interface implemented by a . (Default: null)

Culture

: Gets or sets the culture information for the SmartHub. (Default: null)

DataSource

: Gets or sets a data source that can be used to resolve prompt parameters. (Default: null)

Endpoint

: Gets or sets the default endpoint. (Default: null)

IsDisposed

: Gets a value indicating whether the SmartHub is disposed.

AskAsync(question, image, systemPrompt)

image

systemPrompt

Returns: . A task representing the asynchronous operation, with a as the result.

Thrown when the question is null.

Dispose(disposing)

Releases the unmanaged resources used by the and optionally releases the managed resources.

EmbedAsync(text)

Returns: . A task representing the asynchronous operation, with an as the result.

EmbedAsync(chunks)

Returns: . A task representing the asynchronous operation, with an as the result.

Thrown when the chunks array is null.

GetAdapter(control)

Returns: . The associated with the control, or null if none exists.

Thrown when the control is null.

GetAdapter<T>(control)

Returns: . The adapter of type T associated with the control, or null if none exists.

Thrown when the control is null.

GetAI(control)

Returns: . The associated with the control.

GetParameterValue(parameter)

Returns: . The value of the parameter as a string.

Thrown when the parameter is null.

IngestDocumentAsync(filePath, documentName, collectionName, metadata, overwrite)

collectionName

metadata

overwrite

Returns: . A task representing the asynchronous operation, with an as the result.

This method utilizes several services to perform its operations: , and , and , and .Throws:

Thrown when the filePath or documentName is null.

IngestDocumentAsync(stream, documentName, collectionName, overwrite, metadata)

collectionName

overwrite

metadata

Returns: . A task representing the asynchronous operation, with an as the result.

This method utilizes several services to perform its operations: , and , and , and .Throws:

Thrown when the stream or documentName is null.

RemoveAdapter(adapter)

Thrown when the adapter is null.

RemoveTool(tool)

Returns: . The current instance.

Thrown when the tool is null.

SimilarityQueryAsync(query, chunks, topN, minSimilarity, computeSimilarity)

computeSimilarity

Returns: . A task representing the asynchronous operation, with an array of strings as the result.

Thrown when the query or chunks are null.

SimilarityQueryAsync(query, chunks, vectors, topN, minSimilarity, computeSimilarity)

computeSimilarity

Returns: . A task representing the asynchronous operation, with an array of strings as the result.

Thrown when the query, chunks, or vectors are null.

SimilarityScoreAsync(query, chunks, computeSimilarity)

computeSimilarity

Returns: . A task representing the asynchronous operation, with an array of floats as the result.

Thrown when the query or chunks are null.

SimilarityScoreAsync(query, chunks, embeddings, computeSimilarity)

computeSimilarity

Returns: . A task representing the asynchronous operation, with an array of floats as the result.

Thrown when the query, chunks, or embeddings are null.

UseTool(tool)

Returns: . The current instance.

Thrown when the tool is null.

UseTools(target)

Returns: . The current instance.

SmartHub
IContainer
BindingContext
CultureInfo
Object
SmartEndpoint
Boolean
Task<Message>
Message
ArgumentNullException
SmartHub
Task<Embedding>
Embedding
Task<Embedding>
Embedding
ArgumentNullException
SmartAdapter
SmartAdapter
ArgumentNullException
T
ArgumentNullException
Properties
Properties
Object
ArgumentNullException
Task<EmbeddedDocument>
EmbeddedDocument
ITextSplitterService
IDocumentConversionService
IEmbeddingGenerationService
IEmbeddingStorageService
ArgumentNullException
Task<EmbeddedDocument>
EmbeddedDocument
ITextSplitterService
IDocumentConversionService
IEmbeddingGenerationService
IEmbeddingStorageService
ArgumentNullException
ArgumentNullException
SmartHub
SmartHub
ArgumentNullException
Task<String[]>
ArgumentNullException
Task<String[]>
ArgumentNullException
Task<Single[]>
ArgumentNullException
Task<Single[]>
ArgumentNullException
SmartHub
SmartHub
ArgumentNullException
SmartHub
SmartHub
Control
Control
IDataErrorInfo
BindingContext
DataSource
ContainerControl
IContainer
IContainer
SmartHub
String
Image
String
Boolean
String
String[]
Control
Control
Control
Parameter
String
String
String
Metadata
Boolean
Stream
String
String
Boolean
Metadata
SmartAdapter
Delegate
String
String[]
Int32
Single
Func<Single[], Single[][], Single[]>
String
String[]
Single[][]
Int32
Single
Func<Single[], Single[][], Single[]>
String
String[]
Func<Single[], Single[][], Single[]>
String
String[]
Single[][]
Func<Single[], Single[][], Single[]>
Delegate
Object
IToolProvider
SmartObject
SmartHub
SmartHub
SmartHub
ArgumentNullException