From fc09636de218866d5bf6acf4134504b4ad2d1853 Mon Sep 17 00:00:00 2001 From: TamilRamGanesan-SF5080 Date: Thu, 28 Aug 2025 10:35:20 +0530 Subject: [PATCH 1/3] 976152: added ChatUI Integration for DialogFlow & Bot Framework --- .../integration-with-bot-framework.md | 233 ++++++++++++++++ .../integration-with-dialogflow.md | 221 +++++++++++++++ .../integration-with-bot-framework.md | 258 ++++++++++++++++++ .../integration-with-dialogflow.md.md | 220 +++++++++++++++ .../chat-ui/images/dialogflow.png | Bin 0 -> 33992 bytes ej2-asp-core-toc.html | 10 + ej2-asp-mvc-toc.html | 10 + 7 files changed, 952 insertions(+) create mode 100644 ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md create mode 100644 ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md create mode 100644 ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md create mode 100644 ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md create mode 100644 ej2-asp-core-mvc/chat-ui/images/dialogflow.png diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md new file mode 100644 index 0000000000..aa500880f0 --- /dev/null +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md @@ -0,0 +1,233 @@ +--- +layout: post +title: Integration of Microsoft Bot in ##Platform_Name## Chat UI Control | Syncfusion +description: Checkout and learn about Integration of Microsoft Bot in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more. +platform: ej2-asp-core-mvc +control: Integration of Microsoft Bot +publishingplatform: ##Platform_Name## +documentation: ug +--- + +# Integration of Microsoft Bot Framework With ASP.NET MVC Chat UI component + +The Syncfusion ASP.NET MVC Chat UI supports integration with a Microsoft Bot Framework bot hosted on Azure, enabling a custom chat interface for seamless user interaction. The process involves setting up a secure backend token server, configuring the bot in Azure, and integrating the Syncfusion Chat UI in an ASP.NET MVC application. + +## Getting Started With the Chat UI Component + +Before integrating Microsoft Bot Framework, ensure that the Syncfusion Chat UI component is correctly rendered in your ASP.NET MVC app: + +[ASP.NET MVC Getting Started Guide](../getting-started) + +## Prerequisites + +* `Microsoft Azure Account`: Required to create and host the bot. +* `Visual Studio`: With ASP.NET MVC development tools. +* `Syncfusion EJ2 ASP.NET MVC`: Install Syncfusion.EJ2.MVC5 in your project. +* `Deployed Azure Bot`: A bot should be created and published using the Bot Framework, accessible via an Azure App Service. Refer to [Microsoft's Bot Creation Guide](https://learn.microsoft.com/en-us/azure/bot-service/). + +## Install Dependencies + +* Install backend dependencies for bot communication using NuGet: + +```bash + +Install-Package Microsoft.Bot.Connector.DirectLine +Install-Package Newtonsoft.Json + +``` + +* Install the Syncfusion EJ2 ASP.NET MVC package: + +```bash + +Install-Package Syncfusion.EJ2.MVC5 + +``` + +## Configure the Azure Bot + +1. In the [Azure Portal](https://portal.azure.com/#home), navigate to your bot resource. + +2. Enable the Direct Line channel: + * Go to `Channels` > `Direct Line` > `Default-Site`. + * Copy one of the displayed secret keys. + +3. Verify the Messaging endpoint in the Configuration section (e.g., https://your-bot-service.azurewebsites.net/api/messages). + +> `Security Note`: Never expose the Direct Line secret key in frontend code. Use a backend token server to handle it securely. + +## Set Up Token Server + +Create a Web API controller in your ASP.NET MVC project to handle Direct Line token generation. Add `Controllers/TokenController.cs`: + +```csharp + +using System; +using System.Configuration; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using System.Web.Http; +using Newtonsoft.Json; + +namespace YourNamespace.Controllers +{ + public class TokenController : ApiController + { + private static readonly HttpClient _httpClient = new HttpClient(); + + [HttpPost] + [Route("api/token/directline/token")] + public async Task GenerateToken() + { + var directLineSecret = ConfigurationManager.AppSettings["DirectLineSecret"]; + if (string.IsNullOrEmpty(directLineSecret)) + { + return BadRequest("Direct Line secret is not configured."); + } + + try + { + var request = new HttpRequestMessage(HttpMethod.Post, "https://directline.botframework.com/v3/directline/tokens/generate"); + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", directLineSecret); + + var response = await _httpClient.SendAsync(request); + response.EnsureSuccessStatusCode(); + + var responseContent = await response.Content.ReadAsStringAsync(); + dynamic tokenResponse = JsonConvert.DeserializeObject(responseContent); + return Ok(new { token = tokenResponse.token }); + } + catch (HttpRequestException ex) + { + return InternalServerError(new Exception("Failed to generate Direct Line token.", ex)); + } + } + } +} + +``` + +Add the Direct Line secret to `Web.config`: + +```xml + + + + +``` +>`Security Note`: Store the Direct Line secret in a secure configuration, such as Azure Key Vault, for production environments. + +## Integrate ChatUI in ASP.NET MVC + +Use the Chat UI `messageSend` event to handle message exchanges. This event is triggered before a message is sent, allowing you to forward it to the bot via the Direct Line API. Use the `addMessage` method to programmatically add the bot's reply to the Chat UI. + +Create `Views/Home/Index.cshtml` to integrate the Syncfusion Chat UI with the Direct Line API: + +```html + +@using Syncfusion.EJ2.InteractiveChat + +@{ + var currentUserModel = new ChatUIUser { Id = "user1", User = "You" }; + var botUserModel = new ChatUIUser { Id = "bot", User = "Bot" }; +} + +
+ @Html.EJS().ChatUI("chatUI").User(currentUserModel).MessageSend("onMessageSend").Render() +
+ + + + +``` + +>Ensure Syncfusion scripts and styles are included in `_Layout.cshtml` as per the getting started guide. Also, include the Bot Framework Web Chat script for Direct Line functionality. Register the Syncfusion script manager in `_Layout.cshtml`. + +## Configure Web.config for CORS (if needed) + +To enable CORS for API requests, add to `Web.config` under ``: + +```xml + + + + + + + + +``` + +## Run and Test + +### Start the Application: + +Run the project in Visual Studio or use IIS Express. +Open your app in the browser (e.g., `http://localhost:port`) to interact with your Microsoft Bot Framework chatbot. + +## Troubleshooting + +* `Token Server Error (500)`: Ensure the `DirectLineSecret` in `Web.config` is correct and the token endpoint is accessible. +* `CORS Error`: Verify the CORS configuration in `Web.config` allows requests from your frontend URL. +* `Bot is Not Responding`: + - Test the bot in the Azure Portal using the `Test in Web Chat` feature to ensure it’s running correctly. + - Check the bot’s `Messaging endpoint` in the Configuration section and ensure it is correct and accessible. +* `Connection Fails on Load`: Verify the token controller is running and accessible. Check the browser console for network errors. +* `Token Expiration`: Direct Line tokens are short-lived. The Direct Line client typically handles token refresh, but if issues persist, restart the Direct Line connection. \ No newline at end of file diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md new file mode 100644 index 0000000000..689e22f374 --- /dev/null +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md @@ -0,0 +1,221 @@ +--- +layout: post +title: Integration of Dialogflow in ##Platform_Name## Chat UI Control | Syncfusion +description: Checkout and learn about Integration of Dialogflow in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more. +platform: ej2-asp-core-mvc +control: Integration of Dialogflow +publishingplatform: ##Platform_Name## +documentation: ug +--- + +# Integration of Google Dialogflow With ASP.NET MVC Chat UI component + +The Syncfusion Chat UI supports integration with [Google Dialogflow](https://cloud.google.com/dialogflow/docs), enabling advanced conversational AI features in your ASP.NET MVC applications. + +## Getting Started With the ChatUI Component + +Before integrating Dialogflow, ensure that the Syncfusion Chat UI component is correctly rendered in your ASP.NET MVC app: + +[ASP.NET MVC Getting Started Guide](../getting-started) + +## Prerequisites + +* Google account to access `Dialogflow` and `Google Cloud Console`. +* Visual Studio with ASP.NET MVC development tools. +* Syncfusion EJ2 ASP.NET MVC installed in your project. +* Dialogflow Service Account with the `Dialogflow API Client` role and its JSON key file. + +## Install Dependencies + +* Install backend dependencies for Dialogflow and server setup using NuGet: + +```bash + +Install-Package Google.Cloud.Dialogflow.V2 +Install-Package Newtonsoft.Json + +``` +* Install the Syncfusion EJ2 ASP.NET MVC package in your project: + +```bash + +Install-Package Syncfusion.EJ2.MVC5 + +``` + +## Set Up the Dialogflow Agent + +1. In the Dialogflow console, create an [agent](https://cloud.google.com/agent-assist/docs), set a name (e.g., `MyChatBot`), and configure the default language (e.g., English - `en`). + +2. Add intents with training phrases and responses (e.g., greetings, FAQs). Test using the Dialogflow simulator. + +3. In the Google Cloud Console, go to `APIs & Services` > `Credentials`, create a Service Account with the Dialogflow API Client role, and download the JSON key file. + +> `Security Note`: Never commit the JSON key file to version control. Use environment variables or a secret manager (e.g., Google Cloud Secret Manager) for production. + +## Configure ASP.NET MVC Backend + +Create `service-acct.json` with your Dialogflow service account credentials in your project root: + +```json + +{ + "type": "service_account", + "project_id": "your-dialogflow-project-id", + "private_key_id": "abc123xyz...", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEv...", + "client_email": "dialogflow-agent@your-dialogflow-project-id.iam.gserviceaccount.com", + ... +} + +``` + +Set up a Web API controller in `Controllers/ChatController.cs` to handle Dialogflow requests: + +```csharp + +using Google.Cloud.Dialogflow.V2; +using Google.Apis.Auth.OAuth2; +using System; +using System.Configuration; +using System.Threading.Tasks; +using System.Web.Http; + +namespace YourNamespace.Controllers +{ + public class ChatController : ApiController + { + private readonly SessionsClient _sessionsClient; + private readonly string _projectId; + + public ChatController() + { + var credential = GoogleCredential.FromFile("service-acct.json"); + _sessionsClient = SessionsClient.Create(credential.ToChannelCredentials()); + _projectId = ConfigurationManager.AppSettings["DialogflowProjectId"]; // Or hardcode from JSON + } + + [HttpPost] + [Route("api/chat/message")] + public async Task SendMessage([FromBody] MessageRequest request) + { + var sessionId = request.SessionId ?? "default-session"; + var session = SessionName.FromProjectSession(_projectId, sessionId); + + var queryInput = new QueryInput + { + Text = new TextInput + { + Text = request.Text, + LanguageCode = "en-US" + } + }; + + try + { + var response = await _sessionsClient.DetectIntentAsync(new DetectIntentRequest { Session = session.ToString(), QueryInput = queryInput }); + var reply = response.QueryResult.FulfillmentText; + return Ok(new { reply }); + } + catch (Exception ex) + { + return InternalServerError(new Exception("Error connecting to Dialogflow.", ex)); + } + } + } + + public class MessageRequest + { + public string Text { get; set; } + public string SessionId { get; set; } + } +} + +``` + +> Use a unique `sessionId` (e.g., Guid) for each user to maintain conversation context. Add the projectId to Web.config if needed: + +## Integrate ChatUI in ASP.NET MVC + +Use the Chat UI `messageSend` event to exchange messages. This event is triggered before a message is sent, allowing you to forward it to the backend. + +### Forward Message to backend: + +In the `messageSend` event handler, send a POST request to your backend API endpoint (`/api/chat/message`). The backend forwards the message to Dialogflow and returns the response. + +### Displaying Bot response: + +Use the `addMessage` method to programmatically add the bot's reply to the Chat UI. + +Create `Views/Home/Index.cshtml` to integrate the Syncfusion Chat UI with the Dialogflow backend: + +```html + +@using Syncfusion.EJ2.InteractiveChat + +@{ + var currentUserModel = new ChatUIUser { Id = "user1", User = "Albert" }; + var botUserModel = new ChatUIUser { Id = "user2", User = "Bot", AvatarUrl = "https://ej2.syncfusion.com/demos/src/chat-ui/images/bot.png" }; +} + +
+ @Html.EJS().ChatUI("chatUI").HeaderText("Bot").HeaderIconCss("e-header-icon").User(currentUserModel).MessageSend("onMessageSend").Render() +
+ + + + +``` + +> Ensure to include Syncfusion scripts and styles in `_Layout.cshtml` as per the getting started guide. Also, register the Syncfusion script manager in `_Layout.cshtml`. + +## Run and Test + +### Start the Application: + +Run the project in Visual Studio or use IIS Express. + +Open your app in the browser and chat with your Dialogflow-powered bot. + +![ChatUI with Dialogflow](../../images/dialogflow.png) + +## Troubleshooting: + +* `Permission Denied`: Ensure the service account has the `Dialogflow API Client` role in the Google Cloud Console. +* `CORS Error`: If using separate origins, configure CORS in Web.config (e.g., add custom headers under ). +* `No Response`: Test intents in the Dialogflow Console simulator to ensure they are configured correctly. +* `Quota Exceeded`: Check Dialogflow API quotas in the Google Cloud Console. +* `Network Issues`: Confirm the application is running and the frontend is pointing to the correct API URL. +* `Invalid Credentials`: Verify the service account JSON or configuration settings are correctly set up. diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md new file mode 100644 index 0000000000..3a50bb59af --- /dev/null +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md @@ -0,0 +1,258 @@ +--- +layout: post +title: Integration of Microsoft Bot in ##Platform_Name## Chat UI Control | Syncfusion +description: Checkout and learn about Integration of Microsoft Bot in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more. +platform: ej2-asp-core-mvc +control: Integration of Microsoft Bot +publishingplatform: ##Platform_Name## +documentation: ug +--- + +# Integration of Microsoft Bot Framework With ASP.NET Core Chat UI component + +The Syncfusion ASP.NET Core Chat UI supports integration with a Microsoft Bot Framework bot hosted on Azure, enabling a custom chat interface for seamless user interaction. The process involves setting up a secure backend token server, configuring the bot in Azure, and integrating the Syncfusion Chat UI in an ASP.NET Core application. + +## Getting Started With the ChatUI Component + +Before integrating Microsoft Bot Framework, ensure that the Syncfusion Chat UI component is correctly rendered in your ASP.NET Core app: +[ASP.NET Core Getting Started Guide](../getting-started) + +## Prerequisites + +* `Microsoft Azure Account`: Required to create and host the bot. +* `.NET SDK`: Version 6.0 or higher for ASP.NET Core. +* `Syncfusion EJ2 ASP.NET Core`: Install Syncfusion.EJ2.AspNet.Core in your project. +* `Deployed Azure Bot`: A bot should be created and published using the Bot Framework, accessible via an Azure App Service. Refer to [Microsoft's Bot Creation Guide](https://learn.microsoft.com/en-us/azure/bot-service/). + +## Install Dependencies +* Install backend dependencies for bot communication using NuGet: + +```bash + +dotnet add package Microsoft.Bot.Connector.DirectLine +dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson + +``` + +* Install the Syncfusion EJ2 ASP.NET Core package: + +```bash + +dotnet add package Syncfusion.EJ2.AspNet.Core + +``` + +## Configure the Azure Bot + +1. In the [Azure Portal](https://portal.azure.com/#home), navigate to your bot resource. + +2. Enable the Direct Line channel: + * Go to `Channels` > `Direct Line` > `Default-Site`. + * Copy one of the displayed secret keys. + +3. Verify the Messaging endpoint in the Configuration section (e.g., https://your-bot-service.azurewebsites.net/api/messages). + +> `Security Note`: Never expose the Direct Line secret key in frontend code. Use a backend token server to handle it securely. + +## Set Up Token Server + +Create a controller in your ASP.NET Core project to handle Direct Line token generation. Add `Controllers/TokenController.cs`: + +```csharp + +using Microsoft.AspNetCore.Mvc; +using System.Net.Http; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace YourNamespace.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class TokenController : ControllerBase + { + private readonly IConfiguration _configuration; + private readonly HttpClient _httpClient; + + public TokenController(IConfiguration configuration, IHttpClientFactory httpClientFactory) + { + _configuration = configuration; + _httpClient = httpClientFactory.CreateClient(); + } + + [HttpPost("directline/token")] + public async Task GenerateToken() + { + var directLineSecret = _configuration["DirectLine:Secret"]; + if (string.IsNullOrEmpty(directLineSecret)) + { + return BadRequest(new { error = "Direct Line secret is not configured." }); + } + + try + { + var request = new HttpRequestMessage(HttpMethod.Post, "https://directline.botframework.com/v3/directline/tokens/generate"); + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", directLineSecret); + + var response = await _httpClient.SendAsync(request); + response.EnsureSuccessStatusCode(); + + var responseContent = await response.Content.ReadAsStringAsync(); + var tokenResponse = JsonConvert.DeserializeObject(responseContent); + return Ok(new { token = tokenResponse.token }); + } + catch (HttpRequestException ex) + { + return StatusCode(500, new { error = "Failed to generate Direct Line token.", details = ex.Message }); + } + } + } +} + +``` +Add the Direct Line secret to `appsettings.json`: + +```bash + +{ + "DirectLine": { + "Secret": "PASTE_YOUR_DIRECT_LINE_SECRET_HERE" + } +} + +``` + +> `Security Note`: Store the Direct Line secret in a secure configuration, such as Azure Key Vault, for production environments.| + +## Integrate ChatUI in ASP.NET Core + +Use the Chat UI `messageSend` event to handle message exchanges. This event is triggered before a message is sent, allowing you to forward it to the bot via the Direct Line API. Use the `addMessage` method to programmatically add the bot's reply to the Chat UI. +Create `Views/Home/Index.cshtml` (assuming MVC) to integrate the Syncfusion Chat UI with the Direct Line API: + +```html + +@using Syncfusion.EJ2.InteractiveChat + +@{ + var currentUserModel = new ChatUIUser { Id = "user1", User = "You" }; + var botUserModel = new ChatUIUser { Id = "bot", User = "Bot" }; +} + +
+ +
+ + + + +``` + +> Ensure Syncfusion scripts and styles are included in `_Layout.cshtml` as per the getting started guide. Also, register `` in `_Layout.cshtml`. Include the Bot Framework Web Chat script for Direct Line functionality. + +## Configure Program.cs + +Ensure CORS and HttpClient are configured in `Program.cs`: + +```csharp + +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllers().AddNewtonsoftJson(); +builder.Services.AddHttpClient(); +builder.Services.AddCors(options => +{ + options.AddPolicy("AllowAll", builder => + { + builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader(); + }); +}); + +var app = builder.Build(); + +app.UseCors("AllowAll"); +app.UseRouting(); +app.MapControllers(); + +app.Run(); + +``` + +## Run and Test + +### Start the Application: + +Navigate to your project folder and run: + +```bash + +dotnet run + +``` + +Open your app in the browser (e.g., `http://localhost:5000`) to interact with your Microsoft Bot Framework chatbot. + +## Troubleshooting + +* `Token Server Error (500)`: Ensure the DirectLine:Secret in appsettings.json is correct and the token endpoint is accessible. +* `CORS Error`: Verify the CORS policy in Program.cs allows requests from your frontend URL. +* `Bot is Not Responding`: + - Test the bot in the Azure Portal using the `Test in Web Chat` feature to ensure it's running correctly. + - Check the bot's `Messaging endpoint` in the Configuration section and ensure it is correct and accessible. +* `Connection Fails on Load`: Verify the token controller is running and accessible. Check the browser console for network errors. +* `Token Expiration`: Direct Line tokens are short-lived. The Direct Line client typically handles token refresh, but if issues persist, restart the Direct Line connection. \ No newline at end of file diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md new file mode 100644 index 0000000000..feae54f73c --- /dev/null +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md @@ -0,0 +1,220 @@ +--- +layout: post +title: Integration of Dialogflow in ##Platform_Name## Chat UI Control | Syncfusion +description: Checkout and learn about Integration of Dialogflow in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more. +platform: ej2-asp-core-mvc +control: Integration of Dialogflow +publishingplatform: ##Platform_Name## +documentation: ug +--- + +# Integration of Google Dialogflow With ASP.NET Core Chat UI component + +The Syncfusion Chat UI supports integration with [Google Dialogflow](https://cloud.google.com/dialogflow/docs), enabling advanced conversational AI features in your ASP.NET Core applications. + +## Getting Started With the ChatUI Component + +Before integrating Dialogflow, ensure that the Syncfusion Chat UI component is correctly rendered in your ASP.NET Core app: +[ASP.NET Core Getting Started Guide](../getting-started) + +## Prerequisites + +* Google account to access `Dialogflow` and `Google Cloud Console`. +* .NET SDK (version 6.0 or higher) for ASP.NET Core. +* Syncfusion EJ2 ASP.NET Core installed in your project. +* Dialogflow Service Account with the Dialogflow API Client role and its JSON key file. + +## Install Dependencies +* Install backend dependencies for Dialogflow and server setup using NuGet: + +```bash + +dotnet add package Google.Cloud.Dialogflow.V2 +dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson + +``` +* Install the Syncfusion EJ2 ASP.NET Core package in your project: + +```bash + +dotnet add package Syncfusion.EJ2.AspNet.Core + +``` +## Set Up the Dialogflow Agent + +1. In the Dialogflow console, create an [agent](https://cloud.google.com/agent-assist/docs), set a name (e.g., `MyChatBot`), and configure the default language (e.g., English - `en`). + +2. Add intents with training phrases and responses (e.g., greetings, FAQs). Test using the Dialogflow simulator. + +3. In the Google Cloud Console, go to `APIs & Services` > `Credentials`, create a Service Account with the Dialogflow API Client role, and download the JSON key file. + +> `Security Note`: Never commit the JSON key file to version control. Use environment variables or a secret manager (e.g., Google Cloud Secret Manager) for production. + +## Configure Node.js Backend + +Create `service-acct.json` with your Dialogflow service account credentials in your project root (or use User Secrets for development): + +```json + +{ +"type": "service_account", +"project_id": "your-dialogflow-project-id", +"private_key_id": "abc123xyz...", +"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEv...", +"client_email": "dialogflow-agent@your-dialogflow-project-id.iam.gserviceaccount.com", +... +} +``` +Set up an API controller in `Controllers/ChatController.cs` to handle Dialogflow requests: + +```csharp + +using Google.Cloud.Dialogflow.V2; +using Google.Apis.Auth.OAuth2; +using Microsoft.AspNetCore.Mvc; +using System.Threading.Tasks; + +namespace YourNamespace.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class ChatController : ControllerBase + { + private readonly SessionsClient _sessionsClient; + private readonly string _projectId; + + public ChatController(IConfiguration configuration) + { + var credential = GoogleCredential.FromFile("service-acct.json"); + _sessionsClient = SessionsClient.Create(credential.ToChannelCredentials()); + _projectId = "your-dialogflow-project-id"; // Or from configuration + } + + [HttpPost("message")] + public async Task SendMessage([FromBody] MessageRequest request) + { + var sessionId = request.SessionId ?? "default-session"; + var session = SessionName.FromProjectSession(_projectId, sessionId); + + var queryInput = new QueryInput + { + Text = new TextInput + { + Text = request.Text, + LanguageCode = "en-US" + } + }; + + try + { + var response = await _sessionsClient.DetectIntentAsync(new DetectIntentRequest { Session = session.ToString(), QueryInput = queryInput }); + var reply = response.QueryResult.FulfillmentText; + return Ok(new { reply }); + } + catch (Exception ex) + { + return StatusCode(500, new { reply = "Error connecting to Dialogflow." }); + } + } + } + + public class MessageRequest + { + public string Text { get; set; } + public string SessionId { get; set; } + } +} + +``` +> Use a unique `sessionId` (e.g., Guid) for each user to maintain conversation context. Add the projectId to appsettings.json if needed. + +## Integrate ChatUI in ASP.NET Core + +Use the Chat UI `messageSend` event to exchange messages. This event is triggered before a message is sent, allowing you to forward it to the backend. + +### Forward Message to backend: + +In the messageSend event handler, send a POST request to your backend API endpoint (`/api/chat/message`). The backend forwards the message to Dialogflow and returns the response. + +### Displaying Bot response: + +Use the `addMessage` method to programmatically add the bot's reply to the Chat UI. + +Create `Views/Home/Index.cshtml` (assuming MVC) to integrate the Syncfusion Chat UI with the Dialogflow backend: + +```html + +@using Syncfusion.EJ2.InteractiveChat + +@{ + var currentUserModel = new ChatUIUser { Id = "user1", User = "Albert" }; + var botUserModel = new ChatUIUser { Id = "user2", User = "Bot", AvatarUrl = "https://ej2.syncfusion.com/demos/src/chat-ui/images/bot.png" }; +} + +
+ +
+ + + + + +``` +> Ensure to include Syncfusion scripts and styles in _Layout.cshtml as per the getting started guide. Also, register ` in _Layout.cshtml.` + +## Run and Test + +### Start the Application: + +Navigate to your project folder and run: + +```bash + +dotnet run + +``` + + Open your app and chat with your Dialogflow-powered bot. + +![ChatUI with Dialogflow](../../images/dialogflow.png) + +## Troubleshooting: + +* `Permission Denied`: Ensure the service account has the `Dialogflow API Client` role in the Google Cloud Console. +* `CORS Error`: Configure CORS in Program.cs if needed (e.g., app.UseCors()). +* `No Response`: Test intents in the Dialogflow Console simulator to ensure they are configured correctly. +* `Quota Exceeded`: Check Dialogflow API quotas in the Google Cloud Console. +* `Network Issues`: Confirm the application is running and the API URL is correct. +* `Invalid Credentials`: Verify the service account JSON or configuration settings are correctly set up. \ No newline at end of file diff --git a/ej2-asp-core-mvc/chat-ui/images/dialogflow.png b/ej2-asp-core-mvc/chat-ui/images/dialogflow.png new file mode 100644 index 0000000000000000000000000000000000000000..8b96f608e9f47c5a16749fed251df4d9a8a8b621 GIT binary patch literal 33992 zcmb?@WmH_>mn9BK&=6dML*ed(P(W~ZcX!tc777o+J;B{wgL`l*+}+)$^83%~?k_#l z)6*YVtjDW5_n!OSJ!jv2_90ABUJ~ss;aeCO7&NIbKxG&h*eMtoI35%v=wE(!SLH%~ z!MZ3*eugRkL%a{YK(G*%6NQ1Pih1{Bgb2NU6(1qSB5>)#*P6>~CA7?@x^DWIsT zr~dKsn@_4UF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H05-mUNg-|j2B0!Vfm+I490O0$o&uhHBTui~J@bm1n?HD2w6WUo5Ez^@2Ri%xN7xQ z*Q4=KG>O)0wxHbL59Ne0L)DOqT3wW(0Vt7^(S;(pILS;I^QE@Oh0AUEGLp2X$vEW{ zaOGtP+oK4}z4$pmGh2rU>}>_Dc?*5Iag5#mlntoSVX!(8ZOus(-GaNa{JL=9c>SQv z_4|G{Wn%{ElvMocw`@mQ2%6Dsj4|t@H)*YU4Gp6U z&%<#&$(4^P3)6L16w-ssyUKF>Us(P;j$6OLtu$7ko}>KnslM_Y=^^Z+)v(+W5bXrm zHrs^)DEKV_)D`84XuJ;8wrn7~WV<6bsr6o)PrF&vyR)hZ)P%!ll$I?t*=P37*_I*> z1+*_M~Y-ca`zQhAk zX5@QYC;O~wM~%RP?l1{9^rv>c;ZNYi9gb>u>>x80&Mzq->ERCA4@pF`ynLfj_ z5);!!hqQ%36Ej%>2BrBFR$8%QZ5Ccdy?|~T*PPeNYnd3b5f*1tSe&i|Fs t&+vcv2iHHne()gVh>VJaMBB4RoEVmc>{JXvp=XGnFOrH9)nZ0L{};jzu4@1Q literal 0 HcmV?d00001 diff --git a/ej2-asp-core-toc.html b/ej2-asp-core-toc.html index 40c21fa2f7..09f28c453e 100644 --- a/ej2-asp-core-toc.html +++ b/ej2-asp-core-toc.html @@ -560,6 +560,16 @@
  • Getting Started
  • Messages
  • +
  • Chat Bot Integrations + +
  • Time break
  • Timestamp
  • Typing indicator
  • diff --git a/ej2-asp-mvc-toc.html b/ej2-asp-mvc-toc.html index 2ca0fc8e33..38822b222a 100644 --- a/ej2-asp-mvc-toc.html +++ b/ej2-asp-mvc-toc.html @@ -563,6 +563,16 @@
    • Getting Started
    • Messages
    • +
    • Chat Bot Integrations + +
    • Time break
    • Timestamp
    • Typing indicator
    • From 93b8f33562b3a49245e650357c4fe41e24a76481 Mon Sep 17 00:00:00 2001 From: TamilRamGanesan-SF5080 Date: Thu, 28 Aug 2025 12:44:59 +0530 Subject: [PATCH 2/3] 976152: updated changes in md file --- .../integration-with-bot-framework.md | 30 ++++++++++------- .../integration-with-dialogflow.md | 23 ++++++------- .../integration-with-bot-framework.md | 25 ++++++++++----- .../integration-with-dialogflow.md.md | 32 +++++++++---------- 4 files changed, 62 insertions(+), 48 deletions(-) diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md index aa500880f0..cb785c4a7d 100644 --- a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md @@ -60,7 +60,8 @@ Install-Package Syncfusion.EJ2.MVC5 Create a Web API controller in your ASP.NET MVC project to handle Direct Line token generation. Add `Controllers/TokenController.cs`: -```csharp +{% tabs %} +{% highlight cs tabtitle="TokenController.cs" %} using System; using System.Configuration; @@ -75,7 +76,6 @@ namespace YourNamespace.Controllers public class TokenController : ApiController { private static readonly HttpClient _httpClient = new HttpClient(); - [HttpPost] [Route("api/token/directline/token")] public async Task GenerateToken() @@ -85,15 +85,12 @@ namespace YourNamespace.Controllers { return BadRequest("Direct Line secret is not configured."); } - try { var request = new HttpRequestMessage(HttpMethod.Post, "https://directline.botframework.com/v3/directline/tokens/generate"); request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", directLineSecret); - var response = await _httpClient.SendAsync(request); response.EnsureSuccessStatusCode(); - var responseContent = await response.Content.ReadAsStringAsync(); dynamic tokenResponse = JsonConvert.DeserializeObject(responseContent); return Ok(new { token = tokenResponse.token }); @@ -106,16 +103,20 @@ namespace YourNamespace.Controllers } } -``` +{% endhighlight %} +{% endtabs %} Add the Direct Line secret to `Web.config`: -```xml +{% tabs %} +{% highlight js tabtitle=".env" %} -``` +{% endhighlight %} +{% endtabs %} + >`Security Note`: Store the Direct Line secret in a secure configuration, such as Azure Key Vault, for production environments. ## Integrate ChatUI in ASP.NET MVC @@ -124,7 +125,8 @@ Use the Chat UI `messageSend` event to handle message exchanges. This event is t Create `Views/Home/Index.cshtml` to integrate the Syncfusion Chat UI with the Direct Line API: -```html +{% tabs %} +{% highlight Html tabtitle="Index.cshtml" %} @using Syncfusion.EJ2.InteractiveChat @@ -196,7 +198,8 @@ Create `Views/Home/Index.cshtml` to integrate the Syncfusion Chat UI with the Di } -``` +{% endhighlight %} +{% endtabs %} >Ensure Syncfusion scripts and styles are included in `_Layout.cshtml` as per the getting started guide. Also, include the Bot Framework Web Chat script for Direct Line functionality. Register the Syncfusion script manager in `_Layout.cshtml`. @@ -204,7 +207,9 @@ Create `Views/Home/Index.cshtml` to integrate the Syncfusion Chat UI with the Di To enable CORS for API requests, add to `Web.config` under ``: -```xml +{% tabs %} +{% highlight js tabtitle="Web.config.js" %} + @@ -213,7 +218,8 @@ To enable CORS for API requests, add to `Web.config` under ``: -``` +{% endhighlight %} +{% endtabs %} ## Run and Test diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md index 689e22f374..38935f99c5 100644 --- a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-dialogflow.md @@ -57,7 +57,8 @@ Install-Package Syncfusion.EJ2.MVC5 Create `service-acct.json` with your Dialogflow service account credentials in your project root: -```json +{% tabs %} +{% highlight js tabtitle="service-acct.json" %} { "type": "service_account", @@ -68,11 +69,13 @@ Create `service-acct.json` with your Dialogflow service account credentials in y ... } -``` +{% endhighlight %} +{% endtabs %} Set up a Web API controller in `Controllers/ChatController.cs` to handle Dialogflow requests: -```csharp +{% tabs %} +{% highlight cs tabtitle="ChatController.cs" %} using Google.Cloud.Dialogflow.V2; using Google.Apis.Auth.OAuth2; @@ -87,21 +90,18 @@ namespace YourNamespace.Controllers { private readonly SessionsClient _sessionsClient; private readonly string _projectId; - public ChatController() { var credential = GoogleCredential.FromFile("service-acct.json"); _sessionsClient = SessionsClient.Create(credential.ToChannelCredentials()); _projectId = ConfigurationManager.AppSettings["DialogflowProjectId"]; // Or hardcode from JSON } - [HttpPost] [Route("api/chat/message")] public async Task SendMessage([FromBody] MessageRequest request) { var sessionId = request.SessionId ?? "default-session"; var session = SessionName.FromProjectSession(_projectId, sessionId); - var queryInput = new QueryInput { Text = new TextInput @@ -110,7 +110,6 @@ namespace YourNamespace.Controllers LanguageCode = "en-US" } }; - try { var response = await _sessionsClient.DetectIntentAsync(new DetectIntentRequest { Session = session.ToString(), QueryInput = queryInput }); @@ -123,7 +122,6 @@ namespace YourNamespace.Controllers } } } - public class MessageRequest { public string Text { get; set; } @@ -131,7 +129,8 @@ namespace YourNamespace.Controllers } } -``` +{% endhighlight %} +{% endtabs %} > Use a unique `sessionId` (e.g., Guid) for each user to maintain conversation context. Add the projectId to Web.config if needed: @@ -149,7 +148,8 @@ Use the `addMessage` method to programmatically add the bot's reply to the Chat Create `Views/Home/Index.cshtml` to integrate the Syncfusion Chat UI with the Dialogflow backend: -```html +{% tabs %} +{% highlight Html tabtitle="Index.cshtml" %} @using Syncfusion.EJ2.InteractiveChat @@ -197,7 +197,8 @@ Create `Views/Home/Index.cshtml` to integrate the Syncfusion Chat UI with the Di } -``` +{% endhighlight %} +{% endtabs %} > Ensure to include Syncfusion scripts and styles in `_Layout.cshtml` as per the getting started guide. Also, register the Syncfusion script manager in `_Layout.cshtml`. diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md index 3a50bb59af..260a19406d 100644 --- a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md @@ -58,7 +58,8 @@ dotnet add package Syncfusion.EJ2.AspNet.Core Create a controller in your ASP.NET Core project to handle Direct Line token generation. Add `Controllers/TokenController.cs`: -```csharp +{% tabs %} +{% highlight cs tabtitle="TokenController.cs" %} using Microsoft.AspNetCore.Mvc; using System.Net.Http; @@ -109,10 +110,13 @@ namespace YourNamespace.Controllers } } -``` +{% endhighlight %} +{% endtabs %} + Add the Direct Line secret to `appsettings.json`: -```bash +{% tabs %} +{% highlight js tabtitle="appsettings.json" %} { "DirectLine": { @@ -120,7 +124,8 @@ Add the Direct Line secret to `appsettings.json`: } } -``` +{% endhighlight %} +{% endtabs %} > `Security Note`: Store the Direct Line secret in a secure configuration, such as Azure Key Vault, for production environments.| @@ -129,7 +134,8 @@ Add the Direct Line secret to `appsettings.json`: Use the Chat UI `messageSend` event to handle message exchanges. This event is triggered before a message is sent, allowing you to forward it to the bot via the Direct Line API. Use the `addMessage` method to programmatically add the bot's reply to the Chat UI. Create `Views/Home/Index.cshtml` (assuming MVC) to integrate the Syncfusion Chat UI with the Direct Line API: -```html +{% tabs %} +{% highlight Html tabtitle="Index.cshtml" %} @using Syncfusion.EJ2.InteractiveChat @@ -201,7 +207,8 @@ Create `Views/Home/Index.cshtml` (assuming MVC) to integrate the Syncfusion Chat } -``` +{% endhighlight %} +{% endtabs %} > Ensure Syncfusion scripts and styles are included in `_Layout.cshtml` as per the getting started guide. Also, register `` in `_Layout.cshtml`. Include the Bot Framework Web Chat script for Direct Line functionality. @@ -209,7 +216,8 @@ Create `Views/Home/Index.cshtml` (assuming MVC) to integrate the Syncfusion Chat Ensure CORS and HttpClient are configured in `Program.cs`: -```csharp +{% tabs %} +{% highlight cs tabtitle="Program.cs" %} var builder = WebApplication.CreateBuilder(args); @@ -231,7 +239,8 @@ app.MapControllers(); app.Run(); -``` +{% endhighlight %} +{% endtabs %} ## Run and Test diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md index feae54f73c..29876af9b8 100644 --- a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md @@ -54,7 +54,8 @@ dotnet add package Syncfusion.EJ2.AspNet.Core Create `service-acct.json` with your Dialogflow service account credentials in your project root (or use User Secrets for development): -```json +{% tabs %} +{% highlight js tabtitle="service-acct.json" %} { "type": "service_account", @@ -64,10 +65,13 @@ Create `service-acct.json` with your Dialogflow service account credentials in y "client_email": "dialogflow-agent@your-dialogflow-project-id.iam.gserviceaccount.com", ... } -``` +{% endhighlight %} +{% endtabs %} + Set up an API controller in `Controllers/ChatController.cs` to handle Dialogflow requests: -```csharp +{% tabs %} +{% highlight cs tabtitle="ChatController.cs" %} using Google.Cloud.Dialogflow.V2; using Google.Apis.Auth.OAuth2; @@ -82,20 +86,17 @@ namespace YourNamespace.Controllers { private readonly SessionsClient _sessionsClient; private readonly string _projectId; - public ChatController(IConfiguration configuration) { var credential = GoogleCredential.FromFile("service-acct.json"); _sessionsClient = SessionsClient.Create(credential.ToChannelCredentials()); _projectId = "your-dialogflow-project-id"; // Or from configuration } - [HttpPost("message")] public async Task SendMessage([FromBody] MessageRequest request) { var sessionId = request.SessionId ?? "default-session"; var session = SessionName.FromProjectSession(_projectId, sessionId); - var queryInput = new QueryInput { Text = new TextInput @@ -104,7 +105,6 @@ namespace YourNamespace.Controllers LanguageCode = "en-US" } }; - try { var response = await _sessionsClient.DetectIntentAsync(new DetectIntentRequest { Session = session.ToString(), QueryInput = queryInput }); @@ -117,7 +117,6 @@ namespace YourNamespace.Controllers } } } - public class MessageRequest { public string Text { get; set; } @@ -125,7 +124,9 @@ namespace YourNamespace.Controllers } } -``` +{% endhighlight %} +{% endtabs %} + > Use a unique `sessionId` (e.g., Guid) for each user to maintain conversation context. Add the projectId to appsettings.json if needed. ## Integrate ChatUI in ASP.NET Core @@ -142,29 +143,25 @@ Use the `addMessage` method to programmatically add the bot's reply to the Chat Create `Views/Home/Index.cshtml` (assuming MVC) to integrate the Syncfusion Chat UI with the Dialogflow backend: -```html +{% tabs %} +{% highlight Html tabtitle="Index.cshtml" %} @using Syncfusion.EJ2.InteractiveChat - @{ var currentUserModel = new ChatUIUser { Id = "user1", User = "Albert" }; var botUserModel = new ChatUIUser { Id = "user2", User = "Bot", AvatarUrl = "https://ej2.syncfusion.com/demos/src/chat-ui/images/bot.png" }; } -
      - - -``` +{% endhighlight %} +{% endtabs %} + > Ensure to include Syncfusion scripts and styles in _Layout.cshtml as per the getting started guide. Also, register ` in _Layout.cshtml.` ## Run and Test From f224c24add2acfc6e99d977366fbda777916c22a Mon Sep 17 00:00:00 2001 From: TamilRamGanesan-SF5080 Date: Thu, 28 Aug 2025 13:15:57 +0530 Subject: [PATCH 3/3] 976152: resolved the CI failure --- .../bot-integrations/integration-with-bot-framework.md | 4 ++-- .../bot-integrations/integration-with-bot-framework.md | 4 ++-- ...n-with-dialogflow.md.md => integration-with-dialogflow.md} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/{integration-with-dialogflow.md.md => integration-with-dialogflow.md} (100%) diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md index cb785c4a7d..24cd5ed668 100644 --- a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.MVC/bot-integrations/integration-with-bot-framework.md @@ -1,6 +1,6 @@ --- layout: post -title: Integration of Microsoft Bot in ##Platform_Name## Chat UI Control | Syncfusion +title: Microsoft Bot in ##Platform_Name## Chat UI Control | Syncfusion description: Checkout and learn about Integration of Microsoft Bot in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more. platform: ej2-asp-core-mvc control: Integration of Microsoft Bot @@ -8,7 +8,7 @@ publishingplatform: ##Platform_Name## documentation: ug --- -# Integration of Microsoft Bot Framework With ASP.NET MVC Chat UI component +# Microsoft Bot Framework With ASP.NET MVC Chat UI component The Syncfusion ASP.NET MVC Chat UI supports integration with a Microsoft Bot Framework bot hosted on Azure, enabling a custom chat interface for seamless user interaction. The process involves setting up a secure backend token server, configuring the bot in Azure, and integrating the Syncfusion Chat UI in an ASP.NET MVC application. diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md index 260a19406d..587b6b9c94 100644 --- a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md +++ b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-bot-framework.md @@ -1,6 +1,6 @@ --- layout: post -title: Integration of Microsoft Bot in ##Platform_Name## Chat UI Control | Syncfusion +title: Microsoft Bot in ##Platform_Name## Chat UI Control | Syncfusion description: Checkout and learn about Integration of Microsoft Bot in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more. platform: ej2-asp-core-mvc control: Integration of Microsoft Bot @@ -8,7 +8,7 @@ publishingplatform: ##Platform_Name## documentation: ug --- -# Integration of Microsoft Bot Framework With ASP.NET Core Chat UI component +# Microsoft Bot Framework With ASP.NET Core Chat UI component The Syncfusion ASP.NET Core Chat UI supports integration with a Microsoft Bot Framework bot hosted on Azure, enabling a custom chat interface for seamless user interaction. The process involves setting up a secure backend token server, configuring the bot in Azure, and integrating the Syncfusion Chat UI in an ASP.NET Core application. diff --git a/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md b/ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md similarity index 100% rename from ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md.md rename to ej2-asp-core-mvc/chat-ui/EJ2_ASP.NETCORE/bot-integrations/integration-with-dialogflow.md