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.
- Terminal-based user interaction.
- Integration with OpenAI API for generating AI responses.
- Easy setup with minimal configuration.
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.
To get a local copy up and running follow these simple steps:
- 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
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.