Skip to content

andyjessop/rust-terminal-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terminal-based Chatbot with Rust and OpenAI

This project is a simple terminal-based chatbot built with Rust and leveraging the OpenAI API. It allows users to interact with OpenAI's powerful AI models directly from the command line. It was built to accompany the tutorial Building a Terminal-based Chatbot in Rust from Scratch.

Features

  • Terminal-based user interaction.
  • Integration with OpenAI API for generating AI responses.
  • Easy setup with minimal configuration.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Rust programming language installation.
  • An active OpenAI API key. You can obtain one by signing up at OpenAI.

Getting Started

To get a local copy up and running follow these simple steps:

  1. Clone the repository:
    git clone https://github.com/andyjessop/rust-terminal-chatbot ask
    cd ask
    

Create a .env file in the root of your project and add your OpenAI API key:

OPENAI_API_KEY=your_api_key_here

Install the required dependencies:

cargo build

Run the application:

cargo run

Usage

After running the application, you will be prompted to enter your questions. Type your questions into the terminal, and press Enter. The AI response will be displayed shortly after.

To end the session, type exit and press Enter.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages