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
  • Methods
  • ApiKey<T>(endpoint, value)
  • Authentication<T>(endpoint, value)
  • ContextWindow<T>(endpoint, value)
  • EmbeddingModel<T>(endpoint, value)
  • Headers<T>(endpoint, value)
  • MaxOutputTokens<T>(endpoint, value)
  • Model<T>(endpoint, value)
  • Name<T>(endpoint, value)
  • OnAfterInvokeTool<T>(object, action)
  • OnAfterResponseReceived<T>(object, action)
  • OnBeforeInvokeTool<T>(object, action)
  • OnBeforeSendRequest<T>(object, action)
  • OnConvertParameter<T>(object, action)
  • OnDone<T>(object, action)
  • OnError<T>(object, action)
  • OnPrepareMessages<T>(object, action)
  • OnStart<T>(object, action)
  • RetryDelay<T>(endpoint, value)
  • SystemPrompt<T>(endpoint, value)
  • Text<T>(prompt, value)
  • URL<T>(endpoint, value)
  • UseNativeTools<T>(endpoint, value)
Export as PDF
  1. Components
  2. API
  3. Markup

MarkupExtensions

Wisej.AI.MarkupExtensions

PreviousMarkupNextControls

Last updated 5 days ago

Namespace: Wisej.AI

Assembly: Wisej.AI (3.5.0.0)

Provides extension methods for configuring and handling events on SmartEndpoint, SmartHttpEndpoint, SmartHub, and SmartSession objects.

public class MarkupExtensions
Public Class MarkupExtensions

The class offers a fluent API for setting properties and subscribing to events on various smart endpoint and session types. These extension methods enable concise and readable configuration of endpoints and event handlers.

Methods

ApiKey<T>(endpoint, value)

Sets the API key for the specified HTTP endpoint.

Parameter
Type
Description

T

endpoint

The HTTP endpoint to configure.

value

The API key.

Returns: . The configured HTTP endpoint instance.

Authentication<T>(endpoint, value)

Sets the authentication string for the specified HTTP endpoint.

Parameter
Type
Description

T

endpoint

The HTTP endpoint to configure.

value

The authentication string.

Sets the context window size for the specified endpoint.

Parameter
Type
Description

T

endpoint

The endpoint to configure.

value

The context window size.

Sets the embedding model for the specified endpoint.

Parameter
Type
Description

T

endpoint

The endpoint to configure.

value

The embedding model name.

Sets the HTTP headers for the specified HTTP endpoint.

Parameter
Type
Description

T

endpoint

The HTTP endpoint to configure.

value

Sets the maximum number of output tokens for the specified endpoint.

Parameter
Type
Description

T

endpoint

The endpoint to configure.

value

The maximum number of output tokens.

Sets the model name for the specified endpoint.

Parameter
Type
Description

T

endpoint

The endpoint to configure.

value

The model name to assign.

Sets the name for the specified endpoint.

Parameter
Type
Description

T

endpoint

The endpoint to configure.

value

The name to assign.

Subscribes to the AfterInvokeTool event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Subscribes to the AfterResponseReceived event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Subscribes to the BeforeInvokeTool event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Subscribes to the BeforeSendRequest event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Subscribes to the ConvertParameter event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Subscribes to the Done event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Subscribes to the Error event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Subscribes to the PrepareMessage event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised, receiving the event arguments.

Subscribes to the Start event on the specified object.

Parameter
Type
Description

T

object

action

The action to invoke when the event is raised.

Sets the retry delay (in milliseconds) for the specified HTTP endpoint.

Parameter
Type
Description

T

endpoint

The HTTP endpoint to configure.

value

The retry delay in milliseconds.

Sets the system prompt for the specified endpoint.

Parameter
Type
Description

T

endpoint

The endpoint to configure.

value

The system prompt text.

Sets the Text for the specified SmartPrompt.

Parameter
Type
Description

T

prompt

The SmartPrompt to configure.

value

The text string.

Sets the URL for the specified HTTP endpoint.

Parameter
Type
Description

T

endpoint

The HTTP endpoint to configure.

value

The URL to assign.

Specifies whether to use native tools for the specified endpoint.

Parameter
Type
Description

T

endpoint

The endpoint to configure.

value

True to use native tools; otherwise, false.

A type derived from .

A type derived from .

Returns: . The configured HTTP endpoint instance.

ContextWindow<T>(endpoint, value)

A type derived from .

Returns: . The configured endpoint instance.

EmbeddingModel<T>(endpoint, value)

A type derived from .

Returns: . The configured endpoint instance.

Headers<T>(endpoint, value)

A type derived from .

A containing the headers.

Returns: . The configured HTTP endpoint instance.

MaxOutputTokens<T>(endpoint, value)

A type derived from .

Returns: . The configured endpoint instance.

Model<T>(endpoint, value)

A type derived from .

Returns: . The configured endpoint instance.

Name<T>(endpoint, value)

A type derived from .

Returns: . The configured endpoint instance.

OnAfterInvokeTool<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnAfterResponseReceived<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnBeforeInvokeTool<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnBeforeSendRequest<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnConvertParameter<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnDone<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnError<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnPrepareMessages<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

OnStart<T>(object, action)

A type derived from .

The to subscribe to.

Returns: . The configured instance.

RetryDelay<T>(endpoint, value)

A type derived from .

Returns: . The configured HTTP endpoint instance.

SystemPrompt<T>(endpoint, value)

A type derived from .

Returns: . The configured endpoint instance.

Text<T>(prompt, value)

A type derived from .

Returns: . The configured SmartPrompt instance.

URL<T>(endpoint, value)

A type derived from .

Returns: . The configured HTTP endpoint instance.

UseNativeTools<T>(endpoint, value)

A type derived from .

Returns: . The configured endpoint instance.

T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
SmartHttpEndpoint
T
String
SmartHttpEndpoint
T
String
SmartEndpoint
T
Int32
SmartEndpoint
T
String
SmartHttpEndpoint
T
NameValueCollection
NameValueCollection
SmartEndpoint
T
Int32
SmartEndpoint
T
String
SmartEndpoint
T
String
SmartObject
T
SmartObject
Action<InvokeToolEventArgs>
SmartObject
T
SmartObject
Action<MessagesEventArgs>
SmartObject
T
SmartObject
Action<InvokeToolEventArgs>
SmartObject
T
SmartObject
Action<MessagesEventArgs>
SmartObject
T
SmartObject
Action<ConvertParameterEventArgs>
SmartObject
T
SmartObject
Action
SmartObject
T
SmartObject
Action<ErrorEventArgs>
SmartObject
T
SmartObject
Action<MessagesEventArgs>
SmartObject
T
SmartObject
Action
SmartHttpEndpoint
T
Int32
SmartEndpoint
T
String
SmartPrompt
T
String
SmartHttpEndpoint
T
String
SmartEndpoint
T
Boolean
MarkupExtensions
T