Skip to main content

Example 1: Your first chatbot

Start by building a minimal chatbot application using a LaunchDarkly AI Config with Anthropic’s Claude.

Step 1.1: Project setup

First, create a new directory for your project:
Then, create a virtual environment and activate it:

Step 1.2: Install dependencies

Install the required packages:
Create a requirements.txt file:

Step 1.3: Environment configuration

First, add .env to your .gitignore file to keep credentials secure:
Now create a .env file in your project root:

Step 1.4: Create the basic chatbot

Create a file called simple_chatbot.py and add the following:

Step 1.5: Run your basic chatbot

Run the chatbot:
You should see output like this:
Try asking questions and chatting with the AI. The chatbot automatically uses whichever AI provider you configured. You now have a working chatbot with multi-provider support.