{"id":29837916,"url":"https://github.com/awaescher/tinychat","last_synced_at":"2026-04-07T09:00:49.567Z","repository":{"id":305621052,"uuid":"1022027681","full_name":"awaescher/TinyChat","owner":"awaescher","description":"A minimalistic but extensible chat control library for Windows Forms","archived":false,"fork":false,"pushed_at":"2026-03-20T14:20:07.000Z","size":2036,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-21T06:34:22.340Z","etag":null,"topics":["ai","chat","controls","dotnet","ichatclient","llm","ui","windows-desktop","windows-forms","winforms"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/TinyChat","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/awaescher.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-18T10:31:02.000Z","updated_at":"2026-03-20T14:13:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a5e0110-04e1-4cfc-aee5-cc56e1a3babe","html_url":"https://github.com/awaescher/TinyChat","commit_stats":null,"previous_names":["awaescher/tinychat"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/awaescher/TinyChat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awaescher%2FTinyChat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awaescher%2FTinyChat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awaescher%2FTinyChat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awaescher%2FTinyChat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awaescher","download_url":"https://codeload.github.com/awaescher/TinyChat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awaescher%2FTinyChat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31506574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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","chat","controls","dotnet","ichatclient","llm","ui","windows-desktop","windows-forms","winforms"],"created_at":"2025-07-29T13:16:15.576Z","updated_at":"2026-04-07T09:00:49.534Z","avatar_url":"https://github.com/awaescher.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NuGet Status](https://img.shields.io/nuget/v/TinyChat.svg)](https://www.nuget.org/packages/TinyChat/)\n\n# TinyChat 💬\n\nA minimalistic but extensible chat control library for Windows Forms.\n\n![Screenshot](docs/Screenshot.png)\n\n## ✨ Features\n\n- **Simplistic chat interface**: Clean, responsive chat UI with message history and input controls\n- **Streaming support**: Real-time message streaming for AI assistants and live conversations\n- **Basic formatting support**: Supports cleaning HTML and Markdown formatting for WinForms controls and basic HTML and Markdown support for DevExpress controls\n- **Function calling support**: Native support for tool/function calls with automatic argument and result display\n- **Reasoning support**: Display model reasoning steps when the model thinks before generating final responses\n- **Extensible architecture**: Interface-driven design allowing custom message types and custom UI components\n- **Made for WinForms**: Because business applications might need AI chats, too\n\n## 💖 Motivation\n\nWhile there are countless web-based chat controls, there's nearly to none for the good old Windows Forms ecosystem and this is not surprising. However, I needed a very basic user interface to interact with AI models within an WinForms application. \n\nDevExpress, the component vendor of my choice, [has a very nice chat control](http://docs.devexpress.com/WindowsForms/405218). However, it's built upon web technologies and with that [it introduces a significant number of dependencies to ship](https://supportcenter.devexpress.com/ticket/details/t1294891/aichatcontrol-without-webview). I didn't want to pack additional 50MB of assemblies for a single control and theirs is so feature-rich that I would have to to disable 90% of it's functionality nevertheless.\n\nThat's why I quickly hacked down TinyChat. I hope this might help anyone out there. But please keep in mind that I never inteded to build a full-featured chat client with advanced text formatting support and so on. If you need more features, please consider sending pull-requests or using the DevExpress chat control.\n\n## 🤷‍♂️ Not implemented\n\n### Not planned\n\nThese features are not implemented and I don't plan to implement them. However, I'd be happy to review pull-requests.\n\n- Full formatting support\n  \u003e [Basic formatting is supported since v2.0](https://github.com/awaescher/TinyChat/pull/1) but full formatting spec support will be very hard to do in Winforms. Especially because AI assistants can come up with pretty much every flavor of formatting like HTML, Markdown, RTF, etc.\n- File attachment support\n- Image support\n- everything else you know from chatbots\n\n### Might come\n- Designer support for properties like UI settings like Fonts, Splitter position, ...\n- Select and copy texts\n- Starting new chats\n\n## 🚀 Quick Start\n\n### Basic Usage\n\nThe chat control provides a `Messages` property that can be set to provide message history.\nWhen the user is sending messages, the events `MessageSending` and `MessageSent` gets fired to prevent or react on user messages.\n\n```csharp\nusing TinyChat;\n\nvar chatControl = new ChatControl();\nchatControl.Dock = DockStyle.Fill;\nControls.Add(chatControl);\n\n// Set up message handling\nchatControl.MessageSent += (sender, e) =\u003e\n{\n    // Handle user messages\n    Console.WriteLine($\"User sent: {e.Content}\");\n    \n    // Add a response\n    chatControl.AddMessage(\n        new NamedSender(\"Assistant\"), \n        new StringMessageContent(\"Hello! How can I help you?\")\n    );\n};\n\n```\n\n### Streaming Messages with IAsyncEnumerable\n\nUse `AddStreamingMessage()` to pass in a stream of tokens asynchronously. The chat component will take care of updating the user interface from background threads.\n\n```csharp\nIAsyncEnumerable\u003cstring\u003e stream = ...;\nchatControl.AddStreamingMessage(new NamedSender(\"AI Assistant\"), stream);\n```\n\n### Using IChatClient with Dependency Injection\n\nTinyChat now supports direct integration with `Microsoft.Extensions.AI.IChatClient`, enabling automatic AI responses with minimal boilerplate code.\n\n```csharp\nusing Microsoft.Extensions.AI;\nusing Microsoft.Extensions.DependencyInjection;\nusing TinyChat;\n\n// Set up dependency injection\nvar services = new ServiceCollection();\n\n// Register your IChatClient implementation (e.g., OpenAI, Azure OpenAI, Ollama, etc.)\nservices.AddSingleton\u003cIChatClient\u003e(/* your IChatClient implementation */);\n\nvar serviceProvider = services.BuildServiceProvider();\n\n// Configure the ChatControl\nvar chatControl = new ChatControl\n{\n    ServiceProvider = serviceProvider,\n    UseStreaming = true,  // Enable streaming (default)\n    AssistantSenderName = \"AI Assistant\"\n};\n\n// That's it! The ChatControl will automatically call IChatClient when users send messages\n// The entire conversation history is passed to the IChatClient\n```\n\n**Key Features:**\n- **Automatic Integration**: No need to manually handle `MessageSent` events\n- **Conversation History**: Full message history is automatically passed to the IChatClient\n- **Streaming Support**: Toggle between streaming and non-streaming responses\n- **Keyed Services**: Support for keyed service resolution via `ChatClientServiceKey` property\n- **Cancellation Support**: Long-running operations can be cancelled\n- **Extensible**: Override `ConvertToChatMessages()` or `DetermineChatRole()` for custom behavior\n\n**Using Keyed Services:**\n```csharp\n// Register multiple IChatClient instances with different keys\nservices.AddKeyedSingleton\u003cIChatClient\u003e(\"basic\", /* basic model */);\nservices.AddKeyedSingleton\u003cIChatClient\u003e(\"premium\", /* premium model */);\n\n// Use a specific keyed service\nchatControl.ChatClientServiceKey = \"premium\";\n```\n\n### Formatting\n\nWinForms controls don't support partial text formatting. To make the WinForms ChatControl usable with AI chatbots, TinyChat will try to remove basic HTML and Markdown formatting. \n\nThe DevExpress Demo goes even further and makes use of the [basic HTML support with DevExpress controls](https://docs.devexpress.com/WindowsForms/4874/common-features/html-text-formatting) and tries to turn HTML or even Markdown input into these basic HTML tags. Tags that are not supported are stripped out to keep the text readable.\n\n![Formatting within the WinForms ChatControl and the DevExpress Demo ChatControl](./docs/Formatting.png)\n\nIt's possible to create a custom formatter by implementing `IMessageFormatter` and instantiating it by overriding `ChatControl.CreateDefaultMessageFormatter()`.\n\n## 🎬 Demos\n\nThe repository includes a demo application that demonstrates a basic Windows Forms application with dependency-free standard controls and a DevExpress application that showcases the customizability with skinned DevExpress components.\n\n```bash\ndotnet run --project DemoApp\n```\n\n## Credits\n\nThe package icon was made by [Vectors Market](https://www.flaticon.com/authors/vectors-market) and is licensed by the [Flaticons license](https://www.flaticon.com/legal).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawaescher%2Ftinychat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawaescher%2Ftinychat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawaescher%2Ftinychat/lists"}