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
  • Overview
  • Configuration
  • Properties
  • User
  • BotName
  • BotAvatar
  • ChatBox
  • Events
  • ExecuteAction
Export as PDF
  1. Components
  2. Built-in SmartAdapters

SmartCopilotAdapter

Overview

Turns a ChatBox control into an AI-powered assistant, enhancing its capabilities to manage and navigate an application. It can perform tasks such as clicking on menu items, navigation bar elements, buttons, and more. Additionally, it provides the ability to invoke methods within your applications through the use of custom tools.

The adapter uses the associated ChatBox control to identify the top-level control, such as a Form, Page, or Desktop. Once identified, it crawls the following set of controls to construct a map of actionable items that it can execute in response to a user prompt:

  1. NavigationBar: A component typically used for navigation through different sections or views within the application.

  2. MenuBar: This control generally provides access to application-wide commands and functions organized in a menu format.

  3. ToolBar: A toolbar usually includes buttons for quick access to frequently used commands and tools.

  4. RibbonBar: Often a more advanced control providing a tabbed bar interface with grouped commands, improving accessibility and user experience.

The adapter utilizes the Name, Text, and TooltipText properties of each control to enrich the action map, enabling the AI model to make informed decisions about which action to invoke based on a user prompt.

This is the built-in prompt:

#
# SmartCopilotAdapter
#
[SmartCopilotAdapter.Prompt]
Your task is to identify the action the user wants to execute from the Actions provided below.

```Actions
{{actions}}
```

Each action is defined as follows:

{
  "id": "<unique action identifier>"
  "name": "<name of the action>",
  "text": "<text displayed to the user>",
  "description": "<description of the action>",
  "actions": [
	  <array of child actions>
  ]
}

## Rules:
- Provide your answer without explanations
- You are not allowed to ask additional questions
- Use the "text" and "description" fields to select the most appropriate action
- If you cannot find a match, return null in the "id" field and the explanation in the "steps" field
- Output your response as a JSON object and nothing else
- Your response should be a single JSON object with the following format:

{
  "id": "<unique identifier of the action, or null>",
  "data": "<additional data extracted from the user’s question>",
  "steps": "<brief explanation of the steps the user can click to execute the action>",
  "execute": <true if the user wants to execute the action|false if the user just wants help>
}

At present, the system does not support selecting multiple choices when a user request potentially qualifies more than one action

To enhance the capabilities of the adapter, you can simply integrate additional tools. For example, if you wish to enable users to perform tasks such as typing "Send an email to...", you would add an email tool to the adapter.

[SmartTool.Tool]
[Description("Sends an email message.")]
private void SendEmailMessage(
	[Description("Email address of the recipient.")] string destinationEmail,

	[Description("Subject line.")] string subject,

	[Description("Message text.")] string message) {

	// code to send an email, or open a dialog box.
}

this.adapter.UseTool(SendEmailMessage);

Configuration

[Extends(typeof(ChatBox), allowMultiple: false)]

Properties

User

Represents the AI user in the ChatBox as an instance of the ChatBox.User class. This property is read-only and identifies the AI participant within the chat interface. To customize the AI’s display name or avatar, use the BotName and BotAvatar properties, respectively. The property itself cannot be reassigned, but you can modify the AI user's appearance through these options.

BotName

The BotName property specifies the display name of the AI bot within the ChatBox. By default, this name is set to "Wisej." You can use this property to assign a custom name to your bot, allowing you to better personalize the chat experience for your application’s users.

BotAvatar

The BotAvatar property specifies the image that represents the AI bot in the ChatBox. You can set this property to either the name of a built-in image or the URL of a custom image. This allows you to personalize the bot's appearance by displaying a specific avatar in the chat interface.

ChatBox

The ChatBox property is read-only and returns the instance of the ChatBox control associated with the adapter. This association is established when you call this.smartHub.GetAI(this.chatBox) and assign the adapter using this.smartHub.GetAI(this.chatBox).Adapter = this.smartChatBoxAdapter. The property provides access to the specific ChatBox control that is linked to the current AI adapter instance.

Events

ExecuteAction

The ExecuteAction event is triggered after the adapter identifies the target component but before any action is taken. You have the option to handle this event and set e.Handled to true if you wish to intercept and execute the requested command yourself.

Name
Description

e.Target

The Wisej.NET component that was identified by the AI model for action.

e.Parameters

A string containg any extra data present in the user prompt.

PreviousSmartComboBoxAdapterNextSmartDataEntryAdapter

Last updated 3 days ago

In addition to the properties inherited from the , the SmartCopilotAdapter exposes the following additional properties.

SmartAdapter