Skip to content

A simple chat bot using Groq Cloud and the OpenAI Nuget package

Notifications You must be signed in to change notification settings

evandroamparo/llm-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatApp

Overview

ChatApp is a console application that simulates a chat assistant designed to sell an internet plan to a customer. The assistant uses the OpenAI-compatible API to generate responses and is configured to be persistent and persuasive.

It's currently using the free Groq API.

Prerequisites

  • .NET 9.0 SDK or later
  • A Groq API key

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd llm-chat
  2. Add User Secrets: The project uses user secrets to store sensitive information like the API key. To add your secrets, run the following commands:

    dotnet user-secrets init
    dotnet user-secrets set "GroqApiKey" "<your-groq-api-key>"
    dotnet user-secrets set "ModelName" "<model-name>"
    dotnet user-secrets set "BaseUrl" "<base-url>"

You can get an API key from Groq dev console.

The available models are listed here. I suggest Llama because it has a larger context window.

The OpenAI-compatible base URL can be found here.

  1. Restore dependencies:
    dotnet restore

Running the Application

  1. Build the project:

    dotnet build
  2. Run the project:

    dotnet run

Usage

  • The application will start and display a welcome message.
  • Type your messages and press Enter to interact with the chat assistant.
  • Type exit to exit the chat.

License

This project is licensed under the MIT License.

Releases

No releases published

Packages

No packages published

Languages