{"id":24238632,"url":"https://github.com/instantiator/semantic-kernel-experiment","last_synced_at":"2026-04-20T03:35:35.199Z","repository":{"id":186256444,"uuid":"629013016","full_name":"instantiator/semantic-kernel-experiment","owner":"instantiator","description":"A simple experimental project with sample code for using the Semantic Kernel and Planner to complete a task by invocation of a text completion LLM. Fully commented.","archived":false,"fork":false,"pushed_at":"2023-04-17T23:22:42.000Z","size":913,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T21:01:23.783Z","etag":null,"topics":["ai","csharp","dotnet","gpt","llm","ml","openai","semantic-kernel","text-completion"],"latest_commit_sha":null,"homepage":"https://instantiator.dev/post/you-too-can-llm/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/instantiator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-17T12:52:09.000Z","updated_at":"2023-11-20T00:21:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"730ffa60-451c-41ee-964f-0c3c365b19bb","html_url":"https://github.com/instantiator/semantic-kernel-experiment","commit_stats":null,"previous_names":["instantiator/semantic-kernel-experiment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantiator%2Fsemantic-kernel-experiment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantiator%2Fsemantic-kernel-experiment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantiator%2Fsemantic-kernel-experiment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instantiator%2Fsemantic-kernel-experiment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instantiator","download_url":"https://codeload.github.com/instantiator/semantic-kernel-experiment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241870620,"owners_count":20034323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","csharp","dotnet","gpt","llm","ml","openai","semantic-kernel","text-completion"],"created_at":"2025-01-14T20:54:24.647Z","updated_at":"2026-04-20T03:35:30.174Z","avatar_url":"https://github.com/instantiator.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# semantic-kernel-experiment\n\nThe [Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/whatissk) is a .NET SDK that simplifies a number of machine learning tasks.\n\n![](https://learn.microsoft.com/en-us/semantic-kernel/media/fullview.png)\n\nThis solution is fully commented, and illustrates a simple use of the Semantic Kernel:\n\n* Defines 1 or more skills, each with 1 or more functions\n* Creates a plan from an ask presented to the Kernel\n* Executes that plan, to get to a final result\n\n## Configuration\n\nConfig is stored in 2 files:\n\n* `SKE/.env` - configuration specifying `serviceId` and `modelId`\n* `SKE/.secret.env` - configuration specifying your secret `apiKey`\n\nYou'll need to create `SKE/.secret.env` file and provide your API key from OpenAI:\n\n```env\napiKey=\u003cyour-key-goes-here\u003e\n```\n\n### OpenAI vs. Azure OpenAI\n\nNB. The solution is currently set up to use text completion services from OpenAI. Semantic Kernel can also access similar services through Azure OpenAI - you'll need to modify the code a little to do that... It's the difference between this:\n\n```csharp\nkernel.Config.AddOpenAITextCompletionService(serviceId, modelId, apiKey, orgId);\n```\nand this:\n\n```csharp\nkernel.Config.AddAzureOpenAITextCompletionService(serviceId, modelId, azureEndpoint, apiKey);\n```\n\n## Getting started\n\n* Place an API key from your OpenAI subscription in `.secret.env`\n* Run the application:\n\n  ```sh\n  dotnet run --project SKE/SKE.csproj\n  ```\n\n## Skills, Functions, and the Planner\n\nYou can define any number of [semantic functions](https://learn.microsoft.com/en-us/semantic-kernel/howto/semanticfunctions) and [native functions](https://learn.microsoft.com/en-us/semantic-kernel/howto/nativefunctions), and these are bundled into groups called skills.\n\nEach skill is found in its own directory, and in this solution these are all grouped inside the `Skills/` directory.\n\nYou can invoke functions directly through the Kernel, or use the Planner - a special skill that can determine which functions to use to fulfil an ask you make of it.\n\n`KernelSkillsExtensions.cs` provides a number of helpful utility methods for importing skills, importing the planner, and then using it to create a plan and execute it.\n\n## Creating skills\n\nTo add a new semantic function, create the directory structure for it: `Skills/\u003cskill-name\u003e/\u003cfunction-name\u003e`\n\nThen, add the `skprompt.txt` prompt file, and (optionally) a `config.json` file for the function itself:\n\n* `Skills/\u003cskill-name\u003e/\u003cfunction-name\u003e/skprompt.txt`\n* `Skills/\u003cskill-name\u003e/\u003cfunction-name\u003e/config.json`\n\n_NB. Ensure that your `skprompt.txt` and `config.json` files are copied alongside the compiled binary by setting their \"copy to output directory\" property._\n\nTo add native functions, create the skill directory, and then a C# class file inside that skill directory. Provide each method that you wish to import as a native function with the `SKFunction` attribute, and provide a description of the function as its parameter, eg.\n\n```csharp\npublic class CharacterManipulationSkill\n{\n    [SKFunction(\"Return the text in all uppercase (aka capitals)\")]\n    public string Uppercase(string input)\n        =\u003e input.ToUpper();\n}\n```\n\nNB. A skill can contain any combination of native or semantic functions.\n\nThe code in `KernelSkillsExtensions.ImportAllSemanticSkills` and `KernelSkillsExtensions.ImportAllNativeSkills` will locate and import all skills defined in the solution.\n\n## `Microsoft.SemanticKernel` NuGet package\n\nNB. The `Microsoft.SemanticKernel` package is in preview right now, so you'll need to enable 'include prereleases' in your package selector to see it.\n\n![The NuGet package selector - it's showing the Microsoft.SemanticKernel package, and at the bottom of the window, the 'include prereleases' option is selected.](images/nuget-semantic-kernel.png)\n\n## See also\n\n* [microsoft/semantic-kernel](https://github.com/microsoft/semantic-kernel) (GitHub repository)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstantiator%2Fsemantic-kernel-experiment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finstantiator%2Fsemantic-kernel-experiment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finstantiator%2Fsemantic-kernel-experiment/lists"}