├── .gitignore ├── LICENSE ├── README.md ├── SKSampleCSharp ├── 01HelloWorld │ ├── Config.cs │ ├── HelloWorld.csproj │ └── Program.cs ├── AutoGenKernelPlugin │ ├── AutoGenKernelPlugin.csproj │ ├── Config.cs │ ├── Plugins │ │ └── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ └── Program.cs ├── AutoGenSK │ ├── AutoGenSK.csproj │ ├── Config.cs │ └── Program.cs ├── AutoInvocationSample │ ├── AutoInvocationFilterSample.csproj │ ├── Config.cs │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ └── Program.cs ├── BingMapPluginDemo │ ├── BingMapPluginDemo.csproj │ ├── Config.cs │ └── Program.cs ├── CustomLLMYoutubeDemo │ ├── Config.cs │ ├── CustomLLMYoutubeDemo.csproj │ ├── Program.cs │ └── YouTubeChatCompletionService.cs ├── CustomLLMYoutubeStreamingDemo │ ├── Config.cs │ ├── CustomLLMYoutubeStreamingDemo.csproj │ ├── Program.cs │ ├── YouTubeChatCompletionService.cs │ └── YouTubeChatServiceExtension.cs ├── DALL-E │ ├── BotWithSK │ │ ├── AdapterWithErrorHandler.cs │ │ ├── BotWithSK.csproj │ │ ├── BotWithSK.sln │ │ ├── Bots │ │ │ ├── DialogAndWelcomeBot.cs │ │ │ ├── DialogBot.cs │ │ │ └── EchoBot.cs │ │ ├── Controllers │ │ │ └── BotController.cs │ │ ├── DeploymentTemplates │ │ │ ├── DeployUseExistResourceGroup │ │ │ │ ├── parameters-for-template-AzureBot-with-rg.json │ │ │ │ ├── parameters-for-template-BotApp-with-rg.json │ │ │ │ ├── readme.md │ │ │ │ ├── template-AzureBot-with-rg.json │ │ │ │ └── template-BotApp-with-rg.json │ │ │ └── DeployWithNewResourceGroup │ │ │ │ ├── parameters-for-template-AzureBot-new-rg.json │ │ │ │ ├── parameters-for-template-BotApp-new-rg.json │ │ │ │ ├── readme.md │ │ │ │ ├── template-AzureBot-new-rg.json │ │ │ │ └── template-BotApp-new-rg.json │ │ ├── Dialogs │ │ │ ├── AdaptiveHelper.cs │ │ │ └── RootDialog.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── default.htm │ └── SKConnector │ │ ├── Config.cs │ │ ├── GlobalUsings.cs │ │ ├── KeyConst.cs │ │ ├── Plugins │ │ ├── CitySkill │ │ │ └── history │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ ├── Json │ │ │ └── ExtractJson.cs │ │ └── Weather │ │ │ └── weatherplugin.cs │ │ ├── SKConnector.csproj │ │ ├── SemanticKernelProcessor.cs │ │ └── SemanticPluginHelper.cs ├── ExtendKernelMemorySK │ ├── .NET.pdf │ ├── Config.cs │ ├── ExtendKernelMemorySK.csproj │ ├── ExtendMemoryPlugin.cs │ └── Program.cs ├── FunctionCallingDemo │ ├── Config.cs │ ├── FunctionCallingDemo.csproj │ └── Program.cs ├── FunctionCallingHelper │ ├── Config.cs │ ├── FunctionCallingHelper.csproj │ ├── Plugins │ │ └── CurrencyConverterPlugin.cs │ └── Program.cs ├── FunctionCallingStepwiseDemo │ ├── Config.cs │ ├── FunctionCallingStepwiseDemo.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ └── Program.cs ├── FunctionCallingStreaming │ ├── Config.cs │ ├── ExternalWeatherPlugin.cs │ ├── FunctionCallingStreaming.csproj │ ├── Plugins │ │ └── CurrencyConverterPlugin.cs │ └── Program.cs ├── GeminiDemo │ ├── Config.cs │ ├── GeminiDemo.csproj │ └── Program.cs ├── GeminiFCDemo │ ├── Config.cs │ ├── GeminiFCDemo.csproj │ ├── Plugins │ │ └── CurrencyConverterPlugin.cs │ └── Program.cs ├── GitHubSK │ ├── Config.cs │ ├── GitHubSK.csproj │ └── Program.cs ├── HandleBarPlannerPluginDemo │ ├── Config.cs │ ├── HandleBarPlannerPluginDemo.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ └── WeatherHistoryPlugIns.cs ├── HandleBarsPlannerSaveDemo │ ├── Config.cs │ ├── Display.cs │ ├── HandleBarsPlannerSaveDemo.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ └── Program.cs ├── HandleBarsPromptTemplate │ ├── Config.cs │ ├── HandleBarsPromptTemplate.csproj │ └── Program.cs ├── HandlebarsPlannerDemo │ ├── Config.cs │ ├── Display.cs │ ├── HandlebarsPlannerDemo.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ └── Program.cs ├── InterfacePluginsDemo │ ├── Config.cs │ ├── InterfacePluginsDemo.csproj │ ├── Plugins │ │ └── MathsPlugin │ │ │ ├── IAddPlugin.cs │ │ │ └── MathPlugin.cs │ └── Program.cs ├── InvocationFilter │ ├── Config.cs │ ├── InvocationFilter.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ └── Program.cs ├── JSONHandleBarsTemplate │ ├── Config.cs │ ├── JSONHandleBarsTemplate.csproj │ ├── Plugins │ │ └── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ └── Program.cs ├── KernelFilterDemo │ ├── Config.cs │ ├── Display.cs │ ├── FunctionFilter.cs │ ├── KernelFilterDemo.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ ├── PromptFilter.cs │ └── Watcher │ │ ├── ITimingLogger.cs │ │ └── TimingLogger.cs ├── KernelFunctionFactoryDemo │ ├── Config.cs │ ├── KernelFunctionFactoryDemo.csproj │ ├── Plugins │ │ └── VehiclePlugin │ │ │ └── VehiclePlugin.cs │ └── Program.cs ├── KernelHooksDemo │ ├── Config.cs │ ├── Display.cs │ ├── KernelHooksDemo.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ └── TimingLogger.cs ├── KernelMemorySK │ ├── .NET.pdf │ ├── Config.cs │ ├── KernelMemorySK.csproj │ └── Program.cs ├── LiquidPromptDemo │ ├── GitConfig.cs │ ├── LiquidPromptDemo.csproj │ └── Program.cs ├── LocalLLMDemo │ ├── LocalLLMDemo.csproj │ ├── LocalServerClientHandler.cs │ └── Program.cs ├── MemoryServerlessDemo │ ├── .NET.pdf │ ├── Config.cs │ ├── MemoryServerlessDemo.csproj │ └── Program.cs ├── NativePlugin │ ├── Config.cs │ ├── NativePlugin.csproj │ ├── Plugins │ │ └── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ └── Program.cs ├── NewFunctionCalling │ ├── AutoFunctionCalling.csproj │ ├── Config.cs │ ├── Plugins │ │ └── CurrencyConverterPlugin.cs │ └── Program.cs ├── NoneFunctionCalling │ ├── GitConfig.cs │ ├── NoneFunctionCalling.csproj │ ├── Plugins │ │ └── ExternalWeatherPlugin.cs │ └── Program.cs ├── OpenAIAgent │ ├── Config.cs │ ├── OpenAIAgent.csproj │ └── Program.cs ├── PluginKernelFilter │ ├── Config.cs │ ├── Display.cs │ ├── Filters │ │ ├── FunctionFilter.cs │ │ └── PromptFilter.cs │ ├── InterruptPlanner.csproj │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ └── Watcher │ │ ├── ITimingLogger.cs │ │ └── TimingLogger.cs ├── PluginObject │ ├── Config.cs │ ├── PluginObject.csproj │ ├── Plugins │ │ └── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ └── Program.cs ├── ProcessSample │ ├── GitConfig.cs │ ├── ProcessLibSample.csproj │ ├── Program.cs │ ├── Step1 │ │ └── IntroStep.cs │ ├── Step2 │ │ ├── QuestionAnswer.cs │ │ ├── QuizzesState.cs │ │ └── QuizzesStep.cs │ ├── Step3 │ │ └── LLMResponse.cs │ └── StepEvent │ │ └── StepEvents.cs ├── PromptFilter │ ├── Config.cs │ ├── Plugins │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ ├── PromptFilter.csproj │ └── PromptRenderFilter.cs ├── PromptFunction │ ├── Config.cs │ ├── Plugins │ │ └── location │ │ │ └── city │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ └── PromptFunctionDemo.csproj ├── PromptYAMLDemo │ ├── Config.cs │ ├── Plugins │ │ ├── Yaml │ │ │ └── city.yaml │ │ └── location │ │ │ └── city │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ └── PromptYAMLDemo.csproj ├── RequiredFunctionCalling │ ├── GitConfig.cs │ ├── Plugins │ │ └── ExternalWeatherPlugin.cs │ ├── Program.cs │ ├── PromptRenderFilter.cs │ └── RequiredFunctionCalling.csproj ├── SKAgent │ ├── Config.cs │ ├── Program.cs │ └── SKAgent.csproj ├── SKFunctionCalling │ ├── Config.cs │ ├── Plugins │ │ └── CurrencyConverterPlugin.cs │ ├── Program.cs │ └── SKFunctionCalling.csproj ├── SKSample.sln ├── StreamingDemo │ ├── Config.cs │ ├── Plugins │ │ ├── Yaml │ │ │ └── city.yaml │ │ └── location │ │ │ └── city │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ └── StreamingDemo.csproj ├── TinyCopilot │ ├── Config.cs │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ └── TinyCopilot.csproj ├── TinyCopilotGPT4VisionDemo │ ├── Config.cs │ ├── Plugins │ │ ├── WeatherPlugin │ │ │ └── ExternalWeatherPlugin.cs │ │ └── location │ │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ ├── Program.cs │ ├── TinyCopilotGPT4VisionDemo.csproj │ └── VisionService.cs └── archive │ ├── 01HelloWorld │ └── HelloWorld │ │ ├── ConfigParameters.cs │ │ ├── HelloWorld.csproj │ │ ├── HelloWorld.sln │ │ └── Program.cs │ ├── 02Plugin │ └── SKWeatherPlugin │ │ ├── Plugins │ │ └── Weather │ │ │ └── WeatherPlugin.cs │ │ ├── Program.cs │ │ ├── SKWeatherPlugin.csproj │ │ └── SKWeatherPlugin.sln │ ├── 04Planner │ └── SKWeatherPlugin │ │ ├── Plugins │ │ ├── History │ │ │ └── HistoryPrompt │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ └── Weather │ │ │ └── WeatherPlugin.cs │ │ ├── Program.cs │ │ ├── WeatherSKPlugin.csproj │ │ └── global.json │ ├── 05HelloVSCode │ └── sk-csharp-hello-world │ │ ├── .gitignore │ │ ├── Program.cs │ │ ├── README.md │ │ ├── config │ │ ├── EndpointTypes.cs │ │ ├── KernelBuilderExtensions.cs │ │ ├── KernelSettings.cs │ │ ├── ServiceTypes.cs │ │ ├── appsettings.json.azure-example │ │ └── appsettings.json.openai-example │ │ ├── sk-csharp-hello-world.csproj │ │ ├── sk-csharp-hello-world.sln │ │ └── skills │ │ └── FunSkill │ │ ├── Excuses │ │ ├── config.json │ │ └── skprompt.txt │ │ ├── Joke │ │ ├── config.json │ │ └── skprompt.txt │ │ └── Limerick │ │ ├── config.json │ │ └── skprompt.txt │ ├── 06SemanticFunction │ └── sk-csharp-hello-world │ │ ├── .gitignore │ │ ├── Program.cs │ │ ├── README.md │ │ ├── SKSemanticFunction.csproj │ │ ├── config │ │ ├── EndpointTypes.cs │ │ ├── KernelBuilderExtensions.cs │ │ ├── KernelSettings.cs │ │ ├── ServiceTypes.cs │ │ └── appsettings.json.openai-example │ │ ├── sk-csharp-hello-world.sln │ │ └── skills │ │ └── CitySkill │ │ └── history │ │ ├── config.json │ │ └── skprompt.txt │ ├── 07Chainingfunctions │ └── Chaining │ │ ├── .gitignore │ │ ├── ChaniningFunction.csproj │ │ ├── Program.cs │ │ ├── README.md │ │ ├── config │ │ ├── EndpointTypes.cs │ │ ├── KernelBuilderExtensions.cs │ │ ├── KernelSettings.cs │ │ ├── ServiceTypes.cs │ │ └── appsettings.json.openai-example │ │ └── skills │ │ ├── CitySkill │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ ├── Json │ │ └── ExtractJson.cs │ │ └── Weather │ │ └── weatherplugin.cs │ ├── 08SpeechDemo │ ├── Program.cs │ └── SpeechDemo.csproj │ ├── 09FunctionHooks │ ├── FunctionHooks.csproj │ ├── Program.cs │ ├── Settings.cs │ └── skills │ │ ├── CitySkill │ │ └── history │ │ │ ├── config.json │ │ │ └── skprompt.txt │ │ ├── Json │ │ └── ExtractJson.cs │ │ └── Weather │ │ └── weatherplugin.cs │ ├── 10SKInBot │ ├── BotWithSK │ │ ├── AdapterWithErrorHandler.cs │ │ ├── BotWithSK.csproj │ │ ├── BotWithSK.sln │ │ ├── Bots │ │ │ ├── DialogAndWelcomeBot.cs │ │ │ ├── DialogBot.cs │ │ │ └── EchoBot.cs │ │ ├── Controllers │ │ │ └── BotController.cs │ │ ├── DeploymentTemplates │ │ │ ├── DeployUseExistResourceGroup │ │ │ │ ├── parameters-for-template-AzureBot-with-rg.json │ │ │ │ ├── parameters-for-template-BotApp-with-rg.json │ │ │ │ ├── readme.md │ │ │ │ ├── template-AzureBot-with-rg.json │ │ │ │ └── template-BotApp-with-rg.json │ │ │ └── DeployWithNewResourceGroup │ │ │ │ ├── parameters-for-template-AzureBot-new-rg.json │ │ │ │ ├── parameters-for-template-BotApp-new-rg.json │ │ │ │ ├── readme.md │ │ │ │ ├── template-AzureBot-new-rg.json │ │ │ │ └── template-BotApp-new-rg.json │ │ ├── Dialogs │ │ │ └── RootDialog.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── default.htm │ └── SKConnector │ │ ├── Plugins │ │ ├── CitySkill │ │ │ └── history │ │ │ │ ├── config.json │ │ │ │ └── skprompt.txt │ │ ├── Json │ │ │ └── ExtractJson.cs │ │ └── Weather │ │ │ └── weatherplugin.cs │ │ ├── SKConnector.csproj │ │ ├── SemanticHelper.cs │ │ ├── Settings.cs │ │ └── config │ │ ├── EndpointTypes.cs │ │ ├── KernelBuilderExtensions.cs │ │ ├── KernelSettings.cs │ │ ├── ServiceTypes.cs │ │ └── appsettings.json.openai-example │ ├── 13-14-IntentBot │ ├── IntentBot │ │ ├── AdapterWithErrorHandler.cs │ │ ├── Bots │ │ │ ├── DialogAndWelcomeBot.cs │ │ │ └── DialogBot.cs │ │ ├── Controllers │ │ │ └── BotController.cs │ │ ├── DeploymentTemplates │ │ │ ├── DeployUseExistResourceGroup │ │ │ │ ├── parameters-for-template-AzureBot-with-rg.json │ │ │ │ ├── parameters-for-template-BotApp-with-rg.json │ │ │ │ ├── readme.md │ │ │ │ ├── template-AzureBot-with-rg.json │ │ │ │ └── template-BotApp-with-rg.json │ │ │ └── DeployWithNewResourceGroup │ │ │ │ ├── parameters-for-template-AzureBot-new-rg.json │ │ │ │ ├── parameters-for-template-BotApp-new-rg.json │ │ │ │ ├── readme.md │ │ │ │ ├── template-AzureBot-new-rg.json │ │ │ │ └── template-BotApp-new-rg.json │ │ ├── Dialogs │ │ │ ├── MovieTemplate │ │ │ │ ├── BookingOutput.cs │ │ │ │ ├── BookingTemplate.cs │ │ │ │ ├── Entity.cs │ │ │ │ ├── Intent.cs │ │ │ │ ├── MovieTemplate.cs │ │ │ │ └── movie.json │ │ │ ├── PizzaTemplate │ │ │ │ ├── Entities.cs │ │ │ │ ├── Intent.cs │ │ │ │ ├── Order.cs │ │ │ │ ├── Output.cs │ │ │ │ ├── Pizza.cs │ │ │ │ ├── PizzaTemplate.cs │ │ │ │ └── pizzaexample.json │ │ │ ├── RootDialog.cs │ │ │ ├── SKernel │ │ │ │ └── SKHelper.cs │ │ │ └── Settings.cs │ │ ├── EmptyBot.cs │ │ ├── IntentBot.csproj │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── TemplateBot.sln │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ │ └── default.htm │ └── SKHelper.cs │ ├── 15StepwisePLanner │ └── TemplateBot │ │ ├── AdapterWithErrorHandler.cs │ │ ├── Bots │ │ ├── DialogAndWelcomeBot.cs │ │ └── DialogBot.cs │ │ ├── Controllers │ │ └── BotController.cs │ │ ├── DeploymentTemplates │ │ ├── DeployUseExistResourceGroup │ │ │ ├── parameters-for-template-AzureBot-with-rg.json │ │ │ ├── parameters-for-template-BotApp-with-rg.json │ │ │ ├── readme.md │ │ │ ├── template-AzureBot-with-rg.json │ │ │ └── template-BotApp-with-rg.json │ │ └── DeployWithNewResourceGroup │ │ │ ├── parameters-for-template-AzureBot-new-rg.json │ │ │ ├── parameters-for-template-BotApp-new-rg.json │ │ │ ├── readme.md │ │ │ ├── template-AzureBot-new-rg.json │ │ │ └── template-BotApp-new-rg.json │ │ ├── Dialogs │ │ ├── MovieTemplate │ │ │ ├── BookingOutput.cs │ │ │ ├── BookingTemplate.cs │ │ │ ├── Entity.cs │ │ │ ├── Intent.cs │ │ │ ├── MovieTemplate.cs │ │ │ └── movie.json │ │ ├── PizzaTemplate │ │ │ ├── Entities.cs │ │ │ ├── Intent.cs │ │ │ ├── Order.cs │ │ │ ├── Output.cs │ │ │ ├── Pizza.cs │ │ │ ├── PizzaTemplate.cs │ │ │ └── pizzaexample.json │ │ ├── RootDialog.cs │ │ ├── SKernel │ │ │ └── SKHelper.cs │ │ └── Settings.cs │ │ ├── EmptyBot.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── StepwisePlanner.csproj │ │ ├── TemplateBot.sln │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ └── default.htm │ ├── Commonlib │ └── library.shared.targets │ └── Settings │ └── ConfigSettings │ ├── ConfigParameters.cs │ └── ConfigSettings.csproj └── SKVersion2 ├── AgentOrchestration ├── ConcurrentPattern │ ├── ConcurrentPattern.csproj │ └── Program.cs ├── GroupPattern │ ├── GroupPattern.csproj │ └── Program.cs └── SequentialPattern │ ├── Program.cs │ └── SequentialPattern.csproj ├── MCP ├── Azure │ ├── MCPClient.Azure │ │ ├── MCPClient.Azure.csproj │ │ └── Program.cs │ └── MCPServer.Azure │ │ ├── MCPServer.Azure.csproj │ │ ├── Pages │ │ ├── Error.cshtml │ │ ├── Error.cshtml.cs │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Privacy.cshtml │ │ ├── Privacy.cshtml.cs │ │ ├── Shared │ │ │ ├── _Layout.cshtml │ │ │ ├── _Layout.cshtml.css │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ │ ├── Program.cs │ │ ├── Properties │ │ ├── ServiceDependencies │ │ │ └── MCPServerAzureDemo - Web Deploy │ │ │ │ └── profile.arm.json │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-grid.rtl.css │ │ │ ├── bootstrap-grid.rtl.css.map │ │ │ ├── bootstrap-grid.rtl.min.css │ │ │ ├── bootstrap-grid.rtl.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap-reboot.rtl.css │ │ │ ├── bootstrap-reboot.rtl.css.map │ │ │ ├── bootstrap-reboot.rtl.min.css │ │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ │ ├── bootstrap-utilities.css │ │ │ ├── bootstrap-utilities.css.map │ │ │ ├── bootstrap-utilities.min.css │ │ │ ├── bootstrap-utilities.min.css.map │ │ │ ├── bootstrap-utilities.rtl.css │ │ │ ├── bootstrap-utilities.rtl.css.map │ │ │ ├── bootstrap-utilities.rtl.min.css │ │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.css.map │ │ │ ├── bootstrap.rtl.css │ │ │ ├── bootstrap.rtl.css.map │ │ │ ├── bootstrap.rtl.min.css │ │ │ └── bootstrap.rtl.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.esm.js │ │ │ ├── bootstrap.esm.js.map │ │ │ ├── bootstrap.esm.min.js │ │ │ ├── bootstrap.esm.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ └── dist │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ ├── jquery.min.map │ │ ├── jquery.slim.js │ │ ├── jquery.slim.min.js │ │ └── jquery.slim.min.map ├── LocalMCPWithSKClient │ ├── LocalMCPServer │ │ ├── LocalMCPServer.csproj │ │ ├── Program.cs │ │ └── Tool │ │ │ └── BookTool.cs │ └── SKMCPClient │ │ ├── Config.cs │ │ ├── Program.cs │ │ └── SKMCPClient.csproj └── SKPluginInMCPServer │ ├── MCPClient │ ├── MCPClient.csproj │ └── Program.cs │ └── MCPServerSKPlugins │ ├── MCPServerSKPlugins.csproj │ └── Program.cs ├── ModelFactory ├── Config.cs ├── ExtensionsClientFactory.cs ├── KernelFactory.cs ├── LLMModel.cs └── LLMModelFactory.csproj ├── PluginsLibrary ├── Config.cs ├── ExtensionsLibrary.csproj ├── Plugins │ └── CurrencyConverterPlugin.cs └── Tools │ ├── BookDetailsTool.cs │ └── ExternalWeatherTool.cs └── SKVersion2.sln /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Vinoth Rajendran 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 | -------------------------------------------------------------------------------- /SKSampleCSharp/01HelloWorld/Config.cs: -------------------------------------------------------------------------------- 1 | namespace HelloWorld; 2 | 3 | public static class Config 4 | { 5 | public static string DeploymentOrModelId => ""; 6 | public static string Endpoint => ""; 7 | public static string ApiKey => ""; 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/01HelloWorld/HelloWorld.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SKSampleCSharp/AutoGenKernelPlugin/AutoGenKernelPlugin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SKSampleCSharp/AutoGenKernelPlugin/Config.cs: -------------------------------------------------------------------------------- 1 | namespace AutoGenKernelPlugin 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// GitHub AI Model Name 10 | /// 11 | public static string ModelName => ""; 12 | 13 | /// 14 | ///GitHub AI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// GitHub Token 20 | /// 21 | public static string GitHubToken => ""; 22 | 23 | public static string WeatherApiKey => ""; 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SKSampleCSharp/AutoGenSK/AutoGenSK.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/AutoGenSK/Config.cs: -------------------------------------------------------------------------------- 1 | namespace AutoGenSK 2 | { 3 | /// 4 | /// Configurations for GitHub AI 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// GitHub AI Model Name 10 | /// 11 | public static string ModelName => "gpt-4o"; 12 | 13 | /// 14 | ///GitHub AI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// GitHub Token 20 | /// 21 | public static string GitHubToken => ""; 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/AutoInvocationSample/AutoInvocationFilterSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 1701;1702;SKEXP0001; 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SKSampleCSharp/AutoInvocationSample/Config.cs: -------------------------------------------------------------------------------- 1 | namespace AutoInvocationFilterSample 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/AutoInvocationSample/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/AutoInvocationSample/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/BingMapPluginDemo/BingMapPluginDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SKSampleCSharp/BingMapPluginDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace BingMapPluginDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// Bing Map Key ( Create a Key in Azure Portal ) 25 | /// 26 | public static string BingMapKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/CustomLLMYoutubeDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace CustomLLMYoutubeDemo; 2 | 3 | /// 4 | /// Azure openai and Bing Keys 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI Deployment or Model Id 10 | /// 11 | public static string DeploymentOrModelId => "gpt4vision"; 12 | 13 | /// 14 | /// Azure OpenAI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI ApiKey 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | public static string DeploymentEmbeddingModel => "EmbeddingModel"; 24 | 25 | public static string YoutubeKey => ""; 26 | 27 | } -------------------------------------------------------------------------------- /SKSampleCSharp/CustomLLMYoutubeDemo/CustomLLMYoutubeDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SKSampleCSharp/CustomLLMYoutubeStreamingDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace CustomLLMYoutubeStreamingDemo; 2 | 3 | /// 4 | /// Azure openai and Bing Keys 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI Deployment or Model Id 10 | /// 11 | public static string DeploymentOrModelId => "gpt4vision"; 12 | 13 | /// 14 | /// Azure OpenAI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI ApiKey 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | public static string DeploymentEmbeddingModel => "EmbeddingModel"; 24 | 25 | public static string YoutubeKey => ""; 26 | 27 | } -------------------------------------------------------------------------------- /SKSampleCSharp/CustomLLMYoutubeStreamingDemo/CustomLLMYoutubeStreamingDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SKSampleCSharp/CustomLLMYoutubeStreamingDemo/YouTubeChatServiceExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.SemanticKernel; 3 | using Microsoft.SemanticKernel.ChatCompletion; 4 | 5 | namespace CustomLLMYoutubeStreamingDemo 6 | { 7 | public static class YouTubeChatServiceExtension 8 | { 9 | public static IKernelBuilder AddYouTubeChatCompletion(this IKernelBuilder builder, string youTubeKey,string channelKey = "") 10 | { 11 | if(string.IsNullOrWhiteSpace(youTubeKey)) 12 | throw new ArgumentException("YouTube Key is required"); 13 | 14 | builder.Services.AddKeyedSingleton(nameof(YouTubeChatCompletionService), 15 | new YouTubeChatCompletionService(youTubeKey)); 16 | 17 | return builder; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/BotWithSK.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "azureBotId": { 6 | "value": "" 7 | }, 8 | "azureBotSku": { 9 | "value": "S1" 10 | }, 11 | "azureBotRegion": { 12 | "value": "global" 13 | }, 14 | "botEndpoint": { 15 | "value": "" 16 | }, 17 | "appType": { 18 | "value": "MultiTenant" 19 | }, 20 | "appId": { 21 | "value": "" 22 | }, 23 | "UMSIName": { 24 | "value": "" 25 | }, 26 | "UMSIResourceGroupName": { 27 | "value": "" 28 | }, 29 | "tenantId": { 30 | "value": "" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "appServiceName": { 6 | "value": "" 7 | }, 8 | "existingAppServicePlanName": { 9 | "value": "" 10 | }, 11 | "existingAppServicePlanLocation": { 12 | "value": "" 13 | }, 14 | "newAppServicePlanName": { 15 | "value": "" 16 | }, 17 | "newAppServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "newAppServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "azureBotId": { 12 | "value": "" 13 | }, 14 | "azureBotSku": { 15 | "value": "S1" 16 | }, 17 | "azureBotRegion": { 18 | "value": "global" 19 | }, 20 | "botEndpoint": { 21 | "value": "" 22 | }, 23 | "appType": { 24 | "value": "MultiTenant" 25 | }, 26 | "appId": { 27 | "value": "" 28 | }, 29 | "UMSIName": { 30 | "value": "" 31 | }, 32 | "UMSIResourceGroupName": { 33 | "value": "" 34 | }, 35 | "tenantId": { 36 | "value": "" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "appServiceName": { 12 | "value": "" 13 | }, 14 | "appServicePlanName": { 15 | "value": "" 16 | }, 17 | "appServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "appServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.18.1 5 | 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Hosting; 8 | 9 | namespace BotWithSK 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | CreateHostBuilder(args).Build().Run(); 16 | } 17 | 18 | public static IHostBuilder CreateHostBuilder(string[] args) => 19 | Host.CreateDefaultBuilder(args) 20 | .ConfigureWebHostDefaults(webBuilder => 21 | { 22 | webBuilder.UseStartup(); 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:3978", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "EchoBot": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:3979;http://localhost:3978", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/BotWithSK/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MicrosoftAppType": "", 3 | "MicrosoftAppId": "", 4 | "MicrosoftAppPassword": "", 5 | "MicrosoftAppTenantId": "" 6 | } 7 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/SKConnector/Config.cs: -------------------------------------------------------------------------------- 1 | namespace SKConnector; 2 | 3 | public static class Config 4 | { 5 | 6 | /// 7 | /// Azure OpenAI deployment name 8 | /// 9 | public static string DeploymentOrModelId => "gpt4model"; 10 | 11 | /// 12 | /// Azure OpenAI endpoint 13 | /// 14 | public static string Endpoint => ""; 15 | 16 | /// 17 | /// Azure OpenAI Key 18 | /// 19 | public static string ApiKey => ""; 20 | 21 | /// 22 | /// External API key for weather service 23 | /// 24 | public static string WeatherApiKey => ""; 25 | 26 | //DALL-E Image Generation 27 | 28 | /// 29 | /// Image endpoint 30 | /// 31 | public static string ImageEndpoint => ""; 32 | 33 | /// 34 | /// Image ApiKey 35 | /// 36 | public static string ImageApiKey => ""; 37 | 38 | /// 39 | /// Image ModelId 40 | /// 41 | public static string ImageModelId => ""; 42 | } -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/SKConnector/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | // Global using directives 2 | 3 | global using Microsoft.SemanticKernel; 4 | global using Newtonsoft.Json; 5 | global using SKConnector.Plugins.Json; 6 | global using SKConnector.Plugins.Weather; 7 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/SKConnector/KeyConst.cs: -------------------------------------------------------------------------------- 1 | namespace SKConnector; 2 | 3 | static class KeyConst 4 | { 5 | public const string CityName = "cityname"; 6 | public const string History = "history"; 7 | public const string HistoryPromptResult = "historyResult"; 8 | 9 | } -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/SKConnector/Plugins/CitySkill/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Find the city or location", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 100 7 | }, 8 | "input": { 9 | "parameters": [ 10 | { 11 | "name": "input", 12 | "description": "This input provided by user", 13 | "defaultValue": "" 14 | } 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/SKConnector/Plugins/CitySkill/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Find the city or location mentioned in the given text: {{$input}}. 2 | Share the city's name and a short history in JSON format, keeping it within two lines without extra spaces or new lines. 3 | 4 | example 5 | { 6 | "cityname": "CityNameHere", 7 | "history": "Brief history of the city." 8 | } 9 | -------------------------------------------------------------------------------- /SKSampleCSharp/DALL-E/SKConnector/SKConnector.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Always 23 | 24 | 25 | 26 | 27 | 28 | Always 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SKSampleCSharp/ExtendKernelMemorySK/.NET.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvinothrajendran/MicrosoftSemanticKernelSamples/d35ba30fddfc880070bc1f17e9479d0611b4a4d0/SKSampleCSharp/ExtendKernelMemorySK/.NET.pdf -------------------------------------------------------------------------------- /SKSampleCSharp/ExtendKernelMemorySK/Config.cs: -------------------------------------------------------------------------------- 1 | namespace ExtendKernelMemorySK; 2 | 3 | /// 4 | /// Azure openai and Bing Keys 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI Deployment or Model Id 10 | /// 11 | public static string DeploymentOrModelId => "gpt4vision"; 12 | 13 | /// 14 | /// Azure OpenAI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI ApiKey 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | public static string DeploymentEmbeddingModel => "EmbeddingModel"; 24 | 25 | } -------------------------------------------------------------------------------- /SKSampleCSharp/ExtendKernelMemorySK/ExtendKernelMemorySK.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Always 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace FunctionCallingDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingDemo/FunctionCallingDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Always 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingHelper/Config.cs: -------------------------------------------------------------------------------- 1 | namespace FunctionCallingHelper 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingHelper/FunctionCallingHelper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingStepwiseDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace FunctionCallingStepwiseDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingStepwiseDemo/FunctionCallingStepwiseDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingStepwiseDemo/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingStepwiseDemo/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingStreaming/Config.cs: -------------------------------------------------------------------------------- 1 | namespace FunctionCallingStreaming 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/FunctionCallingStreaming/FunctionCallingStreaming.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SKSampleCSharp/GeminiDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace GeminiDemo; 2 | 3 | public static class Config 4 | { 5 | public static string GeminiModelId = ""; 6 | public static string GeminiApiKey = ""; 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/GeminiDemo/GeminiDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/GeminiFCDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace GeminiFCDemo; 2 | 3 | public static class Config 4 | { 5 | public static string GeminiModelId = ""; 6 | public static string GeminiApiKey = ""; 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/GeminiFCDemo/GeminiFCDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/GitHubSK/Config.cs: -------------------------------------------------------------------------------- 1 | namespace GitHubSK 2 | { 3 | /// 4 | /// Configurations for GitHub AI 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// GitHub AI Model Name 10 | /// 11 | public static string ModelName => ""; 12 | 13 | /// 14 | ///GitHub AI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// GitHub Token 20 | /// 21 | public static string GitHubToken => ""; 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/GitHubSK/GitHubSK.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarPlannerPluginDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace HandleBarPlannerPluginDemo; 2 | 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarPlannerPluginDemo/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarPlannerPluginDemo/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarsPlannerSaveDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace HandleBarsPlannerSaveDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarsPlannerSaveDemo/HandleBarsPlannerSaveDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarsPlannerSaveDemo/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarsPlannerSaveDemo/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarsPromptTemplate/Config.cs: -------------------------------------------------------------------------------- 1 | namespace HandleBarsPromptTemplate 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/HandleBarsPromptTemplate/HandleBarsPromptTemplate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/HandlebarsPlannerDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace HandlebarsPlannerDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/HandlebarsPlannerDemo/HandlebarsPlannerDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/HandlebarsPlannerDemo/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/HandlebarsPlannerDemo/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/InterfacePluginsDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace InterfacePluginsDemo; 2 | 3 | 4 | /// 5 | /// Azure openai and Bing Keys 6 | /// 7 | public class Config 8 | { 9 | /// 10 | /// Azure OpenAI Deployment or Model Id 11 | /// 12 | public static string DeploymentOrModelId => "gpt4vision"; 13 | 14 | /// 15 | /// Azure OpenAI Endpoint 16 | /// 17 | public static string Endpoint => ""; 18 | 19 | /// 20 | /// Azure OpenAI ApiKey 21 | /// 22 | public static string ApiKey => ""; 23 | 24 | public static string DeploymentEmbeddingModel => "EmbeddingModel"; 25 | } -------------------------------------------------------------------------------- /SKSampleCSharp/InterfacePluginsDemo/InterfacePluginsDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/InterfacePluginsDemo/Plugins/MathsPlugin/IAddPlugin.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Microsoft.SemanticKernel; 3 | 4 | namespace InterfacePluginsDemo.Plugins.MathsPlugin; 5 | 6 | 7 | [Description("This interface contains simple maths functions")] 8 | public interface IAddPlugin 9 | { 10 | [KernelFunction, Description("Add two numbers")] 11 | double Add( 12 | [Description("The first number to add")] double number1, 13 | [Description("The second number to add")] double number2 14 | ); 15 | 16 | [KernelFunction, Description("Subtract two numbers")] 17 | double Subtract( 18 | [Description("The first number to subtract from")] double number1, 19 | [Description("The second number to subtract away")] double number2 20 | ); 21 | 22 | } -------------------------------------------------------------------------------- /SKSampleCSharp/InvocationFilter/Config.cs: -------------------------------------------------------------------------------- 1 | namespace InvocationFilter 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/InvocationFilter/InvocationFilter.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/InvocationFilter/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/InvocationFilter/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/JSONHandleBarsTemplate/Config.cs: -------------------------------------------------------------------------------- 1 | namespace JSONHandleBarsTemplate 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/JSONHandleBarsTemplate/JSONHandleBarsTemplate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace KernelFilterDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/FunctionFilter.cs: -------------------------------------------------------------------------------- 1 | using KernelFilterDemo.Watcher; 2 | using Microsoft.SemanticKernel; 3 | 4 | namespace KernelFilterDemo; 5 | 6 | #pragma warning disable SKEXP0004 7 | public class FunctionFilter(ITimingLogger functionTimingLogger,IScreenDisplay display) : IFunctionFilter 8 | { 9 | public void OnFunctionInvoked(FunctionInvokedContext context) 10 | { 11 | var functionHooks = $"Function Invoked(after) {context.Function.Name}"; 12 | display.WriteLine(functionHooks); 13 | 14 | functionTimingLogger.Stop(); 15 | } 16 | 17 | public void OnFunctionInvoking(FunctionInvokingContext context) 18 | { 19 | var functionHooks = $"Function Hooks - {context.Function.Name}"; 20 | functionTimingLogger.Start(functionHooks); 21 | 22 | functionHooks = $"Function Invoking(Before) {context.Function.Name}"; 23 | display.WriteLine(functionHooks); 24 | } 25 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/KernelFilterDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 1701;1702;SKEXP0004; 12 | 13 | 14 | 15 | 1701;1702;SKEXP0004; 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Always 26 | 27 | 28 | Always 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/PromptFilter.cs: -------------------------------------------------------------------------------- 1 | using KernelFilterDemo.Watcher; 2 | using Microsoft.SemanticKernel; 3 | 4 | namespace KernelFilterDemo; 5 | 6 | #pragma warning disable SKEXP0004 7 | public class PromptFilter(ITimingLogger promptTimingLogger, IScreenDisplay display) : IPromptFilter 8 | { 9 | public void OnPromptRendered(PromptRenderedContext context) 10 | { 11 | var promptHooks = $"Prompt Rendered(after) {context.Function.Name}"; 12 | display.WriteLine(promptHooks); 13 | promptTimingLogger.Stop(); 14 | } 15 | 16 | public void OnPromptRendering(PromptRenderingContext context) 17 | { 18 | var promptHooks = $"Prompt Hooks - {context.Function.Name}"; 19 | promptTimingLogger.Start(promptHooks); 20 | 21 | promptHooks = $"Prompt Rendering(Before) {context.Function.Name}"; 22 | display.WriteLine(promptHooks); 23 | } 24 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/Watcher/ITimingLogger.cs: -------------------------------------------------------------------------------- 1 | namespace KernelFilterDemo.Watcher; 2 | 3 | public interface ITimingLogger 4 | { 5 | void Start(string name); 6 | void Stop(); 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFilterDemo/Watcher/TimingLogger.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace KernelFilterDemo.Watcher; 4 | 5 | public class TimingLogger : ITimingLogger 6 | { 7 | private readonly Stopwatch stopwatch = new(); 8 | private long startTime = 0; 9 | private string functionName = string.Empty; 10 | 11 | public void Start(string name) 12 | { 13 | functionName = name; 14 | stopwatch.Reset(); 15 | startTime = GetCurrentTime(); 16 | stopwatch.Start(); 17 | } 18 | 19 | public void Stop() 20 | { 21 | stopwatch.Stop(); 22 | long elapsedTime = stopwatch.ElapsedMilliseconds; 23 | Console.ForegroundColor = ConsoleColor.DarkGreen; 24 | Console.WriteLine($"Function: {functionName}, Start Time: {startTime} ms, Stop Time: {GetCurrentTime()} ms, Elapsed Time: {elapsedTime} ms\n"); 25 | } 26 | 27 | private long GetCurrentTime() 28 | { 29 | return stopwatch.ElapsedMilliseconds; 30 | } 31 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFunctionFactoryDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace KernelFunctionFactoryDemo; 2 | 3 | 4 | /// 5 | /// Azure openai and Bing Keys 6 | /// 7 | public class Config 8 | { 9 | /// 10 | /// Azure OpenAI Deployment or Model Id 11 | /// 12 | public static string DeploymentOrModelId => "gpt4vision"; 13 | 14 | /// 15 | /// Azure OpenAI Endpoint 16 | /// 17 | public static string Endpoint => ""; 18 | 19 | /// 20 | /// Azure OpenAI ApiKey 21 | /// 22 | public static string ApiKey => ""; 23 | 24 | public static string DeploymentEmbeddingModel => "EmbeddingModel"; 25 | 26 | public static string YoutubeKey => ""; 27 | 28 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFunctionFactoryDemo/KernelFunctionFactoryDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/KernelFunctionFactoryDemo/Plugins/VehiclePlugin/VehiclePlugin.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SemanticKernel; 2 | using System.ComponentModel; 3 | namespace KernelFunctionFactoryDemo.Plugins.VehiclePlugin; 4 | 5 | public class VehiclePlugin 6 | { 7 | [KernelFunction, Description("find bike model information")] 8 | public string BikeInformation([Description("model of the bike")] string model) 9 | { 10 | return $"Bike Model: {model}, Color: Red, Year: 2022"; 11 | } 12 | 13 | [KernelFunction, Description("find car model information")] 14 | public string CarInformation([Description("model of the car")] string model) 15 | { 16 | return $"Car Model: {model}, Color: Blue, Year: 2023"; 17 | } 18 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelHooksDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace KernelHooksDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/KernelHooksDemo/KernelHooksDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/KernelHooksDemo/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelHooksDemo/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/KernelHooksDemo/TimingLogger.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace KernelHooksDemo; 4 | 5 | public class TimingLogger 6 | { 7 | private readonly Stopwatch stopwatch = new(); 8 | private long startTime = 0; 9 | private string functionName = string.Empty; 10 | 11 | public void Start(string name) 12 | { 13 | functionName = name; 14 | stopwatch.Reset(); 15 | startTime = GetCurrentTime(); 16 | stopwatch.Start(); 17 | } 18 | 19 | public void Stop() 20 | { 21 | stopwatch.Stop(); 22 | long elapsedTime = stopwatch.ElapsedMilliseconds; 23 | Console.ForegroundColor = ConsoleColor.DarkGreen; 24 | Console.WriteLine($"Function: {functionName}, Start Time: {startTime} ms, Stop Time: {GetCurrentTime()} ms, Elapsed Time: {elapsedTime} ms\n"); 25 | } 26 | 27 | private long GetCurrentTime() 28 | { 29 | return stopwatch.ElapsedMilliseconds; 30 | } 31 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelMemorySK/.NET.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvinothrajendran/MicrosoftSemanticKernelSamples/d35ba30fddfc880070bc1f17e9479d0611b4a4d0/SKSampleCSharp/KernelMemorySK/.NET.pdf -------------------------------------------------------------------------------- /SKSampleCSharp/KernelMemorySK/Config.cs: -------------------------------------------------------------------------------- 1 | namespace KernelMemorySK; 2 | 3 | /// 4 | /// Azure openai and Bing Keys 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI Deployment or Model Id 10 | /// 11 | public static string DeploymentOrModelId => "gpt4vision"; 12 | 13 | /// 14 | /// Azure OpenAI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI ApiKey 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | public static string DeploymentEmbeddingModel => "EmbeddingModel"; 24 | 25 | } -------------------------------------------------------------------------------- /SKSampleCSharp/KernelMemorySK/KernelMemorySK.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Always 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SKSampleCSharp/LiquidPromptDemo/GitConfig.cs: -------------------------------------------------------------------------------- 1 | namespace LiquidPromptDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class GitConfig 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string ModelId => "gpt-4o"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string GitHubToken => ""; 22 | 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/LiquidPromptDemo/LiquidPromptDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SKSampleCSharp/LocalLLMDemo/LocalLLMDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SKSampleCSharp/LocalLLMDemo/LocalServerClientHandler.cs: -------------------------------------------------------------------------------- 1 | namespace LocalLLMDemo; 2 | 3 | public class LocalServerClientHandler(string url) : HttpClientHandler 4 | { 5 | private readonly Uri uri = new(url); 6 | protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 7 | { 8 | request.RequestUri = uri; 9 | return base.SendAsync(request, cancellationToken); 10 | } 11 | } -------------------------------------------------------------------------------- /SKSampleCSharp/MemoryServerlessDemo/.NET.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvinothrajendran/MicrosoftSemanticKernelSamples/d35ba30fddfc880070bc1f17e9479d0611b4a4d0/SKSampleCSharp/MemoryServerlessDemo/.NET.pdf -------------------------------------------------------------------------------- /SKSampleCSharp/MemoryServerlessDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace MemoryServerlessDemo; 2 | 3 | /// 4 | /// Azure openai and Bing Keys 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI Deployment or Model Id 10 | /// 11 | public static string DeploymentOrModelId => "gpt4vision"; 12 | 13 | /// 14 | /// Azure OpenAI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI ApiKey 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | public static string DeploymentEmbeddingModel => "EmbeddingModel"; 24 | 25 | } -------------------------------------------------------------------------------- /SKSampleCSharp/MemoryServerlessDemo/MemoryServerlessDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SKSampleCSharp/NativePlugin/Config.cs: -------------------------------------------------------------------------------- 1 | namespace NativePlugin 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/NativePlugin/NativePlugin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SKSampleCSharp/NewFunctionCalling/AutoFunctionCalling.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/NewFunctionCalling/Config.cs: -------------------------------------------------------------------------------- 1 | namespace AutoFunctionCalling 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/NoneFunctionCalling/GitConfig.cs: -------------------------------------------------------------------------------- 1 | namespace NoneFunctionCalling 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class GitConfig 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string ModelId => "gpt-4o"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string GitHubToken => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/NoneFunctionCalling/NoneFunctionCalling.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/NoneFunctionCalling/Plugins/ExternalWeatherPlugin.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Microsoft.SemanticKernel; 3 | 4 | namespace NoneFunctionCalling.Plugins; 5 | 6 | public class ExternalWeatherPlugin 7 | { 8 | private readonly string apiKey = GitConfig.WeatherApiKey; 9 | private readonly HttpClient httpClient = new(); 10 | 11 | public static string GetWeather => "GetWeatherAsync"; 12 | 13 | [KernelFunction, Description("get weather information based on the location")] 14 | public string? GetWeatherAsync(string cityName) 15 | { 16 | 17 | var apiUrl = $"http://api.weatherapi.com/v1/current.json?key={apiKey}&q={cityName.ToString()}&aqi=no"; 18 | 19 | try 20 | { 21 | HttpResponseMessage response = httpClient.GetAsync(apiUrl).Result; 22 | response.EnsureSuccessStatusCode(); 23 | 24 | var responseBody = response.Content.ReadAsStringAsync().Result; 25 | 26 | return responseBody; 27 | } 28 | catch (HttpRequestException ex) 29 | { 30 | // Handle any exceptions here, such as network errors. 31 | Console.WriteLine($"Error: {ex.Message}"); 32 | return null; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /SKSampleCSharp/OpenAIAgent/Config.cs: -------------------------------------------------------------------------------- 1 | namespace OpenAIAgent 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI Model Name 10 | /// 11 | public static string ModelName => ""; 12 | 13 | /// 14 | /// Azure OpenAI Endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/OpenAIAgent/OpenAIAgent.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/Config.cs: -------------------------------------------------------------------------------- 1 | namespace InterruptPlanner 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/Filters/FunctionFilter.cs: -------------------------------------------------------------------------------- 1 | using InterruptPlanner.Watcher; 2 | using Microsoft.SemanticKernel; 3 | 4 | namespace InterruptPlanner.Filters; 5 | 6 | public class FunctionFilter(ITimingLogger functionTimingLogger, IScreenDisplay display) : IFunctionFilter 7 | { 8 | public void OnFunctionInvoked(FunctionInvokedContext context) 9 | { 10 | var functionHooks = $"Function Invoked(after) {context.Function.Name}"; 11 | display.WriteLine(functionHooks); 12 | 13 | functionTimingLogger.Stop(); 14 | } 15 | 16 | public void OnFunctionInvoking(FunctionInvokingContext context) 17 | { 18 | var functionHooks = $"Function Hooks - {context.Function.Name}"; 19 | functionTimingLogger.Start(functionHooks); 20 | 21 | functionHooks = $"Function Invoking(Before) {context.Function.Name}"; 22 | display.WriteLine(functionHooks); 23 | } 24 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/Filters/PromptFilter.cs: -------------------------------------------------------------------------------- 1 | using InterruptPlanner.Watcher; 2 | using Microsoft.SemanticKernel; 3 | 4 | namespace InterruptPlanner.Filters; 5 | 6 | public class PromptFilter(ITimingLogger promptTimingLogger, IScreenDisplay display) : IPromptFilter 7 | { 8 | public void OnPromptRendered(PromptRenderedContext context) 9 | { 10 | var promptHooks = $"Prompt Rendered(after) {context.Function.Name}"; 11 | display.WriteLine(promptHooks); 12 | promptTimingLogger.Stop(); 13 | } 14 | 15 | public void OnPromptRendering(PromptRenderingContext context) 16 | { 17 | var promptHooks = $"Prompt Hooks - {context.Function.Name}"; 18 | promptTimingLogger.Start(promptHooks); 19 | 20 | promptHooks = $"Prompt Rendering(Before) {context.Function.Name}"; 21 | display.WriteLine(promptHooks); 22 | } 23 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/InterruptPlanner.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 1701;1702;SKEXP0004; 13 | 14 | 15 | 16 | 1701;1702;SKEXP0004; 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Always 27 | 28 | 29 | Always 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/Watcher/ITimingLogger.cs: -------------------------------------------------------------------------------- 1 | namespace InterruptPlanner.Watcher; 2 | 3 | public interface ITimingLogger 4 | { 5 | void Start(string name); 6 | void Stop(); 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PluginKernelFilter/Watcher/TimingLogger.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace InterruptPlanner.Watcher; 4 | 5 | public class TimingLogger : ITimingLogger 6 | { 7 | private readonly Stopwatch stopwatch = new(); 8 | private long startTime = 0; 9 | private string functionName = string.Empty; 10 | 11 | public void Start(string name) 12 | { 13 | functionName = name; 14 | stopwatch.Reset(); 15 | startTime = GetCurrentTime(); 16 | stopwatch.Start(); 17 | } 18 | 19 | public void Stop() 20 | { 21 | stopwatch.Stop(); 22 | long elapsedTime = stopwatch.ElapsedMilliseconds; 23 | Console.ForegroundColor = ConsoleColor.DarkGreen; 24 | Console.WriteLine($"Function: {functionName}, Start Time: {startTime} ms, Stop Time: {GetCurrentTime()} ms, Elapsed Time: {elapsedTime} ms\n"); 25 | } 26 | 27 | private long GetCurrentTime() 28 | { 29 | return stopwatch.ElapsedMilliseconds; 30 | } 31 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PluginObject/Config.cs: -------------------------------------------------------------------------------- 1 | namespace PluginObject 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /SKSampleCSharp/PluginObject/PluginObject.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/ProcessSample/GitConfig.cs: -------------------------------------------------------------------------------- 1 | namespace ProcessLibSample 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class GitConfig 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string ModelId => "gpt-4o"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string GitHubToken => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SKSampleCSharp/ProcessSample/ProcessLibSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 1701;1702;SKEXP0080 12 | 13 | 14 | 15 | 1701;1702;SKEXP0080 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SKSampleCSharp/ProcessSample/Step1/IntroStep.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SemanticKernel; 2 | 3 | namespace ProcessLibSample.Step1; 4 | 5 | public class IntroStep : KernelProcessStep 6 | { 7 | [KernelFunction] 8 | public void WelcomeMessage() 9 | { 10 | Console.ForegroundColor = ConsoleColor.Blue; 11 | Console.WriteLine("Welcome to the ProcessLibBot!"); 12 | } 13 | } -------------------------------------------------------------------------------- /SKSampleCSharp/ProcessSample/Step2/QuestionAnswer.cs: -------------------------------------------------------------------------------- 1 | namespace ProcessLibSample.Step2; 2 | 3 | public class QuestionAnswer(string question, string answer) 4 | { 5 | private string _question = question; 6 | private string _answer = answer; 7 | 8 | public override string ToString() 9 | { 10 | return $"Question {_question} , Answer : {_answer}"; 11 | } 12 | } -------------------------------------------------------------------------------- /SKSampleCSharp/ProcessSample/Step2/QuizzesState.cs: -------------------------------------------------------------------------------- 1 | namespace ProcessLibSample.Step2; 2 | 3 | public class QuizzesState 4 | { 5 | public List Questions { get; set; } = new List(); 6 | 7 | public int CurrentIdx { get; set; } = 0; 8 | public int QuizCount { get; set; } 9 | } -------------------------------------------------------------------------------- /SKSampleCSharp/ProcessSample/Step3/LLMResponse.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.SemanticKernel; 3 | using Microsoft.SemanticKernel.ChatCompletion; 4 | 5 | namespace ProcessLibSample.Step3; 6 | 7 | public class LLMResponse : KernelProcessStep 8 | { 9 | 10 | [KernelFunction] 11 | public async Task GetLLMResponse(KernelProcessStepContext context,string message,Kernel kernel) 12 | { 13 | Console.ForegroundColor = ConsoleColor.Red; 14 | //Console.WriteLine($"The LLM response is : {count} "); 15 | 16 | var prompt = $"check the answer is correct or not based on the question {message}"; 17 | 18 | IChatCompletionService chatCompletionService = kernel.Services.GetRequiredService(); 19 | 20 | var result = await chatCompletionService.GetChatMessageContentsAsync(prompt); 21 | 22 | Console.WriteLine(result[0].Content); 23 | 24 | await context.EmitEventAsync(new KernelProcessEvent() 25 | { 26 | Id = StepEvent.StepEvents.GetLLMResponse 27 | 28 | }); 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /SKSampleCSharp/ProcessSample/StepEvent/StepEvents.cs: -------------------------------------------------------------------------------- 1 | namespace ProcessLibSample.StepEvent; 2 | 3 | public static class StepEvents 4 | { 5 | public static string StartProcess = "StartProcess"; 6 | public static string GetQuizzes = "GetQuizzes"; 7 | public static string GetLLMResponse = "GetLLMResponse"; 8 | public static string Exit = "Exit"; 9 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFilter/Config.cs: -------------------------------------------------------------------------------- 1 | namespace PromptFilter 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFilter/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFilter/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFilter/PromptFilter.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 1701;1702;SKEXP0001; 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Always 21 | 22 | 23 | Always 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFilter/PromptRenderFilter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SemanticKernel; 2 | 3 | namespace PromptFilter; 4 | 5 | public class PromptRenderFilter : IPromptRenderFilter 6 | { 7 | public async Task OnPromptRenderAsync(PromptRenderContext context, Func next) 8 | { 9 | Console.WriteLine($"{context.Function.PluginName}"); 10 | Console.WriteLine($"{context.Function.Name}"); 11 | 12 | await next(context); 13 | 14 | Console.ForegroundColor = ConsoleColor.Green; 15 | Console.WriteLine($"{context.RenderedPrompt}"); 16 | } 17 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFunction/Config.cs: -------------------------------------------------------------------------------- 1 | namespace PromptFunctionDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFunction/Plugins/location/city/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFunction/Plugins/location/city/skprompt.txt: -------------------------------------------------------------------------------- 1 | First find the city or location name in the given input {{$input}}. 2 | Once find the city or location name after that find the history information -------------------------------------------------------------------------------- /SKSampleCSharp/PromptFunction/PromptFunctionDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Always 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SKSampleCSharp/PromptYAMLDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace PromptYAMLDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SKSampleCSharp/PromptYAMLDemo/Plugins/Yaml/city.yaml: -------------------------------------------------------------------------------- 1 | name: city 2 | template: | 3 | First find the city or location name in the given input ```{{$input}}```.Once find the city or location name after that find the history information 4 | template_format: semantic-kernel 5 | description: find the history information of the city. 6 | input_variables: 7 | - name: input 8 | description: The user's request which contains city or location name. 9 | is_required: true 10 | output_variable: 11 | description: find the city and history information. 12 | 13 | execution_settings: 14 | default: 15 | temperature: 0.6 16 | max_tokens: 500 17 | 18 | -------------------------------------------------------------------------------- /SKSampleCSharp/PromptYAMLDemo/Plugins/location/city/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/PromptYAMLDemo/Plugins/location/city/skprompt.txt: -------------------------------------------------------------------------------- 1 | First find the city or location name in the given input {{$input}}. 2 | Once find the city or location name after that find the history information -------------------------------------------------------------------------------- /SKSampleCSharp/PromptYAMLDemo/PromptYAMLDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | Always 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SKSampleCSharp/RequiredFunctionCalling/GitConfig.cs: -------------------------------------------------------------------------------- 1 | namespace AutoFunctionCalling 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class GitConfig 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string ModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string GitHubToken => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/RequiredFunctionCalling/PromptRenderFilter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.SemanticKernel; 2 | 3 | namespace RequiredFunctionCalling; 4 | 5 | public class PromptRenderFilter : IPromptRenderFilter 6 | { 7 | public async Task OnPromptRenderAsync(PromptRenderContext context, Func next) 8 | { 9 | 10 | await next(context); 11 | 12 | Console.ForegroundColor = ConsoleColor.Green; 13 | 14 | context.RenderedPrompt += " include weather information also based on the city"; 15 | 16 | Console.WriteLine($"{context.RenderedPrompt}"); 17 | } 18 | } -------------------------------------------------------------------------------- /SKSampleCSharp/RequiredFunctionCalling/RequiredFunctionCalling.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /SKSampleCSharp/SKAgent/Config.cs: -------------------------------------------------------------------------------- 1 | namespace SKAgent 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/SKAgent/SKAgent.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SKSampleCSharp/SKFunctionCalling/Config.cs: -------------------------------------------------------------------------------- 1 | namespace SKFunctionCalling 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => ""; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/SKFunctionCalling/SKFunctionCalling.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SKSampleCSharp/StreamingDemo/Config.cs: -------------------------------------------------------------------------------- 1 | namespace StreamingDemo 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SKSampleCSharp/StreamingDemo/Plugins/Yaml/city.yaml: -------------------------------------------------------------------------------- 1 | name: city 2 | template: | 3 | First find the city or location name in the given input ```{{$input}}```.Once find the city or location name after that find the history information 4 | template_format: semantic-kernel 5 | description: find the history information of the city. 6 | input_variables: 7 | - name: input 8 | description: The user's request which contains city or location name. 9 | is_required: true 10 | output_variable: 11 | description: find the city and history information. 12 | 13 | execution_settings: 14 | default: 15 | temperature: 0.6 16 | max_tokens: 500 17 | 18 | -------------------------------------------------------------------------------- /SKSampleCSharp/StreamingDemo/Plugins/location/city/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/StreamingDemo/Plugins/location/city/skprompt.txt: -------------------------------------------------------------------------------- 1 | First find the city or location name in the given input {{$input}}. 2 | Once find the city or location name after that find the history information -------------------------------------------------------------------------------- /SKSampleCSharp/StreamingDemo/StreamingDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | Always 21 | 22 | 23 | Always 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SKSampleCSharp/TinyCopilot/Config.cs: -------------------------------------------------------------------------------- 1 | namespace TinyCopilot 2 | { 3 | /// 4 | /// Configurations for Azure OpenAI Chat Completion service 5 | /// 6 | public static class Config 7 | { 8 | /// 9 | /// Azure OpenAI deployment name 10 | /// 11 | public static string DeploymentOrModelId => "gpt4model"; 12 | 13 | /// 14 | /// Azure OpenAI endpoint 15 | /// 16 | public static string Endpoint => ""; 17 | 18 | /// 19 | /// Azure OpenAI Key 20 | /// 21 | public static string ApiKey => ""; 22 | 23 | /// 24 | /// External API key for weather service 25 | /// 26 | public static string WeatherApiKey => ""; 27 | 28 | /// 29 | /// Bing Map Key ( Create a Key in Azure Portal ) 30 | /// 31 | public static string BingMapKey => ""; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SKSampleCSharp/TinyCopilot/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/TinyCopilot/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/TinyCopilot/TinyCopilot.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | Always 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SKSampleCSharp/TinyCopilotGPT4VisionDemo/Plugins/location/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input_variables": [ 13 | { 14 | "name": "input", 15 | "description": "The user's request which contains city or location name.", 16 | "is_required": true, 17 | "default": "" 18 | } 19 | ] 20 | 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/TinyCopilotGPT4VisionDemo/Plugins/location/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Initially, identify the city or location name within the provided input {{$input}}. 2 | Once the city or location name is identified, proceed to retrieve historical information.history information need only for 2 lines -------------------------------------------------------------------------------- /SKSampleCSharp/TinyCopilotGPT4VisionDemo/TinyCopilotGPT4VisionDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Always 19 | 20 | 21 | Always 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/01HelloWorld/HelloWorld/ConfigParameters.cs: -------------------------------------------------------------------------------- 1 | namespace HelloWorld; 2 | 3 | public static class ConfigParameters 4 | { 5 | public static string ApiKey { get; } = ""; 6 | public static string Endpoint { get; } = ""; 7 | public static string DeploymentOrModelId { get; } = "text-davinci-003"; 8 | 9 | public static string EndpointType { get; } = "text-completion"; 10 | public static string ServiceType { get; } = "AZUREOPENAI"; 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/01HelloWorld/HelloWorld/HelloWorld.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/01HelloWorld/HelloWorld/HelloWorld.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.7.33913.275 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "HelloWorld.csproj", "{68B5A039-BD29-41AC-AE0C-2FC9DB4BDE9F}" 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 | {68B5A039-BD29-41AC-AE0C-2FC9DB4BDE9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {68B5A039-BD29-41AC-AE0C-2FC9DB4BDE9F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {68B5A039-BD29-41AC-AE0C-2FC9DB4BDE9F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {68B5A039-BD29-41AC-AE0C-2FC9DB4BDE9F}.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 = {FE36B326-1AF3-46C5-B286-D114DF010D6E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/02Plugin/SKWeatherPlugin/Program.cs: -------------------------------------------------------------------------------- 1 | using ConfigSettings; 2 | using Microsoft.SemanticKernel; 3 | using Microsoft.SemanticKernel.Orchestration; 4 | using SKWeatherPlugin.Plugins.Weather; 5 | 6 | namespace SKWeatherPlugin 7 | { 8 | internal class Program 9 | { 10 | static async Task Main(string[] args) 11 | { 12 | Console.WriteLine("Microsoft Semantic Kernel Plugin"); 13 | 14 | var kernel = new KernelBuilder().Build(); 15 | 16 | var weatherPlugin = kernel.ImportFunctions(new WeatherPlugin(ConfigParameters.WeatherApiKey), nameof(WeatherPlugin)); 17 | 18 | SKContext context = kernel.CreateNewContext(); 19 | context.Variables.Set("input", "chennai"); 20 | 21 | var report = await weatherPlugin["GetWeatherAsync"].InvokeAsync(context); 22 | 23 | Console.WriteLine(report.GetValue()); 24 | 25 | Console.ReadKey(); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/02Plugin/SKWeatherPlugin/SKWeatherPlugin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Exe 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/04Planner/SKWeatherPlugin/Plugins/History/HistoryPrompt/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "type": "completion", 4 | "description": "find the history information of the city", 5 | "completion": { 6 | "max_tokens": 500, 7 | "temperature": 0.0, 8 | "top_p": 0.0, 9 | "presence_penalty": 0.0, 10 | "frequency_penalty": 0.0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "The user's request which contains city or location name", 17 | "defaultValue": "" 18 | } 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/04Planner/SKWeatherPlugin/Plugins/History/HistoryPrompt/skprompt.txt: -------------------------------------------------------------------------------- 1 | First find the city or location name in the given input {{$input}}. 2 | Once find the city or location name after that find the history information -------------------------------------------------------------------------------- /SKSampleCSharp/archive/04Planner/SKWeatherPlugin/WeatherSKPlugin.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | $(NETVersion) 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Always 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/04Planner/SKWeatherPlugin/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "8.0.0", 4 | "rollForward": "latestMajor", 5 | "allowPrerelease": true 6 | } 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/.gitignore: -------------------------------------------------------------------------------- 1 | appsettings.json 2 | bin 3 | obj 4 | *.ini 5 | *.cache 6 | *.log 7 | *.tmp 8 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/config/EndpointTypes.cs: -------------------------------------------------------------------------------- 1 | internal static class EndpointTypes 2 | { 3 | internal const string TextCompletion = "text-completion"; 4 | internal const string ChatCompletion = "chat-completion"; 5 | } 6 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/config/ServiceTypes.cs: -------------------------------------------------------------------------------- 1 | internal static class ServiceTypes 2 | { 3 | internal const string OpenAI = "OPENAI"; 4 | internal const string AzureOpenAI = "AZUREOPENAI"; 5 | } 6 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/config/appsettings.json.azure-example: -------------------------------------------------------------------------------- 1 | { 2 | "endpointType": "text-completion", 3 | "serviceType": "AzureOpenAI", 4 | "serviceId": "text-davinci-003", 5 | "deploymentOrModelId": "text-davinci-003", 6 | "endpoint": "https:// ... your endpoint ... .openai.azure.com/", 7 | "apiKey": "... your Azure OpenAI key ..." 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/config/appsettings.json.openai-example: -------------------------------------------------------------------------------- 1 | { 2 | "endpointType": "text-completion", 3 | "serviceType": "OpenAI", 4 | "serviceId": "text-davinci-003", 5 | "deploymentOrModelId": "text-davinci-003", 6 | "apiKey": "... your OpenAI key ...", 7 | "orgId": "" 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/skills/FunSkill/Excuses/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Turn a scenario into a creative or humorous excuse to send your boss", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 60, 7 | "temperature": 0.5, 8 | "top_p": 0, 9 | "presence_penalty": 0, 10 | "frequency_penalty": 0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "The event to generate an excuse for", 17 | "defaultValue": "" 18 | } 19 | ] 20 | } 21 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/skills/FunSkill/Excuses/skprompt.txt: -------------------------------------------------------------------------------- 1 | Generate a creative reason or excuse for the given event. Be creative and be funny. Let your imagination run wild. 2 | 3 | Event:I am running late. 4 | Excuse:I was being held ransom by giraffe gangsters. 5 | 6 | Event:{{$input}} -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/skills/FunSkill/Joke/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Generate a funny joke", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 1000, 7 | "temperature": 0.9, 8 | "top_p": 0, 9 | "presence_penalty": 0, 10 | "frequency_penalty": 0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "input", 16 | "description": "The subject of the joke", 17 | "defaultValue": "" 18 | }, 19 | { 20 | "name": "style", 21 | "description": "The style of the joke", 22 | "defaultValue": "" 23 | } 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/skills/FunSkill/Joke/skprompt.txt: -------------------------------------------------------------------------------- 1 | WRITE EXACTLY ONE JOKE or HUMOROUS STORY ABOUT THE TOPIC BELOW 2 | 3 | JOKE MUST BE: 4 | - G RATED 5 | - WORKPLACE/FAMILY SAFE 6 | NO SEXISM, RACISM OR OTHER BIAS/BIGOTRY 7 | 8 | BE CREATIVE AND FUNNY. I WANT TO LAUGH. 9 | {{$style}} 10 | +++++ 11 | 12 | {{$input}} 13 | +++++ 14 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/skills/FunSkill/Limerick/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Generate a funny limerick about a person", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 100, 7 | "temperature": 0.7, 8 | "top_p": 0, 9 | "presence_penalty": 0, 10 | "frequency_penalty": 0 11 | }, 12 | "input": { 13 | "parameters": [ 14 | { 15 | "name": "name", 16 | "description": "The name of the person who the Limerick is about", 17 | "defaultValue": "" 18 | }, 19 | { 20 | "name": "input", 21 | "description": "The theme of the Limerick", 22 | "defaultValue": "" 23 | } 24 | ] 25 | } 26 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/05HelloVSCode/sk-csharp-hello-world/skills/FunSkill/Limerick/skprompt.txt: -------------------------------------------------------------------------------- 1 | There was a young woman named Bright, 2 | Whose speed was much faster than light. 3 | She set out one day, 4 | In a relative way, 5 | And returned on the previous night. 6 | 7 | There was an odd fellow named Gus, 8 | When traveling he made such a fuss. 9 | He was banned from the train, 10 | Not allowed on a plane, 11 | And now travels only by bus. 12 | 13 | There once was a man from Tibet, 14 | Who couldn't find a cigarette 15 | So he smoked all his socks, 16 | and got chicken-pox, 17 | and had to go to the vet. 18 | 19 | There once was a boy named Dan, 20 | who wanted to fry in a pan. 21 | He tried and he tried, 22 | and eventually died, 23 | that weird little boy named Dan. 24 | 25 | Now write a very funny limerick about {{$name}}. 26 | {{$input}} 27 | Invent new facts their life. Must be funny. 28 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/06SemanticFunction/sk-csharp-hello-world/.gitignore: -------------------------------------------------------------------------------- 1 | appsettings.json 2 | bin 3 | obj 4 | *.ini 5 | *.cache 6 | *.log 7 | *.tmp 8 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/06SemanticFunction/sk-csharp-hello-world/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using Microsoft.SemanticKernel; 3 | using Microsoft.SemanticKernel.AI.ChatCompletion; 4 | using Microsoft.SemanticKernel.Orchestration; 5 | 6 | var kernelSettings = KernelSettings.LoadSettings(); 7 | 8 | using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => 9 | { 10 | builder 11 | .SetMinimumLevel(kernelSettings.LogLevel ?? LogLevel.Warning) 12 | .AddConsole() 13 | .AddDebug(); 14 | }); 15 | 16 | IKernel kernel = new KernelBuilder() 17 | .WithCompletionService(kernelSettings) 18 | .Build(); 19 | 20 | if (kernelSettings.EndpointType == EndpointTypes.TextCompletion) 21 | { 22 | // note: using skills from the repo 23 | var skillsDirectory = Path.Combine(System.IO.Directory.GetCurrentDirectory(), "skills"); 24 | var skill = kernel.ImportSemanticSkillFromDirectory(skillsDirectory, "citySkill"); 25 | 26 | var context = new ContextVariables(); 27 | context.Set("input", "I plan to visit Paris"); 28 | 29 | var result = await kernel.RunAsync(context, skill["history"]); 30 | Console.WriteLine(result); 31 | } 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/06SemanticFunction/sk-csharp-hello-world/config/EndpointTypes.cs: -------------------------------------------------------------------------------- 1 | internal static class EndpointTypes 2 | { 3 | internal const string TextCompletion = "text-completion"; 4 | internal const string ChatCompletion = "chat-completion"; 5 | } 6 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/06SemanticFunction/sk-csharp-hello-world/config/ServiceTypes.cs: -------------------------------------------------------------------------------- 1 | internal static class ServiceTypes 2 | { 3 | internal const string OpenAI = "OPENAI"; 4 | internal const string AzureOpenAI = "AZUREOPENAI"; 5 | } 6 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/06SemanticFunction/sk-csharp-hello-world/config/appsettings.json.openai-example: -------------------------------------------------------------------------------- 1 | { 2 | "endpointType": "text-completion", 3 | "serviceType": "OpenAI", 4 | "serviceId": "text-davinci-003", 5 | "deploymentOrModelId": "text-davinci-003", 6 | "apiKey": "... your OpenAI key ...", 7 | "orgId": "" 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/06SemanticFunction/sk-csharp-hello-world/skills/CitySkill/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Find the city or location", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 50 7 | }, 8 | "input": { 9 | "parameters": [ 10 | { 11 | "name": "input", 12 | "description": "This input provided by user", 13 | "defaultValue": "" 14 | } 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/06SemanticFunction/sk-csharp-hello-world/skills/CitySkill/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Locate the city or loation name within the provided text : {{$input}} 2 | and provide the city's name along with a brief history, limited to two line,in JSON format like this: 3 | 4 | example 5 | { 6 | "cityname": "CityNameHere", 7 | "history": "Brief history of the city." 8 | } 9 | ``` -------------------------------------------------------------------------------- /SKSampleCSharp/archive/07Chainingfunctions/Chaining/.gitignore: -------------------------------------------------------------------------------- 1 | appsettings.json 2 | bin 3 | obj 4 | *.ini 5 | *.cache 6 | *.log 7 | *.tmp 8 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/07Chainingfunctions/Chaining/config/EndpointTypes.cs: -------------------------------------------------------------------------------- 1 | internal static class EndpointTypes 2 | { 3 | internal const string TextCompletion = "text-completion"; 4 | internal const string ChatCompletion = "chat-completion"; 5 | } 6 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/07Chainingfunctions/Chaining/config/ServiceTypes.cs: -------------------------------------------------------------------------------- 1 | internal static class ServiceTypes 2 | { 3 | internal const string OpenAI = "OPENAI"; 4 | internal const string AzureOpenAI = "AZUREOPENAI"; 5 | } 6 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/07Chainingfunctions/Chaining/config/appsettings.json.openai-example: -------------------------------------------------------------------------------- 1 | { 2 | "endpointType": "text-completion", 3 | "serviceType": "OpenAI", 4 | "serviceId": "text-davinci-003", 5 | "deploymentOrModelId": "text-davinci-003", 6 | "apiKey": "... your OpenAI key ...", 7 | "orgId": "" 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/07Chainingfunctions/Chaining/skills/CitySkill/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Find the city or location", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 50 7 | }, 8 | "input": { 9 | "parameters": [ 10 | { 11 | "name": "input", 12 | "description": "This input provided by user", 13 | "defaultValue": "" 14 | } 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/07Chainingfunctions/Chaining/skills/CitySkill/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Locate the city or loation name within the provided text : {{$input}} 2 | and provide the city's name along with a brief history, limited to two line,in JSON format like this: 3 | 4 | example 5 | { 6 | "cityname": "CityNameHere", 7 | "history": "Brief history of the city." 8 | } 9 | ``` -------------------------------------------------------------------------------- /SKSampleCSharp/archive/07Chainingfunctions/Chaining/skills/Json/ExtractJson.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Microsoft.SemanticKernel; 3 | using Microsoft.SemanticKernel.Orchestration; 4 | using Newtonsoft.Json.Linq; 5 | 6 | namespace skills.Json; 7 | 8 | public class ExtractJson 9 | { 10 | 11 | [SKFunction, Description("Extract information from the JSON")] 12 | public SKContext? ExtractInformation(SKContext? context) 13 | { 14 | if (context == null) 15 | throw new ArgumentNullException(nameof(context)); 16 | 17 | context.Variables.TryGetValue("inoput", out var inputValue); 18 | 19 | JObject jsonJObject = JObject.Parse(inputValue); 20 | 21 | if (jsonJObject.TryGetValue("cityname", out var city)) 22 | { 23 | context.Variables.Set("input", city.ToString()); 24 | } 25 | 26 | if (jsonJObject.TryGetValue("history", out var histpory)) 27 | { 28 | context.Variables.Set("history", city.ToString()); 29 | } 30 | 31 | return context; 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/08SpeechDemo/SpeechDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | $(NETVersion) 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/09FunctionHooks/FunctionHooks.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net7.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | PreserveNewest 18 | 19 | 20 | PreserveNewest 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/09FunctionHooks/Settings.cs: -------------------------------------------------------------------------------- 1 | namespace FunctionHooks 2 | { 3 | public static class Settings 4 | { 5 | public static string Endpoint => ""; 6 | public static string ApiKey => ""; 7 | public static string DeploymentOrModelId => ""; 8 | public static string WeatherApiKey => ""; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/09FunctionHooks/skills/CitySkill/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Find the city or location", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 100 7 | }, 8 | "input": { 9 | "parameters": [ 10 | { 11 | "name": "input", 12 | "description": "This input provided by user", 13 | "defaultValue": "" 14 | } 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/09FunctionHooks/skills/CitySkill/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Locate the city or loation name within the provided text : {{$input}} 2 | and provide the city's name along with a brief history, limited to two line,in JSON format like this: 3 | 4 | example 5 | { 6 | "cityname": "CityNameHere", 7 | "history": "Brief history of the city." 8 | } 9 | 10 | Dont need to add any extra information, just the city name and history. 11 | 12 | 13 | ``` -------------------------------------------------------------------------------- /SKSampleCSharp/archive/09FunctionHooks/skills/Json/ExtractJson.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Microsoft.SemanticKernel; 3 | using Microsoft.SemanticKernel.Orchestration; 4 | using Newtonsoft.Json.Linq; 5 | 6 | namespace FunctionHooks.skills.Json; 7 | 8 | public class ExtractJson 9 | { 10 | 11 | [SKFunction, Description("Extract information from the JSON")] 12 | public SKContext? ExtractInformation(SKContext? context) 13 | { 14 | if (context == null) 15 | throw new ArgumentNullException(nameof(context)); 16 | 17 | context.Variables.TryGetValue("INPUT", out var inputValue); 18 | 19 | JObject jsonJObject = JObject.Parse(inputValue); 20 | 21 | if (jsonJObject.TryGetValue("cityname", out var city)) 22 | { 23 | context.Variables.Set("input", city.ToString()); 24 | } 25 | 26 | if (jsonJObject.TryGetValue("history", out var histpory)) 27 | { 28 | context.Variables.Set("history", city.ToString()); 29 | } 30 | 31 | return context; 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/BotWithSK.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Always 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "azureBotId": { 6 | "value": "" 7 | }, 8 | "azureBotSku": { 9 | "value": "S1" 10 | }, 11 | "azureBotRegion": { 12 | "value": "global" 13 | }, 14 | "botEndpoint": { 15 | "value": "" 16 | }, 17 | "appType": { 18 | "value": "MultiTenant" 19 | }, 20 | "appId": { 21 | "value": "" 22 | }, 23 | "UMSIName": { 24 | "value": "" 25 | }, 26 | "UMSIResourceGroupName": { 27 | "value": "" 28 | }, 29 | "tenantId": { 30 | "value": "" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "appServiceName": { 6 | "value": "" 7 | }, 8 | "existingAppServicePlanName": { 9 | "value": "" 10 | }, 11 | "existingAppServicePlanLocation": { 12 | "value": "" 13 | }, 14 | "newAppServicePlanName": { 15 | "value": "" 16 | }, 17 | "newAppServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "newAppServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "azureBotId": { 12 | "value": "" 13 | }, 14 | "azureBotSku": { 15 | "value": "S1" 16 | }, 17 | "azureBotRegion": { 18 | "value": "global" 19 | }, 20 | "botEndpoint": { 21 | "value": "" 22 | }, 23 | "appType": { 24 | "value": "MultiTenant" 25 | }, 26 | "appId": { 27 | "value": "" 28 | }, 29 | "UMSIName": { 30 | "value": "" 31 | }, 32 | "UMSIResourceGroupName": { 33 | "value": "" 34 | }, 35 | "tenantId": { 36 | "value": "" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "appServiceName": { 12 | "value": "" 13 | }, 14 | "appServicePlanName": { 15 | "value": "" 16 | }, 17 | "appServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "appServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.18.1 5 | 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Hosting; 8 | 9 | namespace BotWithSK 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | CreateHostBuilder(args).Build().Run(); 16 | } 17 | 18 | public static IHostBuilder CreateHostBuilder(string[] args) => 19 | Host.CreateDefaultBuilder(args) 20 | .ConfigureWebHostDefaults(webBuilder => 21 | { 22 | webBuilder.UseStartup(); 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:3978", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "EchoBot": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:3979;http://localhost:3978", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/BotWithSK/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MicrosoftAppType": "", 3 | "MicrosoftAppId": "", 4 | "MicrosoftAppPassword": "", 5 | "MicrosoftAppTenantId": "" 6 | } 7 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/Plugins/CitySkill/history/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": 1, 3 | "description": "Find the city or location", 4 | "type": "completion", 5 | "completion": { 6 | "max_tokens": 100 7 | }, 8 | "input": { 9 | "parameters": [ 10 | { 11 | "name": "input", 12 | "description": "This input provided by user", 13 | "defaultValue": "" 14 | } 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/Plugins/CitySkill/history/skprompt.txt: -------------------------------------------------------------------------------- 1 | Locate the city or loation name within the provided text : {{$input}} 2 | and provide the city's name along with a brief history, limited to two line,in JSON format like this: 3 | and dont add any extra spaces or new lines in the JSON format. 4 | 5 | example 6 | { 7 | "cityname": "CityNameHere", 8 | "history": "Brief history of the city." 9 | } 10 | 11 | ``` -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/Plugins/Json/ExtractJson.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using Microsoft.SemanticKernel; 3 | using Microsoft.SemanticKernel.Orchestration; 4 | using Newtonsoft.Json.Linq; 5 | 6 | namespace SKConnector.Plugins.Json; 7 | 8 | public class ExtractJson 9 | { 10 | 11 | [SKFunction, Description("Extract information from the JSON")] 12 | public SKContext? ExtractInformation(SKContext? context) 13 | { 14 | if (context == null) 15 | throw new ArgumentNullException(nameof(context)); 16 | 17 | context.Variables.TryGetValue("input", out var inputValue); 18 | 19 | JObject jsonJObject = JObject.Parse(inputValue); 20 | 21 | if (jsonJObject.TryGetValue("cityname", out var city)) 22 | { 23 | context.Variables.Set("input", city.ToString()); 24 | } 25 | 26 | if (jsonJObject.TryGetValue("history", out var histpory)) 27 | { 28 | context.Variables.Set("history", city.ToString()); 29 | } 30 | 31 | return context; 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/SKConnector.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Always 21 | 22 | 23 | 24 | 25 | 26 | Always 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/Settings.cs: -------------------------------------------------------------------------------- 1 | using SKConnector.config; 2 | 3 | namespace SKConnector; 4 | 5 | public static class Settings 6 | { 7 | public static string ServiceType => ServiceTypes.AzureOpenAI; 8 | public static string EndpointType => EndpointTypes.TextCompletion; 9 | public static string ServiceId => string.Empty; 10 | public static string DeploymentOrModelId => "gpt4model"; 11 | public static string Endpoint => ""; 12 | public static string ApiKey => ""; 13 | 14 | public static string WeatherApiKey => ""; 15 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/config/EndpointTypes.cs: -------------------------------------------------------------------------------- 1 | namespace SKConnector.config; 2 | 3 | internal static class EndpointTypes 4 | { 5 | internal const string TextCompletion = "text-completion"; 6 | internal const string ChatCompletion = "chat-completion"; 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/config/ServiceTypes.cs: -------------------------------------------------------------------------------- 1 | namespace SKConnector.config; 2 | 3 | internal static class ServiceTypes 4 | { 5 | internal const string OpenAI = "OPENAI"; 6 | internal const string AzureOpenAI = "AZUREOPENAI"; 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/10SKInBot/SKConnector/config/appsettings.json.openai-example: -------------------------------------------------------------------------------- 1 | { 2 | "endpointType": "text-completion", 3 | "serviceType": "OpenAI", 4 | "serviceId": "text-davinci-003", 5 | "deploymentOrModelId": "text-davinci-003", 6 | "apiKey": "... your OpenAI key ...", 7 | "orgId": "" 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "azureBotId": { 6 | "value": "" 7 | }, 8 | "azureBotSku": { 9 | "value": "S1" 10 | }, 11 | "azureBotRegion": { 12 | "value": "global" 13 | }, 14 | "botEndpoint": { 15 | "value": "" 16 | }, 17 | "appType": { 18 | "value": "MultiTenant" 19 | }, 20 | "appId": { 21 | "value": "" 22 | }, 23 | "UMSIName": { 24 | "value": "" 25 | }, 26 | "UMSIResourceGroupName": { 27 | "value": "" 28 | }, 29 | "tenantId": { 30 | "value": "" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "appServiceName": { 6 | "value": "" 7 | }, 8 | "existingAppServicePlanName": { 9 | "value": "" 10 | }, 11 | "existingAppServicePlanLocation": { 12 | "value": "" 13 | }, 14 | "newAppServicePlanName": { 15 | "value": "" 16 | }, 17 | "newAppServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "newAppServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "azureBotId": { 12 | "value": "" 13 | }, 14 | "azureBotSku": { 15 | "value": "S1" 16 | }, 17 | "azureBotRegion": { 18 | "value": "global" 19 | }, 20 | "botEndpoint": { 21 | "value": "" 22 | }, 23 | "appType": { 24 | "value": "MultiTenant" 25 | }, 26 | "appId": { 27 | "value": "" 28 | }, 29 | "UMSIName": { 30 | "value": "" 31 | }, 32 | "UMSIResourceGroupName": { 33 | "value": "" 34 | }, 35 | "tenantId": { 36 | "value": "" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "appServiceName": { 12 | "value": "" 13 | }, 14 | "appServicePlanName": { 15 | "value": "" 16 | }, 17 | "appServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "appServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/MovieTemplate/BookingOutput.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TemplateBot.Dialogs.MovieTemplate; 4 | 5 | public class BookingOutput 6 | { 7 | public string Text { get; set; } 8 | public Intent Intent { get; set; } 9 | public List Entities { get; set; } 10 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/MovieTemplate/BookingTemplate.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.MovieTemplate; 2 | 3 | class BookingTemplate 4 | { 5 | 6 | public string Input { get; set; } 7 | public BookingOutput Output { get; set; } 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/MovieTemplate/Entity.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.MovieTemplate; 2 | 3 | public class EntityList 4 | { 5 | public string Entity { get; set; } 6 | public string Type { get; set; } 7 | public int StartPos { get; set; } 8 | public int EndPos { get; set; } 9 | public string Value { get; set; } 10 | public int Size { get; set; } 11 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/MovieTemplate/Intent.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.MovieTemplate; 2 | 3 | public class Intent 4 | { 5 | public string Name { get; set; } 6 | public double Score { get; set; } 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/PizzaTemplate/Entities.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.Template; 2 | 3 | public class Entities 4 | { 5 | public string Entity { get; set; } 6 | public string Type { get; set; } 7 | public int StartPos { get; set; } 8 | public int EndPos { get; set; } 9 | public string Value { get; set; } 10 | public string Size { get; set; } 11 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/PizzaTemplate/Intent.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.Template; 2 | 3 | public class Intent 4 | { 5 | public string Name { get; set; } 6 | public double Score { get; set; } 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/PizzaTemplate/Order.cs: -------------------------------------------------------------------------------- 1 | using TemplateBot.Dialogs.Template; 2 | 3 | namespace TemplateBot.Dialogs.PizzaTemplate; 4 | 5 | public class Order 6 | { 7 | public string Input { get; set; } 8 | public Output Output { get; set; } 9 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/PizzaTemplate/Output.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TemplateBot.Dialogs.Template; 4 | 5 | public class Output 6 | { 7 | public string Text { get; set; } 8 | public Intent Intent { get; set; } 9 | public List Entities { get; set; } 10 | 11 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/PizzaTemplate/Pizza.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TemplateBot.Dialogs.PizzaTemplate; 4 | 5 | public class Pizza 6 | { 7 | public List Orders { get; set; } 8 | public List ReOrder { get; set; } 9 | public List CancelOrder { get; set; } 10 | 11 | public List Unknown { get; set; } 12 | 13 | private int count = 0; 14 | public int TotalCount 15 | { 16 | get 17 | { 18 | count = Orders?.Count ?? 0; 19 | count += ReOrder?.Count ?? 0; 20 | count += CancelOrder?.Count ?? 0; 21 | count += Unknown?.Count ?? 0; 22 | return count; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Dialogs/Settings.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs; 2 | 3 | public static class Settings 4 | { 5 | public static string EndPoint => ""; 6 | public static string Key => ""; 7 | public static string DeploymentName => ""; 8 | 9 | public static string YouTubeKey = ""; 10 | public static string YouTubeChannelId = ""; 11 | 12 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/EmptyBot.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.Bot.Builder; 5 | using Microsoft.Bot.Schema; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace TemplateBot 11 | { 12 | public class EmptyBot : ActivityHandler 13 | { 14 | protected override async Task OnMembersAddedAsync(IList membersAdded, ITurnContext turnContext, CancellationToken cancellationToken) 15 | { 16 | foreach (var member in membersAdded) 17 | { 18 | if (member.Id != turnContext.Activity.Recipient.Id) 19 | { 20 | await turnContext.SendActivityAsync(MessageFactory.Text($"Hello world!"), cancellationToken); 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/IntentBot.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EmptyBot v4.18.1 5 | 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Hosting; 8 | 9 | namespace TemplateBot 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | CreateHostBuilder(args).Build().Run(); 16 | } 17 | 18 | public static IHostBuilder CreateHostBuilder(string[] args) => 19 | Host.CreateDefaultBuilder(args) 20 | .ConfigureWebHostDefaults(webBuilder => 21 | { 22 | webBuilder.UseStartup(); 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:3978", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "$safeprojectname$": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:3979;http://localhost:3978", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/TemplateBot.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34212.112 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TemplateBot", "TemplateBot.csproj", "{845583D7-4D70-4CEE-8BE1-3336C010476F}" 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 | {845583D7-4D70-4CEE-8BE1-3336C010476F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {845583D7-4D70-4CEE-8BE1-3336C010476F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {845583D7-4D70-4CEE-8BE1-3336C010476F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {845583D7-4D70-4CEE-8BE1-3336C010476F}.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 = {49BF7C35-C0A1-495D-84F6-FB78ED1EB548} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/13-14-IntentBot/IntentBot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MicrosoftAppType": "", 3 | "MicrosoftAppId": "", 4 | "MicrosoftAppPassword": "", 5 | "MicrosoftAppTenantId": "" 6 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-AzureBot-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "azureBotId": { 6 | "value": "" 7 | }, 8 | "azureBotSku": { 9 | "value": "S1" 10 | }, 11 | "azureBotRegion": { 12 | "value": "global" 13 | }, 14 | "botEndpoint": { 15 | "value": "" 16 | }, 17 | "appType": { 18 | "value": "MultiTenant" 19 | }, 20 | "appId": { 21 | "value": "" 22 | }, 23 | "UMSIName": { 24 | "value": "" 25 | }, 26 | "UMSIResourceGroupName": { 27 | "value": "" 28 | }, 29 | "tenantId": { 30 | "value": "" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/DeploymentTemplates/DeployUseExistResourceGroup/parameters-for-template-BotApp-with-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "appServiceName": { 6 | "value": "" 7 | }, 8 | "existingAppServicePlanName": { 9 | "value": "" 10 | }, 11 | "existingAppServicePlanLocation": { 12 | "value": "" 13 | }, 14 | "newAppServicePlanName": { 15 | "value": "" 16 | }, 17 | "newAppServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "newAppServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-AzureBot-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "azureBotId": { 12 | "value": "" 13 | }, 14 | "azureBotSku": { 15 | "value": "S1" 16 | }, 17 | "azureBotRegion": { 18 | "value": "global" 19 | }, 20 | "botEndpoint": { 21 | "value": "" 22 | }, 23 | "appType": { 24 | "value": "MultiTenant" 25 | }, 26 | "appId": { 27 | "value": "" 28 | }, 29 | "UMSIName": { 30 | "value": "" 31 | }, 32 | "UMSIResourceGroupName": { 33 | "value": "" 34 | }, 35 | "tenantId": { 36 | "value": "" 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/DeploymentTemplates/DeployWithNewResourceGroup/parameters-for-template-BotApp-new-rg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "groupName": { 6 | "value": "" 7 | }, 8 | "groupLocation": { 9 | "value": "" 10 | }, 11 | "appServiceName": { 12 | "value": "" 13 | }, 14 | "appServicePlanName": { 15 | "value": "" 16 | }, 17 | "appServicePlanLocation": { 18 | "value": "" 19 | }, 20 | "appServicePlanSku": { 21 | "value": { 22 | "name": "S1", 23 | "tier": "Standard", 24 | "size": "S1", 25 | "family": "S", 26 | "capacity": 1 27 | } 28 | }, 29 | "appType": { 30 | "value": "MultiTenant" 31 | }, 32 | "appId": { 33 | "value": "" 34 | }, 35 | "appSecret": { 36 | "value": "" 37 | }, 38 | "UMSIName": { 39 | "value": "" 40 | }, 41 | "UMSIResourceGroupName": { 42 | "value": "" 43 | }, 44 | "tenantId": { 45 | "value": "" 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/MovieTemplate/BookingOutput.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using TemplateBot.Dialogs.Template; 3 | 4 | namespace TemplateBot.Dialogs.MovieTemplate; 5 | 6 | public class BookingResult 7 | { 8 | public string Input { get; set; } 9 | public BookingOutput Output { get; set; } 10 | public List YouTubeLinks { get; set; } 11 | } 12 | 13 | public class BookingOutput 14 | { 15 | public string Text { get; set; } 16 | public Intent Intent { get; set; } 17 | public List Entities { get; set; } 18 | } 19 | 20 | public class Entity 21 | { 22 | public string Type { get; set; } 23 | public string Value { get; set; } 24 | } 25 | 26 | public class MovieData 27 | { 28 | public string Intent { get; set; } 29 | public List Entities { get; set; } 30 | public List YouTubeLinks { get; set; } 31 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/MovieTemplate/BookingTemplate.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.MovieTemplate; 2 | 3 | class BookingTemplate 4 | { 5 | 6 | public string Input { get; set; } 7 | public BookingOutput Output { get; set; } 8 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/MovieTemplate/Entity.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.MovieTemplate; 2 | 3 | public class EntityList 4 | { 5 | public string Entity { get; set; } 6 | public string Type { get; set; } 7 | public int StartPos { get; set; } 8 | public int EndPos { get; set; } 9 | public string Value { get; set; } 10 | public int Size { get; set; } 11 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/MovieTemplate/Intent.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.MovieTemplate; 2 | 3 | public class Intent 4 | { 5 | public string Name { get; set; } 6 | public double Score { get; set; } 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/PizzaTemplate/Entities.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.Template; 2 | 3 | public class Entities 4 | { 5 | public string Entity { get; set; } 6 | public string Type { get; set; } 7 | public int StartPos { get; set; } 8 | public int EndPos { get; set; } 9 | public string Value { get; set; } 10 | public string Size { get; set; } 11 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/PizzaTemplate/Intent.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs.Template; 2 | 3 | public class Intent 4 | { 5 | public string Name { get; set; } 6 | public double Score { get; set; } 7 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/PizzaTemplate/Order.cs: -------------------------------------------------------------------------------- 1 | using TemplateBot.Dialogs.Template; 2 | 3 | namespace TemplateBot.Dialogs.PizzaTemplate; 4 | 5 | public class Order 6 | { 7 | public string Input { get; set; } 8 | public Output Output { get; set; } 9 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/PizzaTemplate/Output.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TemplateBot.Dialogs.Template; 4 | 5 | public class Output 6 | { 7 | public string Text { get; set; } 8 | public Intent Intent { get; set; } 9 | public List Entities { get; set; } 10 | 11 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/PizzaTemplate/Pizza.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace TemplateBot.Dialogs.PizzaTemplate; 4 | 5 | public class Pizza 6 | { 7 | public List Orders { get; set; } 8 | public List ReOrder { get; set; } 9 | public List CancelOrder { get; set; } 10 | 11 | public List Unknown { get; set; } 12 | 13 | private int count = 0; 14 | public int TotalCount 15 | { 16 | get 17 | { 18 | count = Orders?.Count ?? 0; 19 | count += ReOrder?.Count ?? 0; 20 | count += CancelOrder?.Count ?? 0; 21 | count += Unknown?.Count ?? 0; 22 | return count; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Dialogs/Settings.cs: -------------------------------------------------------------------------------- 1 | namespace TemplateBot.Dialogs; 2 | 3 | public static class Settings 4 | { 5 | public static string EndPoint => ""; 6 | public static string Key => ""; 7 | public static string DeploymentName => "gpt4model"; 8 | 9 | public static string YouTubeKey = ""; 10 | public static string YouTubeChannelId = ""; 11 | 12 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/EmptyBot.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.Bot.Builder; 5 | using Microsoft.Bot.Schema; 6 | using System.Collections.Generic; 7 | using System.Threading; 8 | using System.Threading.Tasks; 9 | 10 | namespace TemplateBot 11 | { 12 | public class EmptyBot : ActivityHandler 13 | { 14 | protected override async Task OnMembersAddedAsync(IList membersAdded, ITurnContext turnContext, CancellationToken cancellationToken) 15 | { 16 | foreach (var member in membersAdded) 17 | { 18 | if (member.Id != turnContext.Activity.Recipient.Id) 19 | { 20 | await turnContext.SendActivityAsync(MessageFactory.Text($"Hello world!"), cancellationToken); 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EmptyBot v4.18.1 5 | 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.Extensions.Hosting; 8 | 9 | namespace TemplateBot 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | CreateHostBuilder(args).Build().Run(); 16 | } 17 | 18 | public static IHostBuilder CreateHostBuilder(string[] args) => 19 | Host.CreateDefaultBuilder(args) 20 | .ConfigureWebHostDefaults(webBuilder => 21 | { 22 | webBuilder.UseStartup(); 23 | }); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:3978", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "$safeprojectname$": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:3979;http://localhost:3978", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/15StepwisePLanner/TemplateBot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MicrosoftAppType": "", 3 | "MicrosoftAppId": "", 4 | "MicrosoftAppPassword": "", 5 | "MicrosoftAppTenantId": "" 6 | } -------------------------------------------------------------------------------- /SKSampleCSharp/archive/Commonlib/library.shared.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | 1.0.0-beta2 6 | 7 | 8 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/Settings/ConfigSettings/ConfigParameters.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigSettings; 2 | 3 | public static class ConfigParameters 4 | { 5 | public static string ApiKey { get; } = ""; 6 | public static string Endpoint { get; } = ""; 7 | public static string DeploymentOrModelId { get; } = "text-davinci-003"; 8 | 9 | public static string EndpointType { get; } = "text-completion"; 10 | public static string ServiceType { get; } = "AZUREOPENAI"; 11 | 12 | public static string WeatherApiKey { get; } = ""; 13 | 14 | 15 | public static string SpeechKey = ""; 16 | public static string SpeechRegion = ""; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /SKSampleCSharp/archive/Settings/ConfigSettings/ConfigSettings.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(NETVersion) 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /SKVersion2/AgentOrchestration/ConcurrentPattern/ConcurrentPattern.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SKVersion2/AgentOrchestration/GroupPattern/GroupPattern.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SKVersion2/AgentOrchestration/SequentialPattern/SequentialPattern.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPClient.Azure/MCPClient.Azure.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 1701;1702;SKEXP0001 12 | 13 | 14 | 15 | 1701;1702;SKEXP0001 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/MCPServer.Azure.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

21 |

22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

27 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace MCPServer.Azure.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 | 28 | } 29 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Home page"; 5 | } 6 | 7 |
8 |

