Abhinav Krishnan, Dan Pechi
We create an LLM-agent creator powered by another agent, that can generate code based on your requirements. The agent-creator is powered by a large language model (LLM) that is performing retrieval on a dataset of dspy.Module definitions. The agent-creator comes with a front-end chat interface that allows you to ask for code snippets, and will generate the code for you. The dataset was created by scraping GitHub for code containing dspy.Module definitions.
Clone the repository:
git clone https://github.com/danpechi/ADAS_DSPy.gitTo install the required packages, run the following command:
pip install -r requirements.txt- GitHub API:
Create a file called
.secretsin the root directory of the project. Generate a GitHub API token, and then add the following line to the file:"GITHUB_API_TOKEN": "<YOUR_API_TOKEN>" - DataBricks Token:
Create a folder called
.streamlit, and create a file calledsecrets.tomlinside it. Add the following line to the file:DB_TOKEN = "<YOUR_DB_TOKEN>"
To generate the data, run the following command:
python make_archive.pyThis script searches GitHub for code containing dspy.Module definitions, extracts the dspy.Module definitions from the search results and saves the extracted dspy.Module definitions to a CSV file, along with some metadata.
To deploy the agent creator LLM model, run the cells in the setup_notebook.ipynb notebook.
To open the chat interface, run the following command:
streamlit run chat-db.pyYou can now ask the chat interface to give you the code for an agent that you want!
Inspired by https://arxiv.org/abs/2408.08435