Single Turn AI Chatbot in .NET Applications
🎯 Purpose of the Sample
The Single Turn Chat Demo demonstrates how to use the LM-Kit.NET SDK for single-turn conversational interactions. This sample highlights the simplicity and efficiency of using large language models (LLMs) to handle one-off questions or statements, making it ideal for quick, informative exchanges.
👥 Industry Target Audience
This sample is particularly useful for developers and organizations in the following sectors:
- 📞 Customer Support: Provide instant answers to frequently asked questions or simple queries.
- 📚 Information Services: Deliver quick, accurate information retrieval for various industries such as travel, finance, and education.
- 🤖 Virtual Assistants: Enhance the capabilities of virtual assistants by enabling them to respond to single-turn requests effectively.
- 🏥 Healthcare: Offer immediate responses to patient inquiries or general health information queries.
🚀 Problem Solved
Traditional chatbots often require complex, multi-turn interactions to provide useful information, which can be cumbersome for simple queries. The Single Turn Chat Demo addresses this problem by enabling efficient and accurate single-turn conversations, thereby improving user experience and response times for straightforward inquiries.
💻 Sample Application Description
The Single Turn Chat Demo is a console application that allows users to interact with various AI models for single-turn conversations.
✨ 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.
- 🔄 Single-Turn Interaction: The chatbot handles one-off user inputs and provides prompt responses.
- 📈 Performance Metrics: Displays generated tokens, stop reasons, quality score, and speed of response for each interaction.
🧠 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
🛠️ Getting Started
📋 Prerequisites
- .NET Framework 4.6.2 or .NET 6.0
📥 Download the Project
▶️ Running the Application
📂 Clone the repository:
git clone https://github.com/LM-Kit/lm-kit-net-samples.git
📁 Navigate to the project directory:
cd lm-kit-net-samples/console_framework_4.62/single_turn_chat
or
cd lm-kit-net-samples/console_net6/single_turn_chat
🔨 Build and run the application:
dotnet build dotnet run
📝 Follow the on-screen prompts to select a model and start the single-turn chat.
💡 Example Usage
- Select a Model: Choose from the available models or enter a custom model URI.
- Initiate Conversation: Start by entering a prompt, such as "Hello!".
- Receive Response: The chatbot will provide a response based on the prompt.
- Continue Interaction: Enter another prompt or end the chat by submitting an empty input.
By following these steps, developers can explore the functionalities of LM-Kit.NET and integrate efficient single-turn conversational AI into their applications, enhancing user interactions through prompt and accurate responses to individual queries.