A production-ready customer support agent using Weave and W&B Inference.
This project implements a customer support agent that leverages Weave and OpenAI's capabilities to provide efficient and safe customer interactions. It includes guardrails to ensure account and content safety, making it suitable for production use.
This repository accompanies a tutorial article. You can read it here.
- Python 3.8 or higher
- Weave library
- OpenAI API key (create an account at OpenAI)
- W&B account (create an account at Weights & Biases)
- Clone the repository:
git clone https://github.com/yourusername/customer-support-agent.git cd customer-support-agent - Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
Create a
.envfile in the root directory and add your API keys:echo "WANDB_API_KEY=your-api-key" >> .env
- Run the application:
python src/main.py
customer-support-agent/
├── .gitignore
├── requirements.txt
└── src/
├── agent.py
├── guardrails.py
└── main.py
- Weave: A framework for building and deploying machine learning applications.
- Guardrails: Safety checks implemented to ensure that the agent operates within defined safety parameters.
- Guardrail Implementation: The
FlaggedAccountGuardrailclass inguardrails.pydemonstrates how to implement safety checks for flagged accounts, ensuring that sensitive operations are restricted. - Asynchronous Operations: The use of
asyncinrun_guarded_agentinagent.pyallows for non-blocking execution, improving the responsiveness of the customer support agent.
This project is licensed under the MIT License. See the LICENSE file for details.