{"id":16008627,"url":"https://github.com/jimbobbennett/liblab-sdk-integration-with-semantic-kernel","last_synced_at":"2026-04-26T23:31:40.150Z","repository":{"id":231794723,"uuid":"782722538","full_name":"jimbobbennett/liblab-sdk-integration-with-semantic-kernel","owner":"jimbobbennett","description":"A demo of using C# SDKs generated by liblab to integrate services with Semantic Kernel to do LLM reasoning over your own data sources.","archived":false,"fork":false,"pushed_at":"2024-04-10T01:46:00.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T02:25:20.343Z","etag":null,"topics":["ai","api","csharp","dotnet","liblab","llm","sdk"],"latest_commit_sha":null,"homepage":"https://liblab.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimbobbennett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-05T22:10:36.000Z","updated_at":"2024-09-28T08:55:09.000Z","dependencies_parsed_at":"2024-04-06T01:31:58.136Z","dependency_job_id":"e16d2afc-b05a-4749-9c8c-b424ead06f1a","html_url":"https://github.com/jimbobbennett/liblab-sdk-integration-with-semantic-kernel","commit_stats":null,"previous_names":["jimbobbennett/liblab-sdk-integration-with-semantic-kernel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jimbobbennett/liblab-sdk-integration-with-semantic-kernel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimbobbennett","download_url":"https://codeload.github.com/jimbobbennett/liblab-sdk-integration-with-semantic-kernel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32317163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","api","csharp","dotnet","liblab","llm","sdk"],"created_at":"2024-10-08T12:44:02.686Z","updated_at":"2026-04-26T23:31:40.133Z","avatar_url":"https://github.com/jimbobbennett.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Integrate liblab generated SDKs with your LLM using Semantic Kernel for RAG (retrieval augmented generation)\n\nThis repo shows you how you can integrate your own data sources into an LLM powered app for RAG, using auto-generated C# SDKs from [liblab](https://liblab.com), [Microsoft Semantic Kernel](https://learn.microsoft.com/semantic-kernel/) as an orchestrator, and [OpenAI](https://openai.com).\n\nSemantic Kernel is a library that allows you use an LLM to call agents in your own code, using that data to augment the responses, or to run actions. This demo shows how you can quickly create a C# SDK for your APIs and integrate those SDKs into Semantic Kernel plugins, bringing your data into the LLM.\n\n## Prerequisites\n\nTo build and run this demo you will need:\n\n- Visual Studio or Visual Studio Code\n- Either .NET 8.0 installed locally, or docker installed so you can use the included devcontainer (recommended)\n- An OpenAI API key\n- A [liblab](https://liblab.com) account\n\n    If you don't have a liblab account, you can create one [from liblab.com by selecting **Get Started**](https://liblab.com). You can sign up for free to get 15 SDK builds.\n\n## Integrated APIs\n\nThis demo integrates three APIs:\n\n- [World Time API](http://worldtimeapi.org) - this is an API that can get the current date and time for you based off your IP address. LLMs don't know the current date and time, so access to this information can be useful. Although this is overkill to use an API instead of just getting the current date and time from the system, it's a good example of how you can integrate any API into your LLM.\n- [Cat Facts API](http://catfact.ninja) - this is an API that returns random cat facts. This is a fun API to use to show how you can integrate any API that returns textual data into your LLM so that it can reason using that data.\n- [Dall-E from  OpenAI](https://openai.com) - this is part of the OpenAI API that allows you to generate images from textual prompts. This is used to show how to pass data to a plugin, and then use that data to call an external API.\n\n## Build SDKs for the APIs\n\nTo integrate the APIs into your LLM, you need to generate C# SDKs for them using liblab. To do this, follow these steps:\n\n1. Ensure you have the liblab CLI installed and you are logged in. If you are using the included devcontainer, this is already installed for you. If not, refer to the [liblab CLI installation instructions](https://developers.liblab.com/cli/cli-installation/).\n1. This repo includes liblab config files already set up to generate the SDKs for the relevant APIs. These are in the `sdks` folder.\n    1. From the terminal, navigate to the `sdks/cat-facts-sdk` folder in this repo.\n    1. Run `liblab build` to generate the Cat Facts SDK. The generated SDK will be in the `cat-facts-sdk/output/csharp` folder.\n    1. From the terminal, navigate to the `sdks/world-time-sdk` folder in this repo.\n    1. Run `liblab build` to generate the World Time SDK. The generated SDK will be in the `world-time-sdk/output/csharp` folder.\n    1. From the terminal, navigate to the `sdks/open-ai` folder in this repo.\n    1. Run `liblab build` to generate the OpenAI SDL. The generated SDK will be in the `open-ai/output/csharp` folder.\n\n## Check out the integrations\n\nThese APIs are integrated using Semantic Kernel plugins, and can be found in the `src/LLMAndSDKDemo/Plugins` folder. These plugins implement functions marked with the `KernelFunction` attribute, which allows them to be called from the LLM, along with a `Description` attribute that describes the capabilities of the function to the LLM so it can reason as to what kernel functions to call.\n\n```csharp\n[KernelFunction]\n[Description(\"Gets a cat fact.\")]\npublic async Task\u003cstring\u003e GetCatFact()\n{\n    var response = await _client.Facts.GetRandomFactAsync();\n    return response.Fact;\n}\n```\n\nFor example, the `GetCatFact` function in the `CatFactPlugin` class calls the Cat Facts API and returns a random cat fact. The description `\"Gets a cat fact.\"` tells the LLM what this function does, so if you were to use a prompt such as `Give me a fact about cats`, the LLM would know to call this function and include the result in the response.\n\nThe Dall-E plugin shows how you can pass data to a plugin.\n\n```csharp\n[KernelFunction]\n[Description(\"Creates an image using a given prompt.\")]\npublic async Task\u003cstring\u003e CreateImage(\n    [Description(\"The prompt to use to create an image\")] string prompt\n    )\n{\n}\n```\n\nThe `prompt` parameter has a description that tells the orchestrator what the parameter is for. This allows the orchestrator to pass the data to the plugin, and the plugin can then use that data to call the OpenAI SDK and create an image.\n\n## Configure the app\n\nTo run this app you will need to configure your OpenAI API key in the app settings.\n\n1. In the `src/LLMAndSDKDemo` folder, copy the `appsettings.json.example` file to `appsettings.json`.\n1. Open the `appsettings.json` file and replace `OpenAI/key` with your OpenAI API key.\n\n    ```json\n    {\n        \"OpenAI\": {\n            \"Key\": \"\", // Your OpenAI API key\n            \"ChatModel\": \"gpt-4\",\n            \"ImageModel\": \"dall-e-3\"\n        }\n    }\n    ```\n\n1. The app uses GPT-4 by default as the chat model, and Dall-E-3 for image generation. If you want to use another model, replace the relevant values with the model Ids of the models you want to use.\n\n## Try the app out\n\nThe app is a simple .NET console app that allows you to interact with the LLM. The project is configured to point to the generated SDKs, so assuming you have these generated you should be able to build and run the app.\n\n1. Navigate to the `src/LLMAndSDKDemo` folder in the terminal.\n1. Run `dotnet run` to build and run the app.\n1. Give the AI a prompt. If your prompt involves the current date and time or a cat fact, the AI will call the appropriate plugin to get the information, and you will see this written to the console. If your prompt involves an image, the AI will call the OpenAI API to generate an image and write this to the `images` folder.\n\n    ```bash\n    $ dotnet run\n    I am an AI assistant who also knows the current day and time, and a load of cat facts!\n    User \u003e Tell me a fact about cats\n    CatFactPlugin \u003e Getting a cat fact from the Cat Facts API...\n    Assistant \u003e Here is a fun fact: Approximately 1/3 of cat owners think their pets are able to read their minds.\n    User \u003e What is the date\n    DayPlugin \u003e Getting the date and time from the World Time API...\n    Assistant \u003e The date is April 5, 2024.\n    User \u003e Create an image using a cat fact\n    DallEPlugin \u003e Creating an image using the prompt: A cat traveling at a top speed of approximately 31 mph over a short distance\n    Assistant \u003e Here is the image generated based on the cat fact: images/40f58c1b-b01d-4a05-9f0f-0a11974b1950.png\n    ```\n\n    The LLM uses the history of the conversation, so you can ask questions based on previous responses. For example, you could ask `What is the date tomorrow?` and the LLM would know to call the World Time API to get the date for tomorrow.\n\n    ```bash\n    User \u003e what is the date tomorrow\n    DayPlugin \u003e Getting the date and time from the World Time API...\n    Assistant \u003e Tomorrow's date will be April 6, 2024.\n    ```\n\n## Extend the app\n\nThis is your opportunity to extend this app! Find APIs you are interested in, and use liblab to generate C# SDKs for them. Then integrate them into the app using Semantic Kernel plugins.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimbobbennett%2Fliblab-sdk-integration-with-semantic-kernel/lists"}