Skip to content

docs(AIPrompt): Update AI integration information #2962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions common-features/microsoft-extensions-ai-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ Other components will support similar integration in future versions of UI for B

To integrate the **Microsoft.Extensions.AI** library with your AIPrompt component, register an [`IChatClient`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.ichatclient?view=net-9.0-pp) service and configure it according to the model you are using. The AIPrompt is designed to automatically use the registered `IChatClient`.

> The Microsoft AI library is still in preview, so breaking changes may occur. Telerik UI for Blazor references `Microsoft.Extensions.AI.Abstractions` version `9.1.0-preview.1.25064.3`. Do not register a newer version of this package explicitly in your app, as this may cause integration issues or exceptions.
>
> When using the Telerik AIPrompt component with the Microsoft AI library, do not subscribe to the `OnPromptRequest` event.

**Microsoft.Extensions.AI** provides a simple integration with various models where the configuration slightly differs depending on the model. [Explore examples with different models in this sample application](https://github.com/telerik/blazor-ui/tree/master/common/microsoft-extensions-ai-integration/AIPromptIntegration).
Expand All @@ -30,4 +28,4 @@ To integrate the **Microsoft.Extensions.AI** library with your AIPrompt componen
* [AIPrompt - Live Demo](https://demos.telerik.com/blazor-ui/aiprompt/overview)
* [Microsoft.Extensions.AI](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai?view=net-9.0-pp)
* [Introducing Microsoft.Extensions.AI Preview – Unified AI Building Blocks for .NET](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/)
* [AIPrompt Integration with Microsoft.Extensions.AI - Sample Application](https://github.com/telerik/blazor-ui/tree/master/common/microsoft-extensions-ai-integration/AIPromptIntegration)
* [AIPrompt Integration with Microsoft.Extensions.AI - Sample Application](https://github.com/telerik/blazor-ui/tree/master/common/microsoft-extensions-ai-integration/AIPromptIntegration)
2 changes: 1 addition & 1 deletion components/aiprompt/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The table below lists the AIPrompt parameters. For a full list of the AIPrompt A
| `PromptSuggestions` | `List<string>` | The prompt suggestions displayed within the Prompt view. |
| `PromptSuggestionItemTemplate` | `RenderFragment<string>` | The Prompt Suggestion Item template of the AIPrompt. |
| `ShowOutputRating` | `bool` <br /> (`false`) | Controls the visibility of the rating buttons within the output card. |
| `SystemPrompt` | `string` <br /> (See "Description" column) | Defines the system prompt that is passed to `IChatClient.CompleteAsync()`. This method exists in `Microsoft.Extensions.AI.Abstractions` package version `9.1.0-preview.1.25064.3`, but not in newer versions. Referencing a newer version explicitly in your app will cause a runtime exception. <br /><br /> The default `SystemPrompt` value is: `"You are a helpful assistant designed to assist users. Your goal is to provide helpful, accurate, and contextually appropriate information in a clear and concise manner. Avoid discussing harmful, illegal, or inappropriate topics"`.
| `SystemPrompt` | `string` <br /> (See "Description" column) | Defines the system prompt that is passed to the [Microsoft `ChatMessage`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.chatmessage) object constructor. <br /><br /> The default `SystemPrompt` value is: `"You are a helpful assistant designed to assist users. Your goal is to provide helpful, accurate, and contextually appropriate information in a clear and concise manner. Avoid discussing harmful, illegal, or inappropriate topics."`.
| `Width` | `string` | The `width` style of the component in any [supported CSS unit](slug:common-features/dimensions). The default AIPrompt dimensions depend on the CSS theme. |

## AIPrompt Reference and Methods
Expand Down
Loading