### Traditional RAG API Request Example Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/README.md An example of a POST request to the /rag/traditional API endpoint, demonstrating how to send a query for the Traditional RAG service. ```json POST /rag/traditional { "query": "Find best hotels in Sedona" } ``` -------------------------------- ### Agentic RAG API Request Example Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/README.md An example of a POST request to the /rag/agentic API endpoint, showing how to provide a prompt for the Agentic RAG service to plan a trip. ```json POST /rag/agentic { "prompt": "Plan a weekend trip for family to Acadia National Park" } ``` -------------------------------- ### Generate Response using Traditional RAG in C# Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/README.md C# code snippet demonstrating how to call the `GenerateResponseUsingTraditionalRag` method on a `ragService` object to get a response based on a user query. ```csharp var result = await ragService.GenerateResponseUsingTraditionalRag("Best hotels in Bar Harbor?"); Console.WriteLine(result); ``` -------------------------------- ### Generate Response using Agentic RAG in C# Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/README.md C# code snippet illustrating how to use the `GenerateResponseUsingAgenticRag` method with a `ragService` object to get a response that involves agentic reasoning and tool invocation. ```csharp var result = await ragService.GenerateResponseUsingAgenticRag("What's the weather like for a trip to Acadia National Park?"); Console.WriteLine(result); ``` -------------------------------- ### Run Project using .NET CLI Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/README.md Instructions for cloning the repository, navigating to the project directory, restoring dependencies, building, and running the .NET application using the .NET CLI. ```bash git clone https://github.com/your-username/AgenticRAG.git cd AgenticRAG dotnet restore dotnet build dotnet run ``` -------------------------------- ### Configure Azure Services in launchSettings.json Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/README.md This snippet shows the environment variables required in launchSettings.json to configure Azure OpenAI and Azure AI Search services, including resource names, keys, and deployment names. ```json "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "AZURE_OPENAI_URL": "https://.openai.azure.com", "AZURE_OPENAI_KEY": "", "AZURE_AI_SEARCH_URL": "https://.search.windows.net", "AZURE_AI_SEARCH_KEY": "", "EMBEDDING_DEPLOYMENT_NAME": "", "GPT_DEPLOYMENT_NAME": "", "INDEX_NAME": "" }, ``` -------------------------------- ### Import Weather Plugin in Semantic Kernel Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/README.md C# code demonstrating how to import a 'WeatherPlugin' into the Semantic Kernel, making its functionality available for agentic workflows. ```csharp kernel.ImportPluginFromType("searchWeather"); ``` -------------------------------- ### Send Traditional RAG Prompt Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/AgenticRAG/AgenticRAG/wwwroot/index.html Sends a user prompt to the traditional RAG endpoint. It handles user input, displays messages in a chat interface, makes a POST request to the '/traditionalRag' endpoint, and processes the response or errors. Dependencies include DOM manipulation for input and chat elements. ```JavaScript async function sendTraditional() { const input = document.getElementById('traditional-input'); const chat = document.getElementById('traditional-chat'); const prompt = input.value.trim(); if (!prompt) return; chat.innerHTML += `
You: ${prompt}
`; input.value = ""; try { const response = await fetch('https://localhost:7037/traditionalRag', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt }) }); if (!response.ok) { const errorData = await response.json(); chat.innerHTML += `
Error: ${errorData.message || 'Something went wrong'}
`; } else { const data = await response.json(); chat.innerHTML += `
RAG: ${data.content}
`; } } catch (error) { console.error("Fetch error:", error); chat.innerHTML += `
Error: Could not connect to the server.
`; } finally { chat.scrollTop = chat.scrollHeight; } } ``` -------------------------------- ### Send Agentic RAG Prompt Source: https://github.com/akshaykokane/implementing-agentic-rag-with-semantic-kernel-and-azure-ai-search/blob/main/AgenticRAG/AgenticRAG/wwwroot/index.html Sends a user prompt to the agentic RAG endpoint. This function is similar to sendTraditional but targets the '/agenticRag' endpoint and displays responses with a different styling. It manages user input, chat display, network requests, and error handling. ```JavaScript async function sendAgentic() { const input = document.getElementById('agentic-input'); const chat = document.getElementById('agentic-chat'); const prompt = input.value.trim(); if (!prompt) return; chat.innerHTML += `
You: ${prompt}
`; input.value = ""; try { const response = await fetch('https://localhost:7037/agenticRag', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt }) }); if (!response.ok) { const errorData = await response.json(); chat.innerHTML += `
Error: ${errorData.message || 'Something went wrong'}
`; } else { const data = await response.json(); chat.innerHTML += `
Agentic RAG: ${data.content}
`; } } catch (error) { console.error("Fetch error:", error); chat.innerHTML += `
Error: Could not connect to the server.
`; } finally { chat.scrollTop = chat.scrollHeight; } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.