Building a customer service chatbot with OpenAI Agents SDK
Table of Contents
OpenAI Agents SDK was used to automate multi-turn conversations with two sets of agents, one playing the role of a chatbot, the other acting as the customer.
- Create a virtual environment
mkdir Costco_chatbot
cd Costco_chatbot
python -m venv .venv
- Activate virtual environment
source .venv/bin/activate
- Install OpenAI Agents SDK
pip install openai-agents
- Set up environment variables in a
.env
file[!NOTE] You can also set your model choice here, but I used the default OpenAIResponsesModel.
OPENAI_API_KEY="your_openai_api_key"
chatbotAgents.py
- Details and actual instructions for chatbot agents
- Individual multiturn testing or single shot
customerAgents.py
- Details about agents acting as the customer
- Function tool that returns an arbitrarily selected question
singleShot.py
- Single shot testing in batches or using an excel spreadsheet
runTests.py
- Automated multiturn testing
- Change the spreadsheet used in the function tool in
customerAgents.py
to use different datasets
voiceover.py
- Trying to use ElevenLABS for AI voiceover
- Unrelated to OpenAI Agents SDK
Vienna Zhao - [email protected]
Project Link: Costco customer chatbot project