This is a project consisting of three crews which perform the following operation -
- Prompt Analysing - This analyses the prompt and routes it to the specific crew
- Math Operations - This performs mathematical operation based on a given prompt
- Job Description Generation - This provides a job description based on a given prompt which describes the company, their needs, benefits that they will provide etc.
The prompts are sent through a post request to a REST API made using Flask. The prompt is sent using json, in the following format -
{
"prompt" : "your_prompt"
}
-
Clone the repo
-
Install dependencies
pip install -r requirements
- Install ollama and pull llama3
curl -fsSL https://ollama.com/install.sh | sh
ollama serve
ollama pull llama3
- Set the env variables for SerperDevTool and OpenAI
env SERPER_API_KEY="your_api_key"
env OPENAI_API_KEY="your_api_key"
- Run
python app.py
- Test the API
curl -X POST http://127.0.0.1:5000/route_prompt -H "Content-Type: application/json" -d '{"prompt": "3+4"}'
For different prompts, different outputs can be observed -
- For a mathematical prompt the resultant output is sent back.
- For a job description prompt the resultant job description is stored in the 'job_posting.md' file.
- For a prompt that is neither of the above, an error message is sent back.
(The WebSearchTool has been commented out due to unavailability of OPENAI key, if the key is present then please use the tool)