The Assistants API allows you to build AI assistants within your own applications. An Assistant has instructions and can leverage models, tools, and knowledge to respond to user queries. The Assistants API is designed to help developers build powerful AI assistants capable of performing a variety of tasks. You can learn more about the OpenAI Assistant API here.
Find me on Socials at @dhawansolanki.
This Entrire Script has been taken reference from the Official Documentation from OpenAI Assistant.
This program includes basic and key steps to create and run an Assistant that uses Code Interpreter. Here, we're creating an Assistant, with the Code Interpreter tool enabled.
- Python 3.x
- OpenAI API key
- Clone the repository:
git clone https://github.com/dhawansolanki/OpenAI-Assistant.git
cd OpenAI-Assistant
- Create an Environment:
python -m venv /path/to/new/virtual/environment
- Activate Environment
For Mac:
source /path/to/new/virtual/environment/bin/activate
For Windows:
python -m venv c:\path\to\myenv
- Install the required dependencies:
pip install -r requirements.txt
Before running the script, you must set your OpenAI API key as an environment variable. This can be done in the command line or by setting it in a .env file.
Command line method:
export OPENAI_API_KEY='your_api_key_here'
Run the script with the following command:
python main.py
You can customize the script or build upon the code to create a more interactive experience.
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change. Being fully candid, I'm not great at staying up to date on my own repos.