﻿
{"id":27771,"date":"2025-04-27T13:51:12","date_gmt":"2025-04-27T13:51:12","guid":{"rendered":"https:\/\/www.gencayyildiz.com\/blog\/?p=27771"},"modified":"2025-04-27T13:51:12","modified_gmt":"2025-04-27T13:51:12","slug":"microsoft-net-ai-template-nette-hizlica-ai-chatbot-olusturma","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/microsoft-net-ai-template-nette-hizlica-ai-chatbot-olusturma\/","title":{"rendered":"Microsoft .NET AI Template\u200a- .NET&#8217;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<p>Merhaba,<\/p>\n<p>Yak\u0131n zamanda Semantic Kernel ve SignalR ile birlikte ger\u00e7ek zamanl\u0131 bir AI chatbot uygulamas\u0131n\u0131 manuel bir \u015fekilde geli\u015ftirmi\u015f <span style=\"font-size:12px;\">(bknz: <a href=\"https:\/\/www.gencayyildiz.com\/blog\/semantic-kernel-signalr-ile-birlikte-canli-ai-yanitlarini-gosteren-kendi-chat-uygulamamizi-yazalim\/\" target=\"_blank\">Semantic Kernel &#038; SignalR \u0130le Birlikte Canl\u0131 AI Yan\u0131tlar\u0131n\u0131 G\u00f6steren Kendi Chat Uygulamam\u0131z\u0131 Yazal\u0131m<\/a>)<\/span> ve hatta YouTube kanal\u0131m\u0131zda <span style=\"font-size:12px;\">(bknz: <a href=\"https:\/\/www.youtube.com\/watch?v=VtxFCGPoPAE&#038;t=1s\" target=\"_blank\">inceleme videosu<\/a>)<\/span> inceleme videosunu yay\u0131nlam\u0131\u015ft\u0131k. \u0130lgili i\u00e7eriklerden de anla\u015f\u0131laca\u011f\u0131 \u00fczere kullan\u0131c\u0131lar\u0131n AI modelleriyle olan ileti\u015fim s\u00fcre\u00e7lerinde bir chatbot uygulamas\u0131 olu\u015fturmak orta \u015feker zahmetli ve biraz zaman al\u0131c\u0131 cinsten bir s\u00fcrece sahiptir. Ayr\u0131ca, hangi yaz\u0131l\u0131mda olursak olal\u0131m bu ihtiyac\u0131 kar\u015f\u0131lamak i\u00e7in s\u00fcrekli ayn\u0131 i\u015flemleri yaparak birbirlerini tekrar eden \u00e7\u00f6z\u00fcmlerle \u00fcretimde bulunmam\u0131z gerekmektedir. \u0130\u015fte bu durumun fark\u0131nda olan .NET mimarisinin geli\u015ftiricileri; bu ihtiyac\u0131, bu ihtiyac\u0131n orta \u015fekerde olsa zahmetini ve hangi durumda olursak olal\u0131m esas\u0131nda s\u00fcrekli ayn\u0131 i\u015flemlerin tekrar etmesini g\u00f6rm\u00fc\u015f ve bizlere AI destekli chatbot uygulamalar\u0131n\u0131 geli\u015ftirmemizi kolayla\u015ft\u0131rmak i\u00e7in tasarlad\u0131klar\u0131 haz\u0131r bir AI Template sunmu\u015f bulunmaktad\u0131rlar. Bizler bu i\u00e7eri\u011fimizde yeni gelen AI Template&#8217;i teknik inceleyecek ve gelecekte ne gibi bir noktaya evrilebilece\u011fine dair vizyon \u00e7izip, yorumda bulunaca\u011f\u0131z. O halde fazla vakit kaybetmeksizin buyurun ba\u015flayal\u0131m&#8230;<\/p>\n<h4>AI Template&#8217;i Nedir? Neyi Kolayla\u015ft\u0131rmaktad\u0131r?<\/h4>\n<p>Yapay zekan\u0131n hayat\u0131m\u0131za giri\u015fiyle birlikte art\u0131k g\u00fcn\u00fcm\u00fcz yaz\u0131l\u0131mlar\u0131nda olmazsa olmaz diyebilece\u011fimiz AI destekli chatbot&#8217;lar, sanal asistanlar veya yapay zeka destekli aramalar gibi \u00f6zellikler uygulamalar a\u00e7\u0131s\u0131ndan aranan nitelikler olarak olduk\u00e7a \u00f6nem kazanm\u0131\u015f bulunmakta ve daha da \u00f6nemlisi bu yeteneklerin uygulamalara entegre edilmesi her zamankinden daha fazla kritik arz etmektedir diyebiliriz. \u0130\u015fte bu duruma istinaden .NET ile AI destekli yap\u0131lar\u0131n geli\u015ftirme s\u00fcrecini daha da rahatlatabilmek ve s\u00fcre\u00e7te geli\u015ftirici a\u00e7\u0131s\u0131ndan ke\u015ffedilmesi gereken ad\u0131mlar\u0131 daha rahat inceleme \u015fans\u0131 tan\u0131yabilmek i\u00e7in Microsoft taraf\u0131ndan AI template&#8217;i biz geli\u015ftiricilere sunulmu\u015ftur.<\/p>\n<p>Bu template, AI destekli sohbet uygulamalar\u0131 geli\u015ftirmeyi kolayla\u015ft\u0131rmak i\u00e7in tasarlanm\u0131\u015ft\u0131r ve bu ilk s\u00fcr\u00fcm\u00fc, <code>Microsoft.Extensions.AI<\/code> ve <code>Microsoft.Extensions.VectorData<\/code> abstraction&#8217;lar\u0131 kullan\u0131larak olu\u015fturulan Blazor tabanl\u0131 bir web uygulamas\u0131na odakl\u0131d\u0131r. Ayr\u0131ca bu template, sohbet uygulamalar\u0131 i\u00e7in yayg\u0131n olarak kullan\u0131lan <em>Retrieval Augmented Generation (RAG)<\/em> pattern&#8217;\u0131n\u0131 kullanmaktad\u0131r. B\u00f6ylece bu template, PDF&#8217;lerle veya farkl\u0131 verilerinizle etkile\u015fime girebilen sohbet tabanl\u0131 bir kullan\u0131c\u0131 aray\u00fcz\u00fc olu\u015fturman\u0131za olanak tan\u0131makla birlikte, prototipleme i\u00e7in de herhangi bir local vector store&#8217;unu veya daha geli\u015fmi\u015f yap\u0131land\u0131rmalar i\u00e7in ise <em>Azure AI Search<\/em>&#8216;\u00fc desteklemektedir. Ayr\u0131ca template&#8217;in odakland\u0131\u011f\u0131 i\u015flevsellik gere\u011fi k\u0131lavuz olarak sundu\u011fu kod gereksinimleriniz do\u011frultusunda \u00f6zelle\u015ftirilebilir olan belli ba\u015fl\u0131 component&#8217;leri i\u00e7ermektedir.<\/p>\n<p>Yani uzun laf\u0131n k\u0131sas\u0131 .NET AI template, AI destekli sohbet uygulamalar\u0131n\u0131 h\u0131zl\u0131 ve kolay bir \u015fekilde geli\u015ftirmek i\u00e7in kapsaml\u0131 bir ba\u015flang\u0131\u00e7 noktas\u0131 sa\u011flamaktad\u0131r.<\/p>\n<blockquote><p><em>\u0130nceledi\u011fimiz bu template&#8217;in \u015fu anda preview a\u015famas\u0131nda oldu\u011funa ve gelecekteki s\u00fcr\u00fcmlerin kullan\u0131c\u0131lar\u0131n geri bildirimlerine ve yapay zeka alan\u0131ndaki h\u0131zl\u0131 geli\u015fmelere ba\u011fl\u0131 olarak de\u011fi\u015febilece\u011fine dikkatinizi \u00e7ekerim.<\/em><\/p><\/blockquote>\n<h4>Hangi T\u00fcr Veri Kaynaklar\u0131 \u0130le Entegre Edilebilmektedir?<\/h4>\n<p>AI template&#8217;i \u00f6zellikle metin tabanl\u0131 ve dok\u00fcman kaynakl\u0131 verilerle \u00e7al\u0131\u015fmak \u00fczere tasarlanm\u0131\u015f olsa da, esas\u0131nda entegre edilebilece\u011fi veri yap\u0131lar\u0131 olduk\u00e7a \u00e7e\u015fitlilik g\u00f6stermektedir. \u015e\u00f6yle ki;<\/p>\n<ul>\n<li>PDF ve dok\u00fcman tabanl\u0131 verilerin i\u015flemesi i\u00e7in haz\u0131r yap\u0131 sa\u011flamaktad\u0131r.<\/li>\n<li>Verilerin vekt\u00f6r temsillerini olu\u015fturarak yerel veri tabanlar\u0131nda saklanmas\u0131n\u0131 ve sorgulanmas\u0131n\u0131 desteklenmektedir.<\/li>\n<li>Azure AI Search gibi cloud tabanl\u0131 arama ve veri i\u015fleme servisleriyle entegrasyon altyap\u0131s\u0131 sunmaktad\u0131r.<\/li>\n<li><em>Retrieval Augmented Generation (RAG)<\/em> pattern&#8217;\u0131 kullan\u0131ld\u0131\u011f\u0131 i\u00e7in metin tabanl\u0131 ve yap\u0131land\u0131r\u0131lm\u0131\u015f farkl\u0131 veri kaynaklar\u0131ndan gelen i\u00e7eriklerle zenginle\u015ftirilmi\u015f sohbet imkan\u0131 sa\u011flamaktad\u0131r.<\/li>\n<\/ul>\n<p>Bunlar\u0131n d\u0131\u015f\u0131nda bu template, farkl\u0131 veri formatlar\u0131n\u0131 ve kaynaklar\u0131n\u0131 desteklemek \u00fczere esnek \u015fekilde geli\u015ftirilebilecek bir yap\u0131ya sahiptir.<\/p>\n<h4>Hangi AI Model Provider&#8217;lar\u0131 \u0130le Uyumludur?<\/h4>\n<p>AI template ile geli\u015ftirilen chatbotlar, \u00f6zellikle OpenAI servisleri ba\u015fta olmak \u00fczere GitHub, Ollama sa\u011flay\u0131c\u0131lar\u0131yla ve hatta Azure OpenAI ve Azure AI Search gibi \u00e7e\u015fitli cloud tabanl\u0131 AI model provider&#8217;lar\u0131yla uyumluluk sergilemekte ve bunlar\u0131n d\u0131\u015f\u0131nda API tabanl\u0131 entegrasyonlara da imkan tan\u0131maktad\u0131r.<\/p>\n<h4>Nas\u0131l Kurulur ve Yap\u0131land\u0131r\u0131l\u0131r?<\/h4>\n<p>AI template&#8217;i kurabilmek ve yap\u0131land\u0131rabilmek i\u00e7in ilk olarak <code>Microsoft.Extensions.AI.Templates<\/code>&#8216;in a\u015fa\u011f\u0131daki talimat e\u015fli\u011finde bulunulan bilgisayara y\u00fcklenmesi gerekmektedir;<\/p>\n<div style=\"font-size:12px;text-align:center;\">\ndotnet new install Microsoft.Extensions.AI.Templates\n<\/div>\n<p>Kurulumu ger\u00e7ekle\u015ftirdikten sonra a\u015fa\u011f\u0131daki g\u00f6rselde oldu\u011fu gibi <em>AI Chat Web App<\/em> proje template&#8217;i \u00fczerinden uygulama temelleri at\u0131labilmektedir.<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma.png\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"887\" height=\"200\" class=\"aligncenter size-full wp-image-27779\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma.png 887w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-300x68.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-768x173.png 768w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><\/a>Devam\u0131nda ise minimum kurulumla ba\u015flaman\u0131n en kolay yolu olarak GitHub provider&#8217;\u0131 e\u015fli\u011finde gitmekte fayda vard\u0131r.<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-1.png\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"569\" height=\"300\" class=\"aligncenter size-full wp-image-27780\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-1.png 569w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-1-300x158.png 300w\" sizes=\"auto, (max-width: 569px) 100vw, 569px\" \/><\/a>Tabi GitHub&#8217;\u0131 kullanabilmek i\u00e7in a\u015fa\u011f\u0131daki g\u00f6rselde oldu\u011fu gibi bir access token edinilmesi gerekmektedir.<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma.gif\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"800\" height=\"475\" class=\"aligncenter size-full wp-image-27781\" \/><\/a>Bunun i\u00e7in; &#8216;Settings&#8217; -> &#8216;Developer settings&#8217; -> &#8216;Fine-grained tokens&#8217; -> &#8216;Generate new token&#8217; kombinasyonunun takip edilmesi yeterli olacakt\u0131r.<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-2.png\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"779\" height=\"277\" class=\"aligncenter size-full wp-image-27782\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-2.png 779w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-2-300x107.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-2-768x273.png 768w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/a>Buradan elde edilen token daha hi\u00e7bir incelemede bulunmaks\u0131z\u0131n hemen <em>appsettings.json<\/em> dosyas\u0131na a\u015fa\u011f\u0131daki gibi eklenmelidir;<\/p>\n<div style=\"font-size:12px;\">\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n{\r\n  .\r\n  .\r\n  .\r\n  &quot;GitHubModels&quot;: {\r\n    &quot;Token&quot;: &quot;github_pat_11AYQY6XA0zmA7Yg******ENUUBWpxHYSj&quot;\r\n  }\r\n}\r\n<\/pre>\n<\/div>\n<p>\u0130\u015fte, yap\u0131land\u0131rma bundan ibarettir&#8230; Art\u0131k altyap\u0131 haz\u0131r oldu\u011funa g\u00f6re template&#8217;in bizlere sundu\u011fu haz\u0131r yap\u0131y\u0131 incelemeye ge\u00e7ebiliriz.<\/p>\n<h4>Haz\u0131r Yap\u0131y\u0131 \u0130nceleyelim&#8230;<\/h4>\n<p>AI template ile bir uygulama olu\u015fturuldu\u011fu anda kullan\u0131ma haz\u0131r bir altyap\u0131 sunulmaktad\u0131r. \u0130lk etapta tek dokunulmas\u0131 gereken nokta yukar\u0131daki sat\u0131rlarda bahsi ge\u00e7ti\u011fi gibi access token&#8217;\u0131 kullanacak \u015fekilde yap\u0131land\u0131r\u0131lma gereklili\u011fidir. Bunun d\u0131\u015f\u0131nda her \u015fey haz\u0131r bir vaziyettedir&#8230;<\/p>\n<p>\u015eimdi bizlere sunulan bu haz\u0131r yap\u0131lanmay\u0131 y\u00fczeysel kritize ederek, hangi teknolojilerle nas\u0131l bir yakla\u015f\u0131m kullan\u0131lm\u0131\u015f anlamaya \u00e7al\u0131\u015fal\u0131m. Bunun i\u00e7in <em>&#8216;Program.cs&#8217;<\/em> dosyas\u0131na bakmakta fayda var;<\/p>\n<p>Bu dosyada, genel anlamda AI destekli bir dok\u00fcman arama (semantik arama) yap\u0131land\u0131rmas\u0131 ger\u00e7ekle\u015ftirilmektedir.<\/p>\n<div style=\"font-size:12px;\">\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nusing Example_AI_Chat_Project.Components;\r\nusing Example_AI_Chat_Project.Services;\r\nusing Example_AI_Chat_Project.Services.Ingestion;\r\nusing Microsoft.EntityFrameworkCore;\r\nusing Microsoft.Extensions.AI;\r\nusing Microsoft.Extensions.VectorData;\r\nusing OpenAI;\r\nusing System.ClientModel;\r\n\r\nvar builder = WebApplication.CreateBuilder(args);\r\nbuilder.Services.AddRazorComponents().AddInteractiveServerComponents();\r\n\r\n\/\/ You will need to set the endpoint and key to your own values\r\n\/\/ You can do this using Visual Studio's &quot;Manage User Secrets&quot; UI, or on the command line:\r\n\/\/   cd this-project-directory\r\n\/\/   dotnet user-secrets set GitHubModels:Token YOUR-GITHUB-TOKEN\r\nvar credential = new ApiKeyCredential(builder.Configuration&#x5B;&quot;GitHubModels:Token&quot;] ?? throw new InvalidOperationException(&quot;Missing configuration: GitHubModels:Token. See the README for details.&quot;));\r\nvar openAIOptions = new OpenAIClientOptions()\r\n{\r\n    Endpoint = new Uri(&quot;https:\/\/models.inference.ai.azure.com&quot;)\r\n};\r\n\r\nvar ghModelsClient = new OpenAIClient(credential, openAIOptions);\r\nvar chatClient = ghModelsClient.GetChatClient(&quot;gpt-4o-mini&quot;).AsIChatClient();\r\nvar embeddingGenerator = ghModelsClient.GetEmbeddingClient(&quot;text-embedding-3-small&quot;).AsIEmbeddingGenerator();\r\n\r\nvar vectorStore = new JsonVectorStore(Path.Combine(AppContext.BaseDirectory, &quot;vector-store&quot;));\r\n\r\nbuilder.Services.AddSingleton&lt;IVectorStore&gt;(vectorStore);\r\nbuilder.Services.AddScoped&lt;DataIngestor&gt;();\r\nbuilder.Services.AddSingleton&lt;SemanticSearch&gt;();\r\nbuilder.Services.AddChatClient(chatClient).UseFunctionInvocation().UseLogging();\r\nbuilder.Services.AddEmbeddingGenerator(embeddingGenerator);\r\n\r\nbuilder.Services.AddDbContext&lt;IngestionCacheDbContext&gt;(options =&gt;\r\n    options.UseSqlite(&quot;Data Source=ingestioncache.db&quot;));\r\n\r\nvar app = builder.Build();\r\nIngestionCacheDbContext.Initialize(app.Services);\r\n\r\n\/\/ Configure the HTTP request pipeline.\r\nif (!app.Environment.IsDevelopment())\r\n{\r\n    app.UseExceptionHandler(&quot;\/Error&quot;, createScopeForErrors: true);\r\n    \/\/ The default HSTS value is 30 days. You may want to change this for production scenarios, see https:\/\/aka.ms\/aspnetcore-hsts.\r\n    app.UseHsts();\r\n}\r\n\r\napp.UseHttpsRedirection();\r\napp.UseAntiforgery();\r\n\r\napp.UseStaticFiles();\r\napp.MapRazorComponents&lt;App&gt;()\r\n    .AddInteractiveServerRenderMode();\r\n\r\n\/\/ By default, we ingest PDF files from the \/wwwroot\/Data directory. You can ingest from\r\n\/\/ other sources by implementing IIngestionSource.\r\n\/\/ Important: ensure that any content you ingest is trusted, as it may be reflected back\r\n\/\/ to users or could be a source of prompt injection risk.\r\nawait DataIngestor.IngestDataAsync(\r\n    app.Services,\r\n    new PDFDirectorySource(Path.Combine(builder.Environment.WebRootPath, &quot;Data&quot;)));\r\n\r\napp.Run();\r\n<\/pre>\n<\/div>\n<p>\u00d6nemli sat\u0131rlar\u0131 izah etmemiz gerekirse e\u011fer;<\/p>\n<ul>\n<li><em style=\"color:red;\">17. sat\u0131rda<\/em>; ba\u011flant\u0131 kurulacak GitHub ile ilgili gerekli credential \u00e7al\u0131\u015fmalar\u0131 yap\u0131lmaktad\u0131r.<\/li>\n<li><em style=\"color:red;\">18 &#8211; 23. sat\u0131r aral\u0131\u011f\u0131nda<\/em>; Azure \u00fczerinde \u00e7al\u0131\u015fan OpenAI client yap\u0131land\u0131rmas\u0131 sa\u011flanmaktad\u0131r.<\/li>\n<li><em style=\"color:red;\">24 &#8211; 25. sat\u0131r aral\u0131\u011f\u0131nda<\/em>; sohbet i\u00e7in <code>gpt-4o-mini<\/code>, text embeddings i\u00e7in ise <code>text-embedding-3-small<\/code> modelleri varsay\u0131lan olarak ayarlanmaktad\u0131r.<\/li>\n<li><em style=\"color:red;\">27. sat\u0131rda<\/em>; vector verilerini depolamak i\u00e7in JSON tabanl\u0131 bir store olu\u015fturulmaktad\u0131r.<\/li>\n<\/ul>\n<p>Bunlar\u0131n d\u0131\u015f\u0131nda gerisi Blazor mimarisine uygun kodlama \u00e7al\u0131\u015fmalar\u0131d\u0131r.<\/p>\n<p>Art\u0131k uygulamay\u0131 derleyip \u00e7al\u0131\u015ft\u0131rabilir ve bizlere nas\u0131l bir yap\u0131n\u0131n sunuldu\u011funa bakabiliriz&#8230;<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-3.png\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"1040\" height=\"924\" class=\"aligncenter size-full wp-image-27787\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-3.png 1040w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-3-300x267.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-3-1024x910.png 1024w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-3-768x682.png 768w\" sizes=\"auto, (max-width: 1040px) 100vw, 1040px\" \/><\/a>G\u00f6r\u00fcld\u00fc\u011f\u00fc \u00fczere, i\u00e7erisine \u00f6rnek ama\u00e7l\u0131 eklenmi\u015f olan pdf dosyalar\u0131 \u00fczerinden sorular sorulabilen ve rahatl\u0131kla sohbet edilebilen amat\u00f6r bir tasar\u0131ma sahip bir uygulama kar\u015f\u0131lamaktad\u0131r bizleri. \u0130ster lalettayin sohbete ba\u015flayabilir, isterseniz de \u00f6rnek ama\u00e7l\u0131 gelen pdf&#8217;lere dair sualler sorabilirsiniz.<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-4.png\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"311\" height=\"207\" class=\"alignleft size-full wp-image-27789\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-4.png 311w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-4-300x200.png 300w\" sizes=\"auto, (max-width: 311px) 100vw, 311px\" \/><\/a><\/p>\n<p>Buradaki test s\u00fcrecini daha da \u00f6zelle\u015ftirebilir ve yandaki gibi kendinize \u00f6zel pdf&#8217;leri de s\u00fcrece dahil edip a\u015fa\u011f\u0131daki gibi dosyaya \u00f6zel sorularla tam teste de tabi tutabilirsiniz. Tabi bunun i\u00e7in \u00f6ncelikle bu dosyaya uygulama \u00fczerinden eri\u015fim sa\u011flanmas\u0131 gerekmektedir. Ee bunun i\u00e7in de <em>&#8216;Chat.razor&#8217;<\/em> dosyas\u0131nda a\u015fa\u011f\u0131daki g\u00fcncellemenin yap\u0131lmas\u0131 gerekmektedir.<\/p>\n<div style=\"font-size:12px;\">\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n.\r\n.\r\n.\r\n&lt;ChatMessageList Messages=&quot;@messages&quot; InProgressMessage=&quot;@currentResponseMessage&quot;&gt;\r\n    &lt;NoMessagesContent&gt;\r\n        &lt;div&gt;To get started, try asking about these example documents. You can replace these with your own data and replace this message.&lt;\/div&gt;\r\n        &lt;ChatCitation File=&quot;Example_Emergency_Survival_Kit.pdf&quot; \/&gt;\r\n        &lt;ChatCitation File=&quot;Example_GPS_Watch.pdf&quot; \/&gt;\r\n        &lt;ChatCitation File=&quot;Product_Templates.pdf&quot; \/&gt;\r\n    &lt;\/NoMessagesContent&gt;\r\n&lt;\/ChatMessageList&gt;\r\n.\r\n.\r\n.\r\n<\/pre>\n<\/div>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-1.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-1.gif\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"800\" height=\"695\" class=\"aligncenter size-full wp-image-27790\" \/><\/a>Ayr\u0131ca burada \u00f6nemli olan bir husustan daha bahsetmek istiyorum. Sistemi yap\u0131land\u0131ran prompt&#8217;un varl\u0131\u011f\u0131ndan ve bununla ilgili de\u011fi\u015fiklik s\u00fcrecinden.<\/p>\n<h4>System Prompt&#8217;unun De\u011fi\u015ftirilmesi<\/h4>\n<p>Template&#8217;in bizlere sunmu\u015f oldu\u011fu yap\u0131da AI modelinin davran\u0131\u015f\u0131n\u0131 \u015fekillendirmek ve s\u0131n\u0131rlar\u0131n\u0131 belirlemek \u00fczere bir talimat seti mevcuttur. Bu talimatlar <em>&#8216;Chat.razor&#8217;<\/em> dosyas\u0131 i\u00e7erisinde tan\u0131mlanm\u0131\u015f olan <code>SystemPrompt<\/code> property&#8217;sinde a\u015fa\u011f\u0131daki \u015fekilde bulunmaktad\u0131r.<a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-5.png\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"1355\" height=\"585\" class=\"aligncenter size-full wp-image-27791\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-5.png 1355w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-5-300x130.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-5-1024x442.png 1024w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-5-768x332.png 768w\" sizes=\"auto, (max-width: 1355px) 100vw, 1355px\" \/><\/a>Burada varsay\u0131lan olarak gelen talimat setine bakarsak e\u011fer;<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"width:50%;\">\u0130ngilizce<\/th>\n<th>T\u00fcrk\u00e7e<\/th>\n<tr>\n<\/thead>\n<tbody>\n<tr style=\"font-size:9px;line-height: 1.6;\">\n<td style=\"text-align:left;\">\nYou are an assistant who answers questions about information you retrieve.<br \/>\nDo not answer questions about anything else.<br \/>\nUse only simple markdown to format your responses.<\/p>\n<p>Use the search tool to find relevant information. When you do this, end your<br \/>\nreply with citations in the special XML format:<\/p>\n<p>&lt;citation filename=&#8217;string&#8217; page_number=&#8217;number&#8217;&gt;exact quote here&lt;\/citation&gt;<\/p>\n<p>Always include the citation in your response if there are results.<\/p>\n<p>The quote must be max 5 words, taken word-for-word from the search result, and is the basis for why the citation is relevant.<br \/>\nDon&#8217;t refer to the presence of citations; just emit these tags right at the end, with no surrounding text.<\/p>\n<\/td>\n<td style=\"text-align:left;\">\nSiz, ald\u0131\u011f\u0131n\u0131z bilgilerle ilgili sorular\u0131 yan\u0131tlayan bir asistans\u0131n\u0131z.<br \/>\nBa\u015fka hi\u00e7bir \u015fey hakk\u0131ndaki sorular\u0131 yan\u0131tlamay\u0131n.<br \/>\nYan\u0131tlar\u0131n\u0131z\u0131 bi\u00e7imlendirmek i\u00e7in yaln\u0131zca basit markdown kullan\u0131n.<\/p>\n<p>\u0130lgili bilgileri bulmak i\u00e7in arama arac\u0131n\u0131 kullan\u0131n. Bunu yapt\u0131\u011f\u0131n\u0131zda, yan\u0131t\u0131n\u0131z\u0131 \u00f6zel XML bi\u00e7iminde al\u0131nt\u0131larla sonland\u0131r\u0131n:<\/p>\n<p>&lt;citation filename=&#8217;string&#8217; page_number=&#8217;number&#8217;&gt;al\u0131nt\u0131 buraya&lt;\/citation&gt;<\/p>\n<p>Sonu\u00e7lar varsa, al\u0131nt\u0131y\u0131 her zaman yan\u0131t\u0131n\u0131za ekleyin.<\/p>\n<p>Al\u0131nt\u0131 en fazla 5 kelime olmal\u0131, arama sonucundan kelimesi kelimesine al\u0131nmal\u0131 ve al\u0131nt\u0131n\u0131n neden alakal\u0131 oldu\u011funun temelini olu\u015fturmal\u0131d\u0131r. Al\u0131nt\u0131lar\u0131n varl\u0131\u011f\u0131na at\u0131fta bulunmay\u0131n; bu etiketleri sadece en sonunda, \u00e7evreleyen metin olmadan yay\u0131nlay\u0131n.\n<\/td>\n<tr>\n<\/tbody>\n<\/table>\n<p>\u015feklinde belirlendi\u011fini g\u00f6r\u00fcyoruz. Bunu istedi\u011finiz gibi \u015fekillendirebilir ve s\u0131n\u0131rlar\u0131 belirleyebilirsiniz. Misal olarak ben a\u015fa\u011f\u0131daki gibi bir sistem prompt&#8217;u e\u015fli\u011finde bir test ger\u00e7ekle\u015ftirmek istedim \ud83d\ude42<\/p>\n<div style=\"font-size:12px;\">\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n@code {\r\n    private const string SystemPrompt = @&quot;\r\n        Sen \u015fakac\u0131 bir asistans\u0131n.\r\n        Gelen sorulara do\u011fru cevap vereceksin ama her c\u00fcmleye sa\u00e7ma da olsa bir \u015fakayla ba\u015flayacaks\u0131n.\r\n        &quot;;\r\n.\r\n.\r\n.\r\n<\/pre>\n<\/div>\n<p><a href=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-6.png\" alt=\"Microsoft .NET AI Template\u200a- .NET&#039;te H\u0131zl\u0131ca AI Chatbot Olu\u015fturma\" width=\"1034\" height=\"681\" class=\"aligncenter size-full wp-image-27793\" srcset=\"https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-6.png 1034w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-6-300x198.png 300w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-6-1024x674.png 1024w, https:\/\/www.gencayyildiz.com\/blog\/wp-content\/uploads\/2025\/04\/Microsoft-.NET-AI-Template\u200a-.NETte-Hizlica-AI-Chatbot-Olusturma-6-768x506.png 768w\" sizes=\"auto, (max-width: 1034px) 100vw, 1034px\" \/><\/a>Aman Allah&#8217;\u0131m&#8230; \ud83e\udee2\ud83e\udee2\u0130\u011fren\u00e7 \u015fakalar yap\u0131yor \ud83e\udd23Tabi bu sistem prompt&#8217;unu i\u015f mant\u0131\u011f\u0131 ve gereksinimi do\u011frultusunda AI modelini \u015fekillendirmek maksad\u0131yla daha mevzuat temelli olu\u015fturmakta fayda vard\u0131r. Ne de olsa, \u00f6rnekteki sistem prompt&#8217;una kar\u015f\u0131 g\u00f6rseldeki gibi sa\u00e7mal\u0131yor olmas\u0131, do\u011fru ve a\u00e7\u0131k bir \u015fekilde verilen mevzuata da hakk\u0131yla uyaca\u011f\u0131n\u0131n a\u00e7\u0131k teminat\u0131d\u0131r diyebiliriz \ud83d\ude42<\/p>\n<p>Nihai olarak;<br \/>\nG\u00f6r\u00fcyorsunuz ki AI template&#8217;i, .NET ve Blazor altyap\u0131s\u0131nda AI destekli bir sohbet uygulamas\u0131n\u0131 kolayl\u0131kla olu\u015fturmak i\u00e7in bizlere bir yol sunmaktad\u0131r. Art\u0131k bu geli\u015fmeden sonra aray\u00fcze dokunu\u015flarda bulunarak kendinize g\u00f6re \u015fekillendirebilir ve ek belge t\u00fcrleri ekleyerek uygulaman\u0131n i\u015flevselli\u011fini daha da geni\u015fletebilir ve hatta koda m\u00fcdahale ederek de istedi\u011finiz gibi \u00f6zelle\u015ftirmelerde bulunabilirsiniz.<\/p>\n<p>\u0130lgilenenlerin faydalanmas\u0131 dile\u011fiyle&#8230;<br \/>\nSonraki yaz\u0131lar\u0131mda g\u00f6r\u00fc\u015fmek \u00fczere&#8230;<br \/>\n\u0130yi \u00e7al\u0131\u015fmalar&#8230;<\/p>\n<p>Not : \u00d6rnek \u00e7al\u0131\u015fmaya a\u015fa\u011f\u0131daki GitHub adresinden eri\u015febilirsiniz.<br \/>\n<a href=\"https:\/\/github.com\/gncyyldz\/Example_AI_Chat_Project\" target=\"_blank\">https:\/\/github.com\/gncyyldz\/Example_AI_Chat_Project<\/a><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Merhaba, Yak\u0131n zamanda Semantic Kernel ve SignalR ile birlikte ger\u00e7ek zamanl\u0131 bir AI chatbot uygulamas\u0131n\u0131 manuel bir \u015fekilde geli\u015ftirmi\u015f (bknz: Semantic Kernel &#038; SignalR \u0130le Birlikte Canl\u0131 AI Yan\u0131tlar\u0131n\u0131 G\u00f6steren Kendi Chat Uygulamam\u0131z\u0131 Yazal\u0131m)&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":27793,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5206,5222,5220],"tags":[5299,5298,5302,5301,5303,5300,5305,5304],"class_list":["post-27771","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","category-llm","category-yapay-zeka-ai","tag-net-ai-template","tag-ai-template","tag-ai-template-chatbot","tag-hizli-ai-chatbot","tag-hizli-chatbot","tag-microsoft-ai-template","tag-rag","tag-retrieval-augmented-generation"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/27771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=27771"}],"version-history":[{"count":12,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/27771\/revisions"}],"predecessor-version":[{"id":27797,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/27771\/revisions\/27797"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media\/27793"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=27771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=27771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=27771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}