A versatile and customizable language model assistant using OpenAI.
This project is a Python-based implementation that utilizes OpenAI's GPT model to create a helpful assistant capable of answering various questions, extracting information from web pages, and performing several other tasks. The assistant is easily extensible with new tools and features, allowing developers to tailor the functionality to specific use cases.
- Python 3.6 or higher
- virtualenv
- Clone the repository:
git clone https://github.com/theodo-group/langchain-agent.git
- Navigate to the project directory:
cd langchain-agent
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install the required packages:
pip install -r requirements.txt
- Make sure your virtual environment is active:
source venv/bin/activate
- Run the
app.py
script:
python app.py
The assistant will process the queries provided in the app.py
file and print the results.
To use the assistant with custom queries, modify the app.py
file or create a new script that imports and initializes the Assistant
class.
To add new tools or features to the assistant, create a new Tool
instance and add it to the tools
list in the tools.py
file. Make sure to provide a unique name, a function that implements the tool's functionality, and a description.
You can also create new prompt templates and output parsers by extending the base classes provided by the langchain
library.
- OpenAI for creating the GPT language model
- The
langchain
library for providing a convenient way to interact with language models