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
  • SmartDocumentAdapter()
  • Properties
  • AutoReset
  • BotAvatar
  • BotName
  • ChatBox
  • ConversionService
  • FilePath
  • FileType
  • MaxClusters
  • MinSimilarity
  • Stream
  • TextSplitterService
  • TopN
  • User
  • Methods
  • AskAsync(question)
  • OnAnswerReceived(e)
  • OnControlCreated(control)
  • OnControlDisposed(control)
  • ParseAnswer(text)
  • ParseSourceText(text)
  • ResetSession(removeMessages)
  • RunAsyncCore(control)
  • Events
  • AnswerReceived
  • Implements
Export as PDF
  1. Components
  2. API
  3. SmartAdapter

SmartDocumentAdapter

Wisej.AI.Adapters.SmartDocumentAdapter

PreviousSmartDataEntryAdapterNextSmartFullCalendarAdapter

Last updated 5 days ago

Namespace: Wisej.AI.Adapters

Assembly: Wisej.AI (3.5.0.0)

Represents a document adapter that can perform AI tasks using a document as a data source and interact with the user through a ChatBox control.

public class SmartDocumentAdapter : SmartAdapter
Public Class SmartDocumentAdapter
    Inherits SmartAdapter

This class integrates with the to search within the document being managed. It provides properties to configure the bot's appearance and document handling, and events to manage responses.

Constructors

SmartDocumentAdapter()

Initializes a new instance of the class.

Properties

AutoReset

: Gets or sets a value indicating whether the history of the conversation is cleared after each response. (Default: False)

BotAvatar

Methods

Parameter
Type
Description

question

Throws:

Parameter
Type
Description

e

Parameter
Type
Description

control

Parameter
Type
Description

control

Parameter
Type
Description

text

Parameter
Type
Description

text

Resets the conversation history.

Parameter
Type
Description

removeMessages

Indicates whether all messages from the ChatBox control should also be removed.

Executes the core logic asynchronously.

Parameter
Type
Description

control

The control associated with the operation.

Events

Implements

Name
Description

Represents a provider that supplies tools.

: Gets or sets the avatar image source of the bot. (Default: "resource.wx/Wisej.AI/Icons/wisej-avatar.svg")

BotName

: Gets or sets the name of the bot. (Default: "Wisej.AI")

ChatBox

: Gets the associated ChatBox control.

ConversionService

: Gets or sets the document conversion service used for converting documents to text.

FilePath

: Gets or sets the file path of the document. (Default: null)

FileType

: Gets or sets the file type. i.e. .docx, .pdf, .txt. If null it will be detected automatically. (Default: null)

MaxClusters

: Get or sets the maximum number of vector clusters to generate when performing summarization tasks. (Default: 5)

MinSimilarity

: Gets or sets the minimum similarity threshold. (Default: 0.25)

Stream

: Gets or sets the file path of the document. (Default: null)

TextSplitterService

: Gets or sets the text splitter service used for splitting text into smaller chunks.

TopN

: Gets or sets the number of top results to retrieve. (Default: 10)

User

: Gets the user representing the bot.

AskAsync(question)

Returns: .

When question is null.

OnAnswerReceived(e)

Raises the event.

The instance containing the event data.

OnControlCreated(control)

OnControlDisposed(control)

ParseAnswer(text)

Returns: .

ParseSourceText(text)

Returns: .

ResetSession(removeMessages)

RunAsyncCore(control)

Returns: . A task representing the asynchronous operation.

AnswerReceived

Occurs when an answer is received.

String
String
ChatBox
IDocumentConversionService
String
String
Int32
Single
Stream
ITextSplitterService
Int32
User
Task<String>
ArgumentNullException
String
String
Task<Message>
AnswerReceivedHandler
AnswerReceived
String
AnswerReceivedArgs
AnswerReceivedArgs
Control
Control
String
String
Boolean
Control
IToolProvider
SmartAdapter
SmartDocumentAdapter
IEmbeddingStorageService
SmartDocumentAdapter
Boolean