Welcome

9 |

Learn about building Web apps with ASP.NET Core.

10 |
11 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Index.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | 4 | namespace MCPServer.Azure.Pages 5 | { 6 | public class IndexModel : PageModel 7 | { 8 | private readonly ILogger _logger; 9 | 10 | public IndexModel(ILogger logger) 11 | { 12 | _logger = logger; 13 | } 14 | 15 | public void OnGet() 16 | { 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |

@ViewData["Title"]

7 | 8 |

Use this page to detail your site's privacy policy.

9 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | 4 | namespace MCPServer.Azure.Pages 5 | { 6 | public class PrivacyModel : PageModel 7 | { 8 | private readonly ILogger _logger; 9 | 10 | public PrivacyModel(ILogger logger) 11 | { 12 | _logger = logger; 13 | } 14 | 15 | public void OnGet() 16 | { 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MCPServer.Azure 2 | @namespace MCPServer.Azure.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "http": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "launchBrowser": true, 8 | "applicationUrl": "http://localhost:5223", 9 | "environmentVariables": { 10 | "ASPNETCORE_ENVIRONMENT": "Development" 11 | } 12 | }, 13 | "https": { 14 | "commandName": "Project", 15 | "dotnetRunMessages": true, 16 | "launchBrowser": true, 17 | "applicationUrl": "https://localhost:7188;http://localhost:5223", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 12 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; 13 | } 14 | 15 | html { 16 | position: relative; 17 | min-height: 100%; 18 | } 19 | 20 | body { 21 | margin-bottom: 60px; 22 | } 23 | 24 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { 25 | color: var(--bs-secondary-color); 26 | text-align: end; 27 | } 28 | 29 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { 30 | text-align: start; 31 | } -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rvinothrajendran/MicrosoftSemanticKernelSamples/d35ba30fddfc880070bc1f17e9479d0611b4a4d0/SKVersion2/MCP/Azure/MCPServer.Azure/wwwroot/favicon.ico -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /SKVersion2/MCP/Azure/MCPServer.Azure/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /SKVersion2/MCP/LocalMCPWithSKClient/LocalMCPServer/LocalMCPServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SKVersion2/MCP/LocalMCPWithSKClient/LocalMCPServer/Program.cs: -------------------------------------------------------------------------------- 1 | using ExtensionsLibrary.Tools; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace LocalMCPServer 6 | { 7 | internal class Program 8 | { 9 | static async Task Main(string[] args) 10 | { 11 | Console.WriteLine("Hello , MCP Server"); 12 | 13 | var builder = Host.CreateEmptyApplicationBuilder(settings: null); 14 | 15 | // Register the MCP server and its core services in the DI container. 16 | builder.Services.AddMcpServer() 17 | // Configure the server to use standard input/output (Stdio) for communication. 18 | .WithStdioServerTransport() 19 | // Automatically discover and register tools from the current assembly. 20 | .WithToolsFromAssembly() 21 | .WithTools(); 22 | 23 | 24 | var app = builder.Build(); 25 | 26 | 27 | await app.RunAsync(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SKVersion2/MCP/LocalMCPWithSKClient/SKMCPClient/Config.cs: -------------------------------------------------------------------------------- 1 | namespace SKMCPClient; 2 | 3 | #pragma warning disable 4 | public class Config 5 | { 6 | public string DeploymentOrModelId { get; } = Environment.GetEnvironmentVariable("MODEL_40", 7 | EnvironmentVariableTarget.Machine) ?? string.Empty; 8 | public string Endpoint { get; } = Environment.GetEnvironmentVariable("ENDPOINT", 9 | EnvironmentVariableTarget.Machine) ?? string.Empty; 10 | public string ApiKey { get; } = Environment.GetEnvironmentVariable("APIKEY", 11 | EnvironmentVariableTarget.Machine) ?? string.Empty; 12 | public string BingMapKey { get; } = Environment.GetEnvironmentVariable("BINGMAP", 13 | EnvironmentVariableTarget.Machine) ?? string.Empty; 14 | 15 | } -------------------------------------------------------------------------------- /SKVersion2/MCP/LocalMCPWithSKClient/SKMCPClient/SKMCPClient.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SKVersion2/MCP/SKPluginInMCPServer/MCPServerSKPlugins/MCPServerSKPlugins.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | enable 7 | enable 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SKVersion2/ModelFactory/Config.cs: -------------------------------------------------------------------------------- 1 | namespace LLMModelFactory; 2 | 3 | #pragma warning disable 4 | public class Config 5 | { 6 | public string DeploymentOrModelId { get; } = Environment.GetEnvironmentVariable("MODEL_40", 7 | EnvironmentVariableTarget.Machine) ?? string.Empty; 8 | public string Endpoint { get; } = Environment.GetEnvironmentVariable("ENDPOINT", 9 | EnvironmentVariableTarget.Machine) ?? string.Empty; 10 | public string ApiKey { get; } = Environment.GetEnvironmentVariable("APIKEY", 11 | EnvironmentVariableTarget.Machine) ?? string.Empty; 12 | 13 | 14 | public string LlamaModel { get; } = "llama3.2"; 15 | public string OllamaUri { get; } = "http://localhost:11434"; 16 | 17 | public string GitHubModel { get; } = "gpt-4o-mini"; // Default model for GitHub, can be overridden by environment variable 18 | public string GitHubUri { get; } = "https://models.github.ai/inference"; // Default URI for GitHub, can be overridden by environment variable 19 | public string GitHubToken { get; } = Environment.GetEnvironmentVariable("GITHUB_TOKEN", EnvironmentVariableTarget.User) ?? string.Empty; 20 | } -------------------------------------------------------------------------------- /SKVersion2/ModelFactory/ExtensionsClientFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.AI; 2 | 3 | namespace LLMModelFactory; 4 | 5 | public static class ExtensionsClientFactory 6 | { 7 | private static readonly Config Config = new(); 8 | public static IChatClient CreateClient(LLMModel model) 9 | { 10 | return model switch 11 | { 12 | LLMModel.Ollama => CreateOllamaClient(), 13 | _ => throw new ArgumentOutOfRangeException(nameof(model), model, null) 14 | }; 15 | } 16 | 17 | 18 | private static IChatClient CreateOllamaClient() 19 | { 20 | IChatClient client = new OllamaChatClient(new Uri(Config.OllamaUri),Config.LlamaModel) 21 | .AsBuilder() 22 | .UseFunctionInvocation() 23 | .Build(); 24 | 25 | return client; 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /SKVersion2/ModelFactory/LLMModel.cs: -------------------------------------------------------------------------------- 1 | namespace LLMModelFactory; 2 | 3 | public enum LLMModel 4 | { 5 | Azure = 0, 6 | Ollama = 1, 7 | GitHub = 2 8 | } 9 | 10 | -------------------------------------------------------------------------------- /SKVersion2/ModelFactory/LLMModelFactory.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SKVersion2/PluginsLibrary/Config.cs: -------------------------------------------------------------------------------- 1 | namespace ExtensionsLibrary; 2 | 3 | public static class Config 4 | { 5 | public static string WeatherApiKey { get; } = ""; 6 | } -------------------------------------------------------------------------------- /SKVersion2/PluginsLibrary/ExtensionsLibrary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SKVersion2/PluginsLibrary/Tools/ExternalWeatherTool.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using ModelContextProtocol.Server; 3 | 4 | namespace ExtensionsLibrary.Tools; 5 | 6 | [McpServerToolType] 7 | public class ExternalWeatherTool 8 | { 9 | private readonly HttpClient _httpClient = new(); 10 | 11 | [McpServerTool, Description("get weather information based on the location")] 12 | public string? GetWeatherAsync(string cityName) 13 | { 14 | 15 | var apiUrl = $"http://api.weatherapi.com/v1/current.json?key={Config.WeatherApiKey}&q={cityName}&aqi=no"; 16 | 17 | try 18 | { 19 | HttpResponseMessage response = _httpClient.GetAsync(apiUrl).Result; 20 | response.EnsureSuccessStatusCode(); 21 | 22 | var responseBody = response.Content.ReadAsStringAsync().Result; 23 | 24 | return responseBody; 25 | } 26 | catch (HttpRequestException ex) 27 | { 28 | // Handle any exceptions here, such as network errors. 29 | Console.WriteLine($"Error: {ex.Message}"); 30 | return null; 31 | } 32 | } 33 | 34 | } --------------------------------------------------------------------------------