The Humanloop Python SDK allows you to easily replace your openai.ChatCompletions.create() calls with a humanloop.chat() call that, in addition to calling OpenAI to get a response, automatically logs the data to your Humanloop project.
This guide assumes you’re using an OpenAI model. If you want to use other providers or your own model please also look at our guide to using your own model.
First you need to install and initialize the SDK. If you have already done this, skip to the next section.
Open up your terminal and follow these steps:
Now you can use the SDK to generate completions and log the results to your project:
Navigate to your project’s Logs tab in the browser to see the recorded inputs, messages and responses of your chat.
🎉 Now that you have chat messages flowing through your project you can start to log your end user feedback to evaluate and improve your models.