Table of Contents

๐Ÿ‘‰ Try the demo:
https://github.com/LM-Kit/lm-kit-net-samples/tree/main/console_net/text-generation/structured-content-creation/multi_turn_chat_with_yes_no_assistant

Create Yes or No AI Chatbot in .NET Applications


๐ŸŽฏ Purpose of the Demo

The Multi-Turn Chat with Yes/No Assistant Demo showcases how to utilize the LM-Kit.NET SDK to create an interactive chatbot that provides yes or no answers. This sample demonstrates the integration of large language models (LLMs) into a .NET application to facilitate multi-turn conversations where the chatbot responds strictly with yes or no answers, serving as a fact-checking assistant.


๐Ÿ‘ฅ Industry Target Audience

This sample is particularly beneficial for developers and organizations in the following sectors:

  • ๐Ÿ“ž Customer Support: Provide clear and concise responses to customer queries.
  • ๐Ÿ“š Education: Aid in quizzes and simple assessments requiring yes or no answers.
  • ๐Ÿฅ Healthcare: Assist in preliminary diagnostics by answering basic yes or no questions.
  • ๐Ÿ” Fact-Checking Services: Automate the process of verifying statements with straightforward yes or no responses.

๐Ÿš€ Problem Solved

Creating chatbots that provide concise and unambiguous answers can be challenging, especially when the required response is strictly yes or no. The Multi-Turn Chat with Yes/No Assistant Demo addresses this problem by leveraging LLMs to ensure the chatbot only gives yes or no answers, enhancing clarity and precision in automated responses.


๐Ÿ’ป Sample Application Description

The Multi-Turn Chat with Yes/No Assistant Demo is a console application that allows users to interact with a chatbot designed to answer yes or no questions using various AI models.

โœจ Key Features

  • ๐Ÿ“ˆ Model Selection: Users can choose from predefined models or provide a custom model URI.
  • ๐Ÿ“Š Progress Tracking: The application displays download and loading progress for the selected model.
  • โœ… Strict Yes/No Responses: The chatbot is programmed to respond only with yes or no, based on the user's query.
  • ๐Ÿ“ˆ Performance Metrics: Displays generated tokens, stop reasons, quality score, and speed of response for each interaction.
  • ๐Ÿ“ Special Commands: Users can reset the conversation using the /reset command.

๐Ÿง  Supported Models

The sample supports several state-of-the-art models:

  • Alibaba Qwen 3.5 9B (~7 GB VRAM)
  • Google Gemma 4 E4B (~6 GB VRAM)
  • Microsoft Phi-4 14.7B (~11 GB VRAM)
  • OpenAI GPT OSS 20B (~16 GB VRAM)
  • Z.ai GLM 4.7 Flash 30B (~18 GB VRAM)
  • Alibaba Qwen 3.8 27B (~18 GB VRAM)
  • Alibaba Qwen 3.6 35B-A3B (~22 GB VRAM)

๐Ÿ› ๏ธ Getting Started

๐Ÿ“‹ Prerequisites

  • .NET 8.0 or later

๐Ÿ“ฅ Download the Project

โ–ถ๏ธ Running the Application

  1. ๐Ÿ“‚ Clone the repository:

    git clone https://github.com/LM-Kit/lm-kit-net-samples
    
  2. ๐Ÿ“ Navigate to the project directory:

    cd lm-kit-net-samples/console_net/text-generation/structured-content-creation/multi_turn_chat_with_yes_no_assistant
    
  3. ๐Ÿ”จ Build and run the application:

    dotnet build
    dotnet run
    
  4. ๐Ÿ“ Follow the on-screen prompts to select a model and start the multi-turn chat.

๐Ÿ’ก Example Usage

  1. Select a Model: Choose from the available models or enter a custom model URI.
  2. Initiate Conversation: Start by entering a question, such as "Hello chatbot, are you functioning properly?".
  3. Receive Yes/No Response: The chatbot will respond with yes or no based on the query.
  4. Continue Interaction: Enter another question or reset the conversation using the /reset command.
  5. End the Chat: Submit an empty input to end the program.

By following these steps, developers can explore the functionalities of LM-Kit.NET and integrate a yes/no answering chatbot into their applications, enhancing the clarity and precision of automated responses through a multi-turn conversational AI.

Share