Table of Contents

Create Multi Turn Chatbot in .NET Applications


🎯 Purpose of the Sample

The Multi-Turn Chat Demo showcases the capabilities of the LM-Kit.NET SDK in facilitating interactive, multi-turn conversations with AI models. This sample demonstrates how to integrate various large language models (LLMs) into a .NET application to create a chatbot that can engage in extended dialogues, maintaining context across multiple exchanges.


👥 Industry Target Audience

This sample is particularly valuable for developers and businesses in the following sectors:

  • 📞 Customer Support: Enhance customer service by deploying chatbots capable of handling complex queries and maintaining context over long interactions.
  • 🏥 Healthcare: Support virtual assistants in providing patient information and managing follow-up questions.
  • 📚 Education: Implement intelligent tutoring systems that can interact dynamically with students, offering personalized assistance.
  • 🛍️ E-commerce: Improve customer engagement and support through conversational agents that understand and retain context across interactions.

🚀 Problem Solved

Traditional chatbots often struggle with maintaining context in conversations, leading to disjointed and less effective interactions. The Multi-Turn Chat Demo addresses this issue by leveraging advanced LLMs to retain context and generate coherent responses over multiple turns. This improves user experience and the effectiveness of automated conversational systems.


💻 Sample Application Description

The Multi-Turn Chat Demo is a console application that guides users through selecting and interacting with different AI models to experience multi-turn chat capabilities.

✨ 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.
  • 🔄 Dynamic Interaction: The chatbot can handle multiple turns, retaining context and generating relevant responses.
  • 📝 Special Commands: Users can reset the conversation or regenerate the last response using special commands.

🧠 Supported Models

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

  • Mistral Nemo 2407 12.2B
  • Meta Llama 3.1 8B
  • Google Gemma2 9B Medium
  • Microsoft Phi-3 3.82B Mini
  • Alibaba Qwen-2 7.6B

🛠️ Commands

  • /reset: Start a new session, clearing the conversation history.
  • /regenerate: Request a new completion based on the last input.

🛠️ Getting Started

📋 Prerequisites

  • .NET Framework 4.6.2 or .NET 6.0

📥 Download the Project

▶️ Running the Application

  1. 📂 Clone the repository:

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

    cd lm-kit-net-samples/console_framework_4.62/multi_turn_chat
    

    or

    cd lm-kit-net-samples/console_net6/multi_turn_chat
    
  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.

By following these steps, developers can explore the functionalities of LM-Kit.NET and integrate advanced conversational AI into their applications, enhancing user interactions through effective and context-aware dialogue management.