This repository contains an AI Chatbot Agent designed to interact with the user via the command-line interface. The chatbot utilizes OpenAI's GPT model to generate responses and carry out tasks such as reading from and writing to files and more. The chatbot dynamically integrates with the OpenAI API to fetch and compute responses based on user inputs and predefined functions.
Creating a ToDo-List Website (gpt-4o-mini)
gpt3-preview.mp4
- Dynamic Conversation Handling: Leverages OpenAI's GPT Models to handle conversations, making appropriate API and function calls as required.
- File Operations: Includes functions to read from and write to files, enabling data retrieval and storage during interactions. Can also create directories, list files in a given directory and delete files (use with caution).
- ANSI Color Coding: Enhances the CLI experience by using ANSI color codes to differentiate between user inputs, GPT responses, and function calls.
![Screenshot 2024-07-03 at 14 04 39](https://private-user-images.githubusercontent.com/67104490/345413332-bdec5083-5dcb-4efb-be55-7c23e6692f3a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MjcwMjgsIm5iZiI6MTcyNTcyNjcyOCwicGF0aCI6Ii82NzEwNDQ5MC8zNDU0MTMzMzItYmRlYzUwODMtNWRjYi00ZWZiLWJlNTUtN2MyM2U2NjkyZjNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDE2MzIwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE5YmM2NjM2MzI1MTllOGM4YTdhY2VmYzMyZDBkN2JiNjIwNGQ1ZDgwOTVkYmU3YzdiMGI1MTQ2Yjc3OTI5ZjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7cnnilCsfIwqdMODrKKGXApzW858B6Fb4q9UDlytP9U)
To run this chatbot on your local machine, follow these steps:
-
Clone the Repository
git clone https://github.com/loyft/autotask-ai.git
Navigate to the project directory:
cd autotask-ai
-
Install Dependencies
Install necessary Python packages:
pip install -r requirements.txt
or
pip3 install -r requirements.txt
-
Set Up Environment Variables
Create a
.env
file in the root directory and add your OpenAI API key:API_KEY=your_openai_api_key_here
-
Run the Chatbot
python agent.py
or
python3 agent.py
-
Change GPT Model
Use commands via
/
to change the current GPT model./gpt
to display the currently active GPT model./gpt3
to use gpt-3.5-turbo/gpt4
to use gpt-4o/gpt4-mini
to use gpt-4o-mini (default) -
Usage Cost
Displays the Token usage and total cost of the response (prompt + completion)
-
Exit the Chatbot
To exit the Chat type
exit
when asked for a prompt.
Contributions are welcome! If you have suggestions or improvements, feel free to fork the repository and submit a pull request. 😊
Distributed under the MIT License. See LICENSE
for more information.