# AIPromptBuilder

## Properties

### WriteAction - Func

## Methods

### PromptSuggestions(System.String)

Adds a suggestion to the PromptSuggestions collection.

#### Parameters

##### value - `System.String`

The suggestion

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### PromptSuggestions(System.Collections.Generic.ICollection)

Sets the PromptSuggestions collection

#### Parameters

##### value - `System.Collections.Generic.ICollection<String>`

The collection

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### ActiveView(System.Object)

Specifies the index of the active view or the name of the view.

#### Parameters

##### value - `System.Object`

The value for ActiveView

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### Service(System.String)

The URL of the AI service to use for generating outputs.

#### Parameters

##### value - `System.String`

The url of the service setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### Service(System.String,System.String)

The URL of the AI service to use for generating outputs.

#### Parameters

##### actionName - `System.String`

The action name of the service setting.

##### controllerName - `System.String`

The controller name of the service setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### Service(System.String,System.String,System.Object)

The URL of the AI service to use for generating outputs.

#### Parameters

##### actionName - `System.String`

The action name of the service setting.

##### controllerName - `System.String`

The controller name of the service setting.

##### routeValues - `System.Object`

The route values of the service setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### Service(System.String,System.String,Microsoft.AspNetCore.Routing.RouteValueDictionary)

The URL of the AI service to use for generating outputs.

#### Parameters

##### actionName - `System.String`

The action name of the service setting.

##### controllerName - `System.String`

The controller name of the service setting.

##### routeValues - `Microsoft.AspNetCore.Routing.RouteValueDictionary`

The route values of the service setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### OutputActions(System.Action)

An array of action configurations for the output cards. Can contain strings for built-in actions or objects with custom action properties.Built-in actions: - "copy" - Copy output content to clipboard. - "retry" - Retry generating the output. - "discard" - Clears the output content and closes the popup.Custom actions trigger the outputAction event with the action command and output data.

#### Parameters

##### configurator - System.Action<[AIPromptOutputActionFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptoutputactionfactory)>

The configurator for the outputactions setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### EncodedPromptOutputs(System.Boolean)

Specifies whether the prompt outputs are HTML-encoded before being displayed in the output view. When set to true (default), the output is encoded and displayed as plain text, preventing any HTML formatting or scripts from being rendered.

#### Parameters

##### value - `System.Boolean`

The value for EncodedPromptOutputs

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### PromptOutputs(System.Action)

An array of prompt outputs to display in the prompt view.

#### Parameters

##### configurator - System.Action<[AIPromptPromptOutputFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptpromptoutputfactory)>

The configurator for the promptoutputs setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### SpeechToText(System.Action)

Configures speech-to-text functionality for the prompt input. When true, enables speech-to-text with default settings. When false, disables the feature. When an object, configures custom speech-to-text options.

#### Parameters

##### configurator - System.Action<[AIPromptSpeechToTextSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptspeechtotextsettingsbuilder)>

The configurator for the speechtotext setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### SpeechToText()

Configures speech-to-text functionality for the prompt input. When true, enables speech-to-text with default settings. When false, disables the feature. When an object, configures custom speech-to-text options.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### SpeechToText(System.Boolean)

Configures speech-to-text functionality for the prompt input. When true, enables speech-to-text with default settings. When false, disables the feature. When an object, configures custom speech-to-text options.

#### Parameters

##### enabled - `System.Boolean`

Enables or disables the speechtotext option.

#### RETURNS

Returns the current instance of [AIPromptSpeechToTextSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptspeechtotextsettingsbuilder) .

### PromptTextArea(System.Action)

Configuration options for the Kendo UI TextArea component used in the prompt view. Only specific properties from the Kendo UI TextArea are supported.

#### Parameters

##### configurator - System.Action<[AIPromptPromptTextAreaSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptprompttextareasettingsbuilder)>

The configurator for the prompttextarea setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### OutputTemplate(System.String)

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

#### Parameters

##### value - `System.String`

The value for OutputTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### OutputTemplateId(System.String)

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

#### Parameters

##### templateId - `System.String`

The ID of the template element for OutputTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### OutputTemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The view that contains the template for OutputTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### OutputTemplateHandler(System.String)

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

#### Parameters

##### templateHandler - `System.String`

The handler that returs the template for OutputTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### OutputTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)

A template function for customizing the display of output content. This function is called when an output has finished streaming and final content needs to be rendered.The function receives an object with output (the output data) and content (the output text) properties and should return HTML string.

#### Parameters

##### template - TemplateBuilder\<TModel>

A Template component that configures the outputtemplate.

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### PromptSuggestionItemTemplate(System.String)

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

#### Parameters

##### value - `System.String`

The value for PromptSuggestionItemTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### PromptSuggestionItemTemplateId(System.String)

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

#### Parameters

##### templateId - `System.String`

The ID of the template element for PromptSuggestionItemTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### PromptSuggestionItemTemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The view that contains the template for PromptSuggestionItemTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### PromptSuggestionItemTemplateHandler(System.String)

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

#### Parameters

##### templateHandler - `System.String`

The handler that returs the template for PromptSuggestionItemTemplate

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### PromptSuggestionItemTemplate(Kendo.Mvc.UI.Fluent.TemplateBuilder)

The template of the prompt suggestion item. It can be a string, a function or a Kendo Template.

#### Parameters

##### template - TemplateBuilder\<TModel>

A Template component that configures the promptsuggestionitemtemplate.

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### ToolbarItems(System.Action)

An array of toolbar items to display in the header Toolbar. They will be rendered after the items generated from the configurations of the views.

#### Parameters

##### configurator - System.Action<[AIPromptToolbarItemFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aiprompttoolbaritemfactory)>

The configurator for the toolbaritems setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### Service(System.Action)

The URL of the AI service to use for generating outputs.

#### Parameters

##### configurator - System.Action<[AIPromptServiceSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptservicesettingsbuilder)>

The configurator for the service setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### ShowOutputSubtitleTooltip(System.Boolean)

Controls whether the subtitle of the card in the output view displays a tooltip containing the full content of the subtitle, which is the prompt used to generate the output.

#### Parameters

##### value - `System.Boolean`

The value for ShowOutputSubtitleTooltip

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### ShowOutputSubtitleTooltip()

Controls whether the subtitle of the card in the output view displays a tooltip containing the full content of the subtitle, which is the prompt used to generate the output.

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### ShowOutputRating(System.Boolean)

Specifies if the output rating should be displayed on the output card. > Note: This property is deprecated. Use the outputActions configuration instead.

#### Parameters

##### value - `System.Boolean`

The value for ShowOutputRating

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

### Views(System.Action)

An array of view configurations.

#### Parameters

##### configurator - System.Action<[AIPromptViewFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptviewfactory)>

The configurator for the views setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### Messages(System.Action)

The text messages displayed in the component. Use this option to customize or localize the messages.

#### Parameters

##### configurator - System.Action<[AIPromptMessagesSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptmessagessettingsbuilder)>

The configurator for the messages setting.

#### RETURNS

Returns the current instance of [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) .

### Events(System.Action)

Configures the client-side events.

#### Parameters

##### configurator - System.Action<[AIPromptEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aiprompteventbuilder)>

The client events action.

#### RETURNS

Returns the current [AIPromptBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/aipromptbuilder) instance.

#### Example

```
 
            @(Html.Kendo().AIPrompt()
                  .Name("AIPrompt")
                  .Events(events => events
                      .CommandExecute("onCommandExecute")
                  )
            )
             
```

### ToComponent()

Returns the internal view component.

#### RETURNS

The  instance that represents the component.

### Expression(System.String)

Sets the name of the component.

#### Parameters

##### modelExpression - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

#### Parameters

##### modelExplorer - `Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer`

The name.

#### RETURNS

Returns the current  instance.

### Name(System.String)

Sets the name of the component.

#### Parameters

##### componentName - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean,System.Boolean)

#### Parameters

##### deferred - `System.Boolean`

#### RETURNS

Returns a [DeferredWidgetBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/deferredwidgetbuilder) instance.

### HtmlAttributes(System.Object)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Object`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Object`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### Render()

Renders the component in place.

### ToHtmlString()

Returns the HTML representation of the component.

### WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToClientTemplate()

Returns the client template for the component.

### AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

#### Parameters

##### value - `System.Boolean`

#### RETURNS

Returns the current  instance.
