MarkupExtensions
Wisej.AI.MarkupExtensions
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
The MarkupExtensions 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.
Returns: T. The configured HTTP endpoint instance.
Authentication<T>(endpoint, value)

Sets the authentication string for the specified HTTP endpoint.
Returns: T. The configured HTTP endpoint instance.
ContextWindow<T>(endpoint, value)

Sets the context window size for the specified endpoint.
Returns: T. The configured endpoint instance.
EmbeddingModel<T>(endpoint, value)

Sets the embedding model for the specified endpoint.
Returns: T. The configured endpoint instance.
Headers<T>(endpoint, value)

Sets the HTTP headers for the specified HTTP endpoint.
Returns: T. The configured HTTP endpoint instance.
MaxOutputTokens<T>(endpoint, value)

Sets the maximum number of output tokens for the specified endpoint.
Returns: T. The configured endpoint instance.
Model<T>(endpoint, value)

Sets the model name for the specified endpoint.
Returns: T. The configured endpoint instance.
Name<T>(endpoint, value)

Sets the name for the specified endpoint.
Returns: T. The configured endpoint instance.
OnAfterInvokeTool<T>(object, action)

Subscribes to the AfterInvokeTool event on the specified object.
Returns: T. The configured instance.
OnAfterResponseReceived<T>(object, action)

Subscribes to the AfterResponseReceived event on the specified object.
Returns: T. The configured instance.
OnBeforeInvokeTool<T>(object, action)

Subscribes to the BeforeInvokeTool event on the specified object.
Returns: T. The configured instance.
OnBeforeSendRequest<T>(object, action)

Subscribes to the BeforeSendRequest event on the specified object.
Returns: T. The configured instance.
OnConvertParameter<T>(object, action)

Subscribes to the ConvertParameter event on the specified object.
Returns: T. The configured instance.
OnDone<T>(object, action)

Subscribes to the Done event on the specified object.
Returns: T. The configured instance.
OnError<T>(object, action)

Subscribes to the Error event on the specified object.
Returns: T. The configured instance.
OnPrepareMessages<T>(object, action)

Subscribes to the PrepareMessage event on the specified object.
action
The action to invoke when the event is raised, receiving the event arguments.
Returns: T. The configured instance.
OnStart<T>(object, action)

Subscribes to the Start event on the specified object.
Returns: T. The configured instance.
RetryDelay<T>(endpoint, value)

Sets the retry delay (in milliseconds) for the specified HTTP endpoint.
Returns: T. The configured HTTP endpoint instance.
SystemPrompt<T>(endpoint, value)

Sets the system prompt for the specified endpoint.
Returns: T. The configured endpoint instance.
Text<T>(prompt, value)

Sets the Text for the specified SmartPrompt.
Returns: T. The configured SmartPrompt instance.
URL<T>(endpoint, value)

Sets the URL for the specified HTTP endpoint.
Returns: T. The configured HTTP endpoint instance.
UseNativeTools<T>(endpoint, value)

Specifies whether to use native tools for the specified endpoint.
Returns: T. The configured endpoint instance.
Last updated