Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ documentation: ug

# Integration of Gemini AI With AI AssistView control

The Syncfusion AI AssistView supports integration with [Gemini](https://ai.google.dev/gemini-api/docs), enabling advanced conversational AI features in your Core applications.
The Syncfusion AI AssistView supports integration with [Gemini](https://ai.google.dev/gemini-api/docs), enabling advanced conversational AI features in your MVC applications.

## Getting Started With the AI AssistView control

Before integrating Gemini AI, ensure that the Syncfusion AI AssistView control is correctly rendered in your Vue application:

[ CORE Getting Started Guide](../getting-started)
[ MVC Getting Started Guide](../getting-started)

## Prerequisites

* Google account to generate API key on accessing `Gemini AI`.
* [System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) to create Core application
* [System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) to create MVC application

## Install Packages

Install the Syncfusion ASP.NET Core package in the application using Package Manager Console.
Install the Syncfusion ASP.NET MVC package in the application using Package Manager Console.

```bash

Expand Down Expand Up @@ -57,7 +57,7 @@ NuGet\Install-Package Mscc.GenerativeAI

You can add the below respective files in your application:

N> Add your generated `API Key` at the line
* Add your generated `API Key` at the line

```bash

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
layout: post
title: LLM Model in ##Platform_Name## AI AssistView Control | Syncfusion
description: Checkout and learn about Integration of LLM Model in Syncfusion ##Platform_Name## AI AssistView control of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: LLM Model
publishingplatform: ##Platform_Name##
documentation: ug
---

# Integration of LLM via Ollama With AI AssistView component

The Syncfusion AI AssistView supports integration with [LLM via Ollama](https://ollama.com), enabling advanced conversational AI features in your applications. The component acts as a UI for a support bot, where user prompts are sent to the selected AI service via API calls.

## Getting Started With the AI AssistView control

Before integrating LLM Model, ensure that the Syncfusion AI AssistView control is correctly rendered in your Vue application:

[ MVC Getting Started Guide](../getting-started)

## Prerequisites

* [System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) to create MVC application

## Install Packages

Install the Syncfusion ASP.NET MVC package in the application using Package Manager Console.

```bash

NuGet\Install-Package Syncfusion.EJ2.MVC5

```

Install the LLM Model package in the application using Package Manager Console.

```bash

NuGet\Install-Package Microsoft.Extensions.AI

NuGet\Install-Package Microsoft.Extensions.AI.Ollama

```

## Integration LLM Model with AI AssistView

Add services in `Program.cs` file

```bash

using Microsoft.Extensions.AI;

builder.Services.AddControllersWithViews();
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
});
builder.Services.AddChatClient(new OllamaChatClient(new Uri("http://localhost:11434/"), "deepseek-r1"))
.UseDistributedCache()
.UseLogging();

```

{% tabs %}
{% highlight razor tabtitle="CSHTML" %}
{% include code-snippet/ai-assistview/ai-integrations/llm-model/razor %}
{% endhighlight %}
{% highlight c# tabtitle="llm-model.cs" %}
{% include code-snippet/ai-assistview/ai-integrations/llm-model/llm-model-mvc.cs %}
{% endhighlight %}
{% endtabs %}

![LLM Model](../../images/llm-model.png)

## Run and Test

Run the application in the browser using the following command.

Build and run the app (Ctrl + F5).

Open `https://localhost:7121/` to interact with your LLM Model for dynamic response.
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ documentation: ug

# Integration of Open AI With AI AssistView control

The Syncfusion AI AssistView supports integration with [OpenAI](https://platform.openai.com/docs/overview), enabling advanced conversational AI features in your Core applications.
The Syncfusion AI AssistView supports integration with [OpenAI](https://platform.openai.com/docs/overview), enabling advanced conversational AI features in your MVC applications.

## Getting Started With the AI AssistView control

Before integrating Open AI, ensure that the Syncfusion AI AssistView control is correctly rendered in your Vue application:

[ CORE Getting Started Guide](../getting-started)
[ MVC Getting Started Guide](../getting-started)

## Prerequisites

* OpenAI account to generate an API key for accessing the `OpenAI` API
* [System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) to create Core application
* [System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) to create MVC application

## Install Packages

Install the Syncfusion ASP.NET Core package in the application using Package Manager Console.
Install the Syncfusion ASP.NET MVC package in the application using Package Manager Console.

```bash

Expand Down Expand Up @@ -57,7 +57,7 @@ NuGet\Install-Package OpenAI

You can add the below respective files in your application:

N> Add your generated `API Key` at the line in .cs file
* Add your generated `API Key` at the line in .cs file

```bash

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Install the Syncfusion ASP.NET Core package in the application using Package Ma

```bash

NuGet\Install-Package Syncfusion.EJ2.MVC5
NuGet\Install-Package Syncfusion.EJ2.AspNet.Core

```

Expand Down Expand Up @@ -57,7 +57,7 @@ NuGet\Install-Package Mscc.GenerativeAI

You can add the below respective files in your application:

N> Add your generated `API Key` at the line
* Add your generated `API Key` at the line

```bash

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
layout: post
title: LLM Model in ##Platform_Name## AI AssistView Control | Syncfusion
description: Checkout and learn about Integration of LLM Model in Syncfusion ##Platform_Name## AI AssistView control of Syncfusion Essential JS 2 and more.
platform: ej2-asp-core-mvc
control: LLM Model
publishingplatform: ##Platform_Name##
documentation: ug
---

# Integration of LLM via Ollama With AI AssistView component

The Syncfusion AI AssistView supports integration with [LLM via Ollama](https://ollama.com), enabling advanced conversational AI features in your applications. The component acts as a UI for a support bot, where user prompts are sent to the selected AI service via API calls.

## Getting Started With the AI AssistView control

Before integrating LLM Model, ensure that the Syncfusion AI AssistView control is correctly rendered in your Vue application:

[ CORE Getting Started Guide](../getting-started)

## Prerequisites

* [System requirements for ASP.NET MVC controls](https://ej2.syncfusion.com/aspnetmvc/documentation/system-requirements) to create Core application

## Install Packages

Install the Syncfusion ASP.NET Core package in the application using Package Manager Console.

```bash

NuGet\Install-Package Syncfusion.EJ2.AspNet.Core

```

Install the LLM Model package in the application using Package Manager Console.

```bash

NuGet\Install-Package Microsoft.Extensions.AI

NuGet\Install-Package Microsoft.Extensions.AI.Ollama

```

## Integration LLM Model with AI AssistView

Add services in `Program.cs` file

```bash

using Microsoft.Extensions.AI;

builder.Services.AddControllersWithViews();
builder.Services.AddCors(options =>
{
options.AddPolicy("AllowAll",
builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
});
builder.Services.AddChatClient(new OllamaChatClient(new Uri("http://localhost:11434/"), "deepseek-r1"))
.UseDistributedCache()
.UseLogging();

```

{% tabs %}
{% highlight tagHelper tabtitle="CSHTML" %}
{% include code-snippet/ai-assistview/ai-integrations/llm-model/tagHelper %}
{% endhighlight %}
{% highlight c# tabtitle="llm-model.cs" %}
{% include code-snippet/ai-assistview/ai-integrations/llm-model/llm-model-core.cs %}
{% endhighlight %}
{% endtabs %}

![LLM Model](../../images/llm-model.png)

## Run and Test

Run the application in the browser using the following command.

Build and run the app (Ctrl + F5).

Open `https://localhost:7121/` to interact with your LLM Model for dynamic response.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Install the Syncfusion ASP.NET Core package in the application using Package Man

```bash

NuGet\Install-Package Syncfusion.EJ2.MVC5
NuGet\Install-Package Syncfusion.EJ2.AspNet.Core

```

Expand Down Expand Up @@ -57,7 +57,7 @@ NuGet\Install-Package

You can add the below respective files in your application:

N> Add your generated `API Key` at the line in .cs file
* Add your generated `API Key` at the line in .cs file

```bash

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ public IActionResult Index()
{
Items.Add(new ToolbarItemModel { iconCss = "e-icons e-refresh", align = "Right" });
ViewBag.Items = Items;
var PromptSuggestionData = new string[]
{
"What are the best tools for organizing my tasks?",
"How can I maintain work-life balance effectively?"
};
ViewBag.PromptSuggestionData = PromptSuggestionData;
return View();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

@{
ViewData["Title"] = "AI Assistance with OpenAI";
var defaultSuggestions = new string[] { "Best practices for clean, maintainable code?", "How to optimize code editor for speed?" };
}

<div class="aiassist-container" style="height: 350px; width: 650px;">
@Html.EJS().AIAssistView("aiAssistView").BannerTemplate("#bannerContent").PromptSuggestions(@defaultSuggestions).PromptRequest("onPromptRequest").Created("onCreated").ToolbarSettings(new AIAssistViewToolbarSettings()
@Html.EJS().AIAssistView("aiAssistView").BannerTemplate("#bannerContent").PromptSuggestions(ViewBag.PromptSuggestionData).PromptRequest("onPromptRequest").Created("onCreated").ToolbarSettings(new AIAssistViewToolbarSettings()
{
Items = ViewBag.Items,
ItemClicked = "toolbarItemClicked"
Expand All @@ -22,19 +21,12 @@
</div>
</script>

<script id="bannerContent" type="text/x-jsrender">
<div class="banner-content">
<div class="e-icons e-assistview-icon"></div>
<h3>AI Assistance with OpenAI</h3>
<div>Your everyday AI companion.</div>
</div>
</script>

<script src="https://cdn.jsdelivr.net/npm/marked@latest/marked.min.js"></script>

<script>

var assistObj = null;
var suggestions = @Html.Raw(Json.Serialize(ViewBag.PromptSuggestionData));

function onCreated() {
assistObj = this;
Expand All @@ -43,6 +35,7 @@
function toolbarItemClicked(args) {
if (args.item.iconCss === 'e-icons e-refresh') {
this.prompts = [];
this.promptSuggestions = suggestions;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
</div>
</script>

<script id="bannerContent" type="text/x-jsrender">
<div class="banner-content">
<div class="e-icons e-assistview-icon"></div>
<h3>AI Assistance with Gemini</h3>
<div>Your everyday AI companion.</div>
</div>
</script>

<script src="https://cdn.jsdelivr.net/npm/marked@latest/marked.min.js"></script>
<script>
var assistObj = null;
Expand Down
Loading