├── readme.txt ├── obj ├── Debug │ └── net7.0 │ │ ├── OpenAITest1.csproj.CopyComplete │ │ ├── OpenAITest1.csproj.BuildWithSkipAnalyzers │ │ ├── BlazorCopilot1.csproj.BuildWithSkipAnalyzers │ │ ├── OpenAITest1.MvcApplicationPartsAssemblyInfo.cache │ │ ├── BlazorCopilot1.MvcApplicationPartsAssemblyInfo.cache │ │ ├── OpenAITest1.RazorAssemblyInfo.cache │ │ ├── OpenAITest1.genruntimeconfig.cache │ │ ├── BlazorCopilot1.AssemblyInfoInputs.cache │ │ ├── BlazorCopilot1.RazorAssemblyInfo.cache │ │ ├── BlazorCopilot1.genruntimeconfig.cache │ │ ├── OpenAITest1.AssemblyInfoInputs.cache │ │ ├── BlazorCopilot1.csproj.CoreCompileInputs.cache │ │ ├── OpenAITest1.csproj.CoreCompileInputs.cache │ │ ├── apphost.exe │ │ ├── OpenAITest1.dll │ │ ├── OpenAITest1.pdb │ │ ├── BlazorCopilot1.dll │ │ ├── BlazorCopilot1.pdb │ │ ├── ref │ │ ├── OpenAITest1.dll │ │ └── BlazorCopilot1.dll │ │ ├── refint │ │ ├── OpenAITest1.dll │ │ └── BlazorCopilot1.dll │ │ ├── OpenAITest1.assets.cache │ │ ├── BlazorCopilot1.assets.cache │ │ ├── staticwebassets │ │ ├── msbuild.buildMultiTargeting.OpenAITest1.props │ │ ├── msbuild.build.BlazorCopilot1.props │ │ ├── msbuild.build.OpenAITest1.props │ │ ├── msbuild.buildMultiTargeting.BlazorCopilot1.props │ │ ├── msbuild.buildTransitive.OpenAITest1.props │ │ ├── msbuild.buildTransitive.BlazorCopilot1.props │ │ ├── msbuild.OpenAITest1.Microsoft.AspNetCore.StaticWebAssets.props │ │ └── msbuild.BlazorCopilot1.Microsoft.AspNetCore.StaticWebAssets.props │ │ ├── OpenAITest1.csproj.AssemblyReference.cache │ │ ├── BlazorCopilot1.csproj.AssemblyReference.cache │ │ ├── OpenAITest1.RazorAssemblyInfo.cs │ │ ├── BlazorCopilot1.RazorAssemblyInfo.cs │ │ ├── OpenAITest1.GlobalUsings.g.cs │ │ ├── BlazorCopilot1.GlobalUsings.g.cs │ │ ├── OpenAITest1.AssemblyInfo.cs │ │ ├── BlazorCopilot1.AssemblyInfo.cs │ │ ├── scopedcss │ │ ├── Shared │ │ │ └── MainLayout.razor.rz.scp.css │ │ ├── bundle │ │ │ ├── OpenAITest1.styles.css │ │ │ └── BlazorCopilot1.styles.css │ │ └── projectbundle │ │ │ ├── OpenAITest1.bundle.scp.css │ │ │ └── BlazorCopilot1.bundle.scp.css │ │ ├── BlazorCopilot1.GeneratedMSBuildEditorConfig.editorconfig │ │ ├── OpenAITest1.GeneratedMSBuildEditorConfig.editorconfig │ │ ├── staticwebassets.development.json │ │ ├── OpenAITest1.csproj.FileListAbsolute.txt │ │ ├── staticwebassets.pack.json │ │ ├── BlazorCopilot1.csproj.FileListAbsolute.txt │ │ └── staticwebassets.build.json ├── BlazorCopilot1.csproj.nuget.g.targets ├── OpenAITest1.csproj.nuget.g.targets ├── BlazorCopilot1.csproj.nuget.g.props ├── OpenAITest1.csproj.nuget.g.props ├── project.nuget.cache ├── BlazorCopilot1.csproj.nuget.dgspec.json ├── OpenAITest1.csproj.nuget.dgspec.json └── project.assets.json ├── wwwroot ├── favicon.png ├── css │ ├── open-iconic │ │ ├── font │ │ │ ├── fonts │ │ │ │ ├── open-iconic.eot │ │ │ │ ├── open-iconic.otf │ │ │ │ ├── open-iconic.ttf │ │ │ │ ├── open-iconic.woff │ │ │ │ └── open-iconic.svg │ │ │ └── css │ │ │ │ └── open-iconic-bootstrap.min.css │ │ ├── ICON-LICENSE │ │ ├── README.md │ │ └── FONT-LICENSE │ └── site.css └── JSHelpers.js ├── Pages ├── Index.razor ├── Error.cshtml.cs ├── _Host.cshtml └── Error.cshtml ├── appsettings.Development.json ├── BlazorCopilot1.csproj.user ├── Shared ├── MainLayout.razor └── MainLayout.razor.css ├── appsettings.json ├── _Imports.razor ├── Data └── Message.cs ├── BlazorCopilot1.csproj ├── App.razor ├── Properties └── launchSettings.json ├── LICENSE ├── BlazorCopilot1.sln ├── Program.cs ├── Services └── ChatService.cs ├── Components └── Chat.razor └── .gitignore /readme.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.csproj.CopyComplete: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.csproj.BuildWithSkipAnalyzers: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.csproj.BuildWithSkipAnalyzers: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.MvcApplicationPartsAssemblyInfo.cache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.MvcApplicationPartsAssemblyInfo.cache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.RazorAssemblyInfo.cache: -------------------------------------------------------------------------------- 1 | 5860763757f4f08c7ebdea1b3a94a18109f17861 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.genruntimeconfig.cache: -------------------------------------------------------------------------------- 1 | 42a061601440597c35df7f710eb0d21f4bfe75eb 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | e0d37a8cce2947e6aedacab7d39589859a2b1399 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.RazorAssemblyInfo.cache: -------------------------------------------------------------------------------- 1 | 5860763757f4f08c7ebdea1b3a94a18109f17861 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.genruntimeconfig.cache: -------------------------------------------------------------------------------- 1 | c8320bce18ced5761a2e18a2d651560bd2e4144e 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 631e8858bf7be71ffcc2323a74ce6c76ec235aa7 2 | -------------------------------------------------------------------------------- /wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/wwwroot/favicon.png -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 6192dd3c1105568344e81472675d4df7be9284a8 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 39c47fa4a6e57b0f9d5246027974ed9df796fbb5 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/apphost.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/apphost.exe -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/OpenAITest1.dll -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/OpenAITest1.pdb -------------------------------------------------------------------------------- /Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCopilot1.Components 2 | @page "/" 3 | 4 | Blazor Copilot 5 | 6 | 7 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/BlazorCopilot1.dll -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/BlazorCopilot1.pdb -------------------------------------------------------------------------------- /obj/Debug/net7.0/ref/OpenAITest1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/ref/OpenAITest1.dll -------------------------------------------------------------------------------- /obj/Debug/net7.0/ref/BlazorCopilot1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/ref/BlazorCopilot1.dll -------------------------------------------------------------------------------- /obj/Debug/net7.0/refint/OpenAITest1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/refint/OpenAITest1.dll -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/OpenAITest1.assets.cache -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/BlazorCopilot1.assets.cache -------------------------------------------------------------------------------- /obj/Debug/net7.0/refint/BlazorCopilot1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/refint/BlazorCopilot1.dll -------------------------------------------------------------------------------- /obj/Debug/net7.0/staticwebassets/msbuild.buildMultiTargeting.OpenAITest1.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/staticwebassets/msbuild.build.BlazorCopilot1.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/staticwebassets/msbuild.build.OpenAITest1.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/staticwebassets/msbuild.buildMultiTargeting.BlazorCopilot1.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/staticwebassets/msbuild.buildTransitive.OpenAITest1.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /obj/Debug/net7.0/staticwebassets/msbuild.buildTransitive.BlazorCopilot1.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/OpenAITest1.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /obj/BlazorCopilot1.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codingwithtom1/blazorcopilot1/HEAD/obj/Debug/net7.0/BlazorCopilot1.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /obj/OpenAITest1.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /BlazorCopilot1.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | https 5 | 6 | -------------------------------------------------------------------------------- /Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | Blazor Copilot 4 | 5 |
6 |
7 |
8 | Blazor Copilot 9 |
10 | 11 |
12 | @Body 13 |
14 |
15 |
16 | -------------------------------------------------------------------------------- /appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Azure": { 3 | "OpenAIUrl": "https://[YOURHOST].openai.azure.com/", 4 | "OpenAIKey": "YOURKEY", 5 | "OpenAIDeploymentModel": "YOURDEPLOYMENTMODEL" 6 | }, 7 | "Logging": { 8 | "LogLevel": { 9 | "Default": "Information", 10 | "Microsoft.AspNetCore": "Warning" 11 | } 12 | }, 13 | "AllowedHosts": "*" 14 | } 15 | -------------------------------------------------------------------------------- /_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using Microsoft.AspNetCore.Authorization 3 | @using Microsoft.AspNetCore.Components.Authorization 4 | @using Microsoft.AspNetCore.Components.Forms 5 | @using Microsoft.AspNetCore.Components.Routing 6 | @using Microsoft.AspNetCore.Components.Web 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using BlazorCopilot1 10 | @using BlazorCopilot1.Shared 11 | -------------------------------------------------------------------------------- /Data/Message.cs: -------------------------------------------------------------------------------- 1 | namespace BlazorCopilot1.Data 2 | { 3 | public class Message 4 | { 5 | public DateTime TimeStamp { get; set; } 6 | public string? Body { get; set; } 7 | public bool IsRequest { get; set; } 8 | public Message(string body, bool isRequest) 9 | { 10 | TimeStamp = DateTime.Now; 11 | Body = body; 12 | IsRequest = isRequest; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /BlazorCopilot1.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /wwwroot/JSHelpers.js: -------------------------------------------------------------------------------- 1 | 2 | function UpdateScroll(elementid) { 3 | var element = document.getElementById(elementid); 4 | setTimeout(() => { 5 | element.scrollTop = element.scrollHeight; 6 | }, 100); 7 | } 8 | 9 | 10 | function submitOnEnter(event) { 11 | if (event.which === 13) { 12 | if (!event.repeat) { 13 | const newEvent = new Event("submit", {cancelable: true}); 14 | event.target.form.dispatchEvent(newEvent); 15 | } 16 | event.preventDefault(); // Prevents the addition of a new line in the text field 17 | } 18 | } 19 | 20 | function addSubmitOnEnter(element) { 21 | document.getElementById(element).addEventListener("keydown", submitOnEnter); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.RazorAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ProvideApplicationPartFactoryAttribute("Microsoft.AspNetCore.Mvc.ApplicationParts.ConsolidatedAssemblyApplicationPartFact" + 15 | "ory, Microsoft.AspNetCore.Mvc.Razor")] 16 | 17 | // Generated by the MSBuild WriteCodeFragment class. 18 | 19 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.RazorAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ProvideApplicationPartFactoryAttribute("Microsoft.AspNetCore.Mvc.ApplicationParts.ConsolidatedAssemblyApplicationPartFact" + 15 | "ory, Microsoft.AspNetCore.Mvc.Razor")] 16 | 17 | // Generated by the MSBuild WriteCodeFragment class. 18 | 19 | -------------------------------------------------------------------------------- /Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace OpenAITest1.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | [IgnoreAntiforgeryToken] 9 | public class ErrorModel : PageModel 10 | { 11 | public string? RequestId { get; set; } 12 | 13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 14 | 15 | private readonly ILogger _logger; 16 | 17 | public ErrorModel(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | public void OnGet() 23 | { 24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::Microsoft.AspNetCore.Builder; 3 | global using global::Microsoft.AspNetCore.Hosting; 4 | global using global::Microsoft.AspNetCore.Http; 5 | global using global::Microsoft.AspNetCore.Routing; 6 | global using global::Microsoft.Extensions.Configuration; 7 | global using global::Microsoft.Extensions.DependencyInjection; 8 | global using global::Microsoft.Extensions.Hosting; 9 | global using global::Microsoft.Extensions.Logging; 10 | global using global::System; 11 | global using global::System.Collections.Generic; 12 | global using global::System.IO; 13 | global using global::System.Linq; 14 | global using global::System.Net.Http; 15 | global using global::System.Net.Http.Json; 16 | global using global::System.Threading; 17 | global using global::System.Threading.Tasks; 18 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.GlobalUsings.g.cs: -------------------------------------------------------------------------------- 1 | // 2 | global using global::Microsoft.AspNetCore.Builder; 3 | global using global::Microsoft.AspNetCore.Hosting; 4 | global using global::Microsoft.AspNetCore.Http; 5 | global using global::Microsoft.AspNetCore.Routing; 6 | global using global::Microsoft.Extensions.Configuration; 7 | global using global::Microsoft.Extensions.DependencyInjection; 8 | global using global::Microsoft.Extensions.Hosting; 9 | global using global::Microsoft.Extensions.Logging; 10 | global using global::System; 11 | global using global::System.Collections.Generic; 12 | global using global::System.IO; 13 | global using global::System.Linq; 14 | global using global::System.Net.Http; 15 | global using global::System.Net.Http.Json; 16 | global using global::System.Threading; 17 | global using global::System.Threading.Tasks; 18 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("OpenAITest1")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("OpenAITest1")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("OpenAITest1")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | using System; 12 | using System.Reflection; 13 | 14 | [assembly: System.Reflection.AssemblyCompanyAttribute("BlazorCopilot1")] 15 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 16 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 17 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 18 | [assembly: System.Reflection.AssemblyProductAttribute("BlazorCopilot1")] 19 | [assembly: System.Reflection.AssemblyTitleAttribute("BlazorCopilot1")] 20 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 21 | 22 | // Generated by the MSBuild WriteCodeFragment class. 23 | 24 | -------------------------------------------------------------------------------- /Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:14111", 7 | "sslPort": 44327 8 | } 9 | }, 10 | "profiles": { 11 | "http": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "http://localhost:5087", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "https": { 21 | "commandName": "Project", 22 | "dotnetRunMessages": true, 23 | "launchBrowser": true, 24 | "applicationUrl": "https://localhost:7218;http://localhost:5087", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | }, 29 | "IIS Express": { 30 | "commandName": "IISExpress", 31 | "launchBrowser": true, 32 | "environmentVariables": { 33 | "ASPNETCORE_ENVIRONMENT": "Development" 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 codingwithtom1 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /BlazorCopilot1.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.6.33801.468 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCopilot1", "BlazorCopilot1.csproj", "{35B78356-D1F8-4896-86CE-26251830C466}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {35B78356-D1F8-4896-86CE-26251830C466}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {35B78356-D1F8-4896-86CE-26251830C466}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {35B78356-D1F8-4896-86CE-26251830C466}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {35B78356-D1F8-4896-86CE-26251830C466}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {8F07BBD1-25D6-4FAF-AE2C-C144223C2992} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using Microsoft.AspNetCore.Components.Web; 3 | using BlazorCopilot1.Services; 4 | 5 | namespace BlazorCopilot1 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | var builder = WebApplication.CreateBuilder(args); 12 | 13 | // Add services to the container. 14 | builder.Services.AddRazorPages(); 15 | builder.Services.AddServerSideBlazor(); 16 | builder.Services.AddSingleton(); 17 | 18 | var app = builder.Build(); 19 | 20 | // Configure the HTTP request pipeline. 21 | if (!app.Environment.IsDevelopment()) 22 | { 23 | app.UseExceptionHandler("/Error"); 24 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 25 | app.UseHsts(); 26 | } 27 | 28 | app.UseHttpsRedirection(); 29 | 30 | app.UseStaticFiles(); 31 | 32 | app.UseRouting(); 33 | 34 | app.MapBlazorHub(); 35 | app.MapFallbackToPage("/_Host"); 36 | 37 | app.Run(); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /obj/BlazorCopilot1.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\home\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages 9 | PackageReference 10 | 6.6.0 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /obj/OpenAITest1.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\home\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages 9 | PackageReference 10 | 6.6.0 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /obj/project.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "dgSpecHash": "tsPAuGcfG5pNKp0vOmPmeyeArgR7M4L6SFDHFZ/LZxvjCUlzNO1+tkPChLljO3/D9EGHkaC+Qn7aS2cyxupRDw==", 4 | "success": true, 5 | "projectFilePath": "C:\\temp\\bcp\\BlazorCopilot1.csproj", 6 | "expectedPackageFiles": [ 7 | "C:\\Users\\home\\.nuget\\packages\\azure.ai.openai\\1.0.0-beta.5\\azure.ai.openai.1.0.0-beta.5.nupkg.sha512", 8 | "C:\\Users\\home\\.nuget\\packages\\azure.core\\1.30.0\\azure.core.1.30.0.nupkg.sha512", 9 | "C:\\Users\\home\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\1.1.1\\microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512", 10 | "C:\\Users\\home\\.nuget\\packages\\system.diagnostics.diagnosticsource\\4.6.0\\system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512", 11 | "C:\\Users\\home\\.nuget\\packages\\system.memory.data\\1.0.2\\system.memory.data.1.0.2.nupkg.sha512", 12 | "C:\\Users\\home\\.nuget\\packages\\system.numerics.vectors\\4.5.0\\system.numerics.vectors.4.5.0.nupkg.sha512", 13 | "C:\\Users\\home\\.nuget\\packages\\system.text.encodings.web\\4.7.2\\system.text.encodings.web.4.7.2.nupkg.sha512", 14 | "C:\\Users\\home\\.nuget\\packages\\system.text.json\\4.7.2\\system.text.json.4.7.2.nupkg.sha512", 15 | "C:\\Users\\home\\.nuget\\packages\\system.threading.tasks.extensions\\4.5.4\\system.threading.tasks.extensions.4.5.4.nupkg.sha512" 16 | ], 17 | "logs": [] 18 | } -------------------------------------------------------------------------------- /Pages/_Host.cshtml: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @using Microsoft.AspNetCore.Components.Web 3 | @namespace BlazorCopilot1.Pages 4 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | An error has occurred. This application may no longer respond until reloaded. 24 | 25 | 26 | An unhandled exception has occurred. See browser dev tools for details. 27 | 28 | Reload 29 | 🗙 30 |
31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-start; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth) { 36 | display: none; 37 | } 38 | 39 | .top-row.auth { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a, .top-row .btn-link { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .top-row, article { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model OpenAITest1.Pages.ErrorModel 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Error 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 |

Error.

19 |

An error occurred while processing your request.

20 | 21 | @if (Model.ShowRequestId) 22 | { 23 |

24 | Request ID: @Model.RequestId 25 |

26 | } 27 | 28 |

Development Mode

29 |

30 | Swapping to the Development environment displays detailed information about the error that occurred. 31 |

32 |

33 | The Development environment shouldn't be enabled for deployed applications. 34 | It can result in displaying sensitive information from exceptions to end users. 35 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 36 | and restarting the app. 37 |

38 |
39 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/scopedcss/Shared/MainLayout.razor.rz.scp.css: -------------------------------------------------------------------------------- 1 | .page[b-n76ccmorkq] { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main[b-n76ccmorkq] { 8 | flex: 1; 9 | } 10 | 11 | .sidebar[b-n76ccmorkq] { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row[b-n76ccmorkq] { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-start; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row[b-n76ccmorkq] a, .top-row .btn-link[b-n76ccmorkq] { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | } 28 | 29 | .top-row a:first-child[b-n76ccmorkq] { 30 | overflow: hidden; 31 | text-overflow: ellipsis; 32 | } 33 | 34 | @media (max-width: 640.98px) { 35 | .top-row:not(.auth)[b-n76ccmorkq] { 36 | display: none; 37 | } 38 | 39 | .top-row.auth[b-n76ccmorkq] { 40 | justify-content: space-between; 41 | } 42 | 43 | .top-row a[b-n76ccmorkq], .top-row .btn-link[b-n76ccmorkq] { 44 | margin-left: 0; 45 | } 46 | } 47 | 48 | @media (min-width: 641px) { 49 | .page[b-n76ccmorkq] { 50 | flex-direction: row; 51 | } 52 | 53 | .sidebar[b-n76ccmorkq] { 54 | width: 250px; 55 | height: 100vh; 56 | position: sticky; 57 | top: 0; 58 | } 59 | 60 | .top-row[b-n76ccmorkq] { 61 | position: sticky; 62 | top: 0; 63 | z-index: 1; 64 | } 65 | 66 | .top-row[b-n76ccmorkq], article[b-n76ccmorkq] { 67 | padding-left: 2rem !important; 68 | padding-right: 1.5rem !important; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/scopedcss/bundle/OpenAITest1.styles.css: -------------------------------------------------------------------------------- 1 | /* _content/OpenAITest1/Shared/MainLayout.razor.rz.scp.css */ 2 | .page[b-n76ccmorkq] { 3 | position: relative; 4 | display: flex; 5 | flex-direction: column; 6 | } 7 | 8 | main[b-n76ccmorkq] { 9 | flex: 1; 10 | } 11 | 12 | .sidebar[b-n76ccmorkq] { 13 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 14 | } 15 | 16 | .top-row[b-n76ccmorkq] { 17 | background-color: #f7f7f7; 18 | border-bottom: 1px solid #d6d5d5; 19 | justify-content: flex-start; 20 | height: 3.5rem; 21 | display: flex; 22 | align-items: center; 23 | } 24 | 25 | .top-row[b-n76ccmorkq] a, .top-row .btn-link[b-n76ccmorkq] { 26 | white-space: nowrap; 27 | margin-left: 1.5rem; 28 | } 29 | 30 | .top-row a:first-child[b-n76ccmorkq] { 31 | overflow: hidden; 32 | text-overflow: ellipsis; 33 | } 34 | 35 | @media (max-width: 640.98px) { 36 | .top-row:not(.auth)[b-n76ccmorkq] { 37 | display: none; 38 | } 39 | 40 | .top-row.auth[b-n76ccmorkq] { 41 | justify-content: space-between; 42 | } 43 | 44 | .top-row a[b-n76ccmorkq], .top-row .btn-link[b-n76ccmorkq] { 45 | margin-left: 0; 46 | } 47 | } 48 | 49 | @media (min-width: 641px) { 50 | .page[b-n76ccmorkq] { 51 | flex-direction: row; 52 | } 53 | 54 | .sidebar[b-n76ccmorkq] { 55 | width: 250px; 56 | height: 100vh; 57 | position: sticky; 58 | top: 0; 59 | } 60 | 61 | .top-row[b-n76ccmorkq] { 62 | position: sticky; 63 | top: 0; 64 | z-index: 1; 65 | } 66 | 67 | .top-row[b-n76ccmorkq], article[b-n76ccmorkq] { 68 | padding-left: 2rem !important; 69 | padding-right: 1.5rem !important; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/scopedcss/bundle/BlazorCopilot1.styles.css: -------------------------------------------------------------------------------- 1 | /* _content/BlazorCopilot1/Shared/MainLayout.razor.rz.scp.css */ 2 | .page[b-n76ccmorkq] { 3 | position: relative; 4 | display: flex; 5 | flex-direction: column; 6 | } 7 | 8 | main[b-n76ccmorkq] { 9 | flex: 1; 10 | } 11 | 12 | .sidebar[b-n76ccmorkq] { 13 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 14 | } 15 | 16 | .top-row[b-n76ccmorkq] { 17 | background-color: #f7f7f7; 18 | border-bottom: 1px solid #d6d5d5; 19 | justify-content: flex-start; 20 | height: 3.5rem; 21 | display: flex; 22 | align-items: center; 23 | } 24 | 25 | .top-row[b-n76ccmorkq] a, .top-row .btn-link[b-n76ccmorkq] { 26 | white-space: nowrap; 27 | margin-left: 1.5rem; 28 | } 29 | 30 | .top-row a:first-child[b-n76ccmorkq] { 31 | overflow: hidden; 32 | text-overflow: ellipsis; 33 | } 34 | 35 | @media (max-width: 640.98px) { 36 | .top-row:not(.auth)[b-n76ccmorkq] { 37 | display: none; 38 | } 39 | 40 | .top-row.auth[b-n76ccmorkq] { 41 | justify-content: space-between; 42 | } 43 | 44 | .top-row a[b-n76ccmorkq], .top-row .btn-link[b-n76ccmorkq] { 45 | margin-left: 0; 46 | } 47 | } 48 | 49 | @media (min-width: 641px) { 50 | .page[b-n76ccmorkq] { 51 | flex-direction: row; 52 | } 53 | 54 | .sidebar[b-n76ccmorkq] { 55 | width: 250px; 56 | height: 100vh; 57 | position: sticky; 58 | top: 0; 59 | } 60 | 61 | .top-row[b-n76ccmorkq] { 62 | position: sticky; 63 | top: 0; 64 | z-index: 1; 65 | } 66 | 67 | .top-row[b-n76ccmorkq], article[b-n76ccmorkq] { 68 | padding-left: 2rem !important; 69 | padding-right: 1.5rem !important; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/scopedcss/projectbundle/OpenAITest1.bundle.scp.css: -------------------------------------------------------------------------------- 1 | /* _content/OpenAITest1/Shared/MainLayout.razor.rz.scp.css */ 2 | .page[b-n76ccmorkq] { 3 | position: relative; 4 | display: flex; 5 | flex-direction: column; 6 | } 7 | 8 | main[b-n76ccmorkq] { 9 | flex: 1; 10 | } 11 | 12 | .sidebar[b-n76ccmorkq] { 13 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 14 | } 15 | 16 | .top-row[b-n76ccmorkq] { 17 | background-color: #f7f7f7; 18 | border-bottom: 1px solid #d6d5d5; 19 | justify-content: flex-start; 20 | height: 3.5rem; 21 | display: flex; 22 | align-items: center; 23 | } 24 | 25 | .top-row[b-n76ccmorkq] a, .top-row .btn-link[b-n76ccmorkq] { 26 | white-space: nowrap; 27 | margin-left: 1.5rem; 28 | } 29 | 30 | .top-row a:first-child[b-n76ccmorkq] { 31 | overflow: hidden; 32 | text-overflow: ellipsis; 33 | } 34 | 35 | @media (max-width: 640.98px) { 36 | .top-row:not(.auth)[b-n76ccmorkq] { 37 | display: none; 38 | } 39 | 40 | .top-row.auth[b-n76ccmorkq] { 41 | justify-content: space-between; 42 | } 43 | 44 | .top-row a[b-n76ccmorkq], .top-row .btn-link[b-n76ccmorkq] { 45 | margin-left: 0; 46 | } 47 | } 48 | 49 | @media (min-width: 641px) { 50 | .page[b-n76ccmorkq] { 51 | flex-direction: row; 52 | } 53 | 54 | .sidebar[b-n76ccmorkq] { 55 | width: 250px; 56 | height: 100vh; 57 | position: sticky; 58 | top: 0; 59 | } 60 | 61 | .top-row[b-n76ccmorkq] { 62 | position: sticky; 63 | top: 0; 64 | z-index: 1; 65 | } 66 | 67 | .top-row[b-n76ccmorkq], article[b-n76ccmorkq] { 68 | padding-left: 2rem !important; 69 | padding-right: 1.5rem !important; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/scopedcss/projectbundle/BlazorCopilot1.bundle.scp.css: -------------------------------------------------------------------------------- 1 | /* _content/BlazorCopilot1/Shared/MainLayout.razor.rz.scp.css */ 2 | .page[b-n76ccmorkq] { 3 | position: relative; 4 | display: flex; 5 | flex-direction: column; 6 | } 7 | 8 | main[b-n76ccmorkq] { 9 | flex: 1; 10 | } 11 | 12 | .sidebar[b-n76ccmorkq] { 13 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 14 | } 15 | 16 | .top-row[b-n76ccmorkq] { 17 | background-color: #f7f7f7; 18 | border-bottom: 1px solid #d6d5d5; 19 | justify-content: flex-start; 20 | height: 3.5rem; 21 | display: flex; 22 | align-items: center; 23 | } 24 | 25 | .top-row[b-n76ccmorkq] a, .top-row .btn-link[b-n76ccmorkq] { 26 | white-space: nowrap; 27 | margin-left: 1.5rem; 28 | } 29 | 30 | .top-row a:first-child[b-n76ccmorkq] { 31 | overflow: hidden; 32 | text-overflow: ellipsis; 33 | } 34 | 35 | @media (max-width: 640.98px) { 36 | .top-row:not(.auth)[b-n76ccmorkq] { 37 | display: none; 38 | } 39 | 40 | .top-row.auth[b-n76ccmorkq] { 41 | justify-content: space-between; 42 | } 43 | 44 | .top-row a[b-n76ccmorkq], .top-row .btn-link[b-n76ccmorkq] { 45 | margin-left: 0; 46 | } 47 | } 48 | 49 | @media (min-width: 641px) { 50 | .page[b-n76ccmorkq] { 51 | flex-direction: row; 52 | } 53 | 54 | .sidebar[b-n76ccmorkq] { 55 | width: 250px; 56 | height: 100vh; 57 | position: sticky; 58 | top: 0; 59 | } 60 | 61 | .top-row[b-n76ccmorkq] { 62 | position: sticky; 63 | top: 0; 64 | z-index: 1; 65 | } 66 | 67 | .top-row[b-n76ccmorkq], article[b-n76ccmorkq] { 68 | padding-left: 2rem !important; 69 | padding-right: 1.5rem !important; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/BlazorCopilot1.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = net7.0 3 | build_property.TargetPlatformMinVersion = 4 | build_property.UsingMicrosoftNETSdkWeb = true 5 | build_property.ProjectTypeGuids = 6 | build_property.InvariantGlobalization = 7 | build_property.PlatformNeutralAssembly = 8 | build_property.EnforceExtendedAnalyzerRules = 9 | build_property._SupportedPlatformList = Linux,macOS,Windows 10 | build_property.RootNamespace = BlazorCopilot1 11 | build_property.RootNamespace = BlazorCopilot1 12 | build_property.ProjectDir = C:\temp\bcp\ 13 | build_property.RazorLangVersion = 7.0 14 | build_property.SupportLocalizedComponentNames = 15 | build_property.GenerateRazorMetadataSourceChecksumAttributes = 16 | build_property.MSBuildProjectDirectory = C:\temp\bcp 17 | build_property._RazorSourceGeneratorDebug = 18 | 19 | [C:/temp/bcp/App.razor] 20 | build_metadata.AdditionalFiles.TargetPath = QXBwLnJhem9y 21 | build_metadata.AdditionalFiles.CssScope = 22 | 23 | [C:/temp/bcp/Components/Chat.razor] 24 | build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xDaGF0LnJhem9y 25 | build_metadata.AdditionalFiles.CssScope = 26 | 27 | [C:/temp/bcp/Pages/Index.razor] 28 | build_metadata.AdditionalFiles.TargetPath = UGFnZXNcSW5kZXgucmF6b3I= 29 | build_metadata.AdditionalFiles.CssScope = 30 | 31 | [C:/temp/bcp/_Imports.razor] 32 | build_metadata.AdditionalFiles.TargetPath = X0ltcG9ydHMucmF6b3I= 33 | build_metadata.AdditionalFiles.CssScope = 34 | 35 | [C:/temp/bcp/Shared/MainLayout.razor] 36 | build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXE1haW5MYXlvdXQucmF6b3I= 37 | build_metadata.AdditionalFiles.CssScope = b-o1hh0yxha2 38 | 39 | [C:/temp/bcp/Pages/Error.cshtml] 40 | build_metadata.AdditionalFiles.TargetPath = UGFnZXNcRXJyb3IuY3NodG1s 41 | build_metadata.AdditionalFiles.CssScope = 42 | 43 | [C:/temp/bcp/Pages/_Host.cshtml] 44 | build_metadata.AdditionalFiles.TargetPath = UGFnZXNcX0hvc3QuY3NodG1s 45 | build_metadata.AdditionalFiles.CssScope = 46 | -------------------------------------------------------------------------------- /obj/Debug/net7.0/OpenAITest1.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.TargetFramework = net7.0 3 | build_property.TargetPlatformMinVersion = 4 | build_property.UsingMicrosoftNETSdkWeb = true 5 | build_property.ProjectTypeGuids = 6 | build_property.InvariantGlobalization = 7 | build_property.PlatformNeutralAssembly = 8 | build_property.EnforceExtendedAnalyzerRules = 9 | build_property._SupportedPlatformList = Linux,macOS,Windows 10 | build_property.RootNamespace = OpenAITest1 11 | build_property.RootNamespace = OpenAITest1 12 | build_property.ProjectDir = C:\Users\home\OneDrive\code\OpenAITest1\ 13 | build_property.RazorLangVersion = 7.0 14 | build_property.SupportLocalizedComponentNames = 15 | build_property.GenerateRazorMetadataSourceChecksumAttributes = 16 | build_property.MSBuildProjectDirectory = C:\Users\home\OneDrive\code\OpenAITest1 17 | build_property._RazorSourceGeneratorDebug = 18 | 19 | [C:/Users/home/OneDrive/code/OpenAITest1/App.razor] 20 | build_metadata.AdditionalFiles.TargetPath = QXBwLnJhem9y 21 | build_metadata.AdditionalFiles.CssScope = 22 | 23 | [C:/Users/home/OneDrive/code/OpenAITest1/Components/Chat.razor] 24 | build_metadata.AdditionalFiles.TargetPath = Q29tcG9uZW50c1xDaGF0LnJhem9y 25 | build_metadata.AdditionalFiles.CssScope = 26 | 27 | [C:/Users/home/OneDrive/code/OpenAITest1/Pages/Index.razor] 28 | build_metadata.AdditionalFiles.TargetPath = UGFnZXNcSW5kZXgucmF6b3I= 29 | build_metadata.AdditionalFiles.CssScope = 30 | 31 | [C:/Users/home/OneDrive/code/OpenAITest1/_Imports.razor] 32 | build_metadata.AdditionalFiles.TargetPath = X0ltcG9ydHMucmF6b3I= 33 | build_metadata.AdditionalFiles.CssScope = 34 | 35 | [C:/Users/home/OneDrive/code/OpenAITest1/Shared/MainLayout.razor] 36 | build_metadata.AdditionalFiles.TargetPath = U2hhcmVkXE1haW5MYXlvdXQucmF6b3I= 37 | build_metadata.AdditionalFiles.CssScope = b-n76ccmorkq 38 | 39 | [C:/Users/home/OneDrive/code/OpenAITest1/Pages/Error.cshtml] 40 | build_metadata.AdditionalFiles.TargetPath = UGFnZXNcRXJyb3IuY3NodG1s 41 | build_metadata.AdditionalFiles.CssScope = 42 | 43 | [C:/Users/home/OneDrive/code/OpenAITest1/Pages/_Host.cshtml] 44 | build_metadata.AdditionalFiles.TargetPath = UGFnZXNcX0hvc3QuY3NodG1s 45 | build_metadata.AdditionalFiles.CssScope = 46 | -------------------------------------------------------------------------------- /Services/ChatService.cs: -------------------------------------------------------------------------------- 1 | using Azure; 2 | 3 | using Azure.AI.OpenAI; 4 | using BlazorCopilot1.Data; 5 | 6 | namespace BlazorCopilot1.Services 7 | { 8 | public class ChatService 9 | { 10 | private readonly IConfiguration _configuration; 11 | 12 | private string SystemMessage = "You are an AI assistant that helps people find information about food. For anything other than food, respond with 'I can only answer questions about food.'"; 13 | 14 | public ChatService(IConfiguration configuration) 15 | { 16 | _configuration = configuration; 17 | } 18 | public async Task GetResponse(List messagechain) 19 | { 20 | string response = ""; 21 | 22 | OpenAIClient client = new OpenAIClient( 23 | new Uri(_configuration.GetSection("Azure")["OpenAIUrl"]!), 24 | new AzureKeyCredential(_configuration.GetSection("Azure")["OpenAIKey"]!)); 25 | 26 | 27 | ChatCompletionsOptions options = new ChatCompletionsOptions(); 28 | options.Temperature = (float)0.7; 29 | options.MaxTokens = 800; 30 | options.NucleusSamplingFactor = (float)0.95; 31 | options.FrequencyPenalty = 0; 32 | options.PresencePenalty = 0; 33 | options.Messages.Add(new ChatMessage(ChatRole.System,SystemMessage)); 34 | foreach (var msg in messagechain) 35 | { 36 | if (msg.IsRequest) 37 | { 38 | options.Messages.Add(new ChatMessage(ChatRole.User, msg.Body)); 39 | } 40 | else 41 | { 42 | options.Messages.Add(new ChatMessage(ChatRole.Assistant, msg.Body)); 43 | } 44 | } 45 | 46 | Response resp = await client.GetChatCompletionsAsync( 47 | _configuration.GetSection("Azure")["OpenAIDeploymentModel"]!, 48 | options); 49 | 50 | ChatCompletions completions = resp.Value; 51 | 52 | response = completions.Choices[0].Message.Content; 53 | 54 | Message responseMessage = new Message(response,false); 55 | return responseMessage; 56 | } 57 | 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Components/Chat.razor: -------------------------------------------------------------------------------- 1 | @using BlazorCopilot1.Services 2 | @using BlazorCopilot1.Data 3 | 4 | @inject IJSRuntime JSRuntime 5 | @inject ChatService ChatService 6 | 7 |
8 | @foreach (var item in _messages) 9 | { 10 | if (item.IsRequest) 11 | { 12 |
13 |

@item.Body

14 |
15 | } 16 | else 17 | { 18 |
19 |

@item.Body

20 |
21 | } 22 | } 23 |
24 |
25 | 26 | 27 | 28 | 29 |