This project implements an AI assistant powered by OpenAI's GPT models, capable of using various tools to enhance its capabilities. The assistant can execute Python code, run shell commands, perform web searches, and delegate tasks to "intern" AI models.
- Interaction with OpenAI's GPT models
- Execution of Python code
- Running of shell commands
- Web search capabilities using Bing Search API
- Integration with Perplexity.ai for additional research
- Task delegation to "intern" AI models
- Conversation history visualization
- Clone the repository
- Install the required dependencies:
pip install openai requests
- Set up the following environment variables:
OPENAI_API_KEY
: Your OpenAI API keyPERPLEXITY_API_KEY
: Your Perplexity.ai API keyBING_SEARCH_API_KEY
: Your Bing Search API key
Run the main script with a query:
python main.py -q "Your query here"
The conversation will be saved as a JSON file in the conversations
folder.
To visualize the conversation:
- Open the
visualizer.html
file in a web browser - Use the file input to select a JSON conversation file
- The conversation will be displayed with statistics and formatted messages
main.py
: Main script containing the AI assistant logictools.py
: Contains functions for Perplexity and Bing search integrationsvisualizer.html
: HTML file for visualizing conversations