Building a Custom-Label Integrated Application with Pulze.ai and OpenAI's Python SDK
This guide will help you build a simple Python application that demonstrates how to use Pulze.ai with OpenAI’s Python SDK.
Step 1: Setup
Firstly, you need to install OpenAI’s Python SDK. You can do this using pip:
Next, setup your Pulze API key and base URL:
Replace <$PULZE_API_KEY>
with your actual Pulze API key.
Step 2: Creating a Text Response
Create a text response using a custom model from Pulze:
Step 3: Creating a Chat Response
Step 4: Adding Custom Labels
You can add custom labels as headers for your model requests. These labels will appear in the logs, making it easier for you to filter and locate specific requests.
Step 5: Output
Finally, print your responses:
By following these steps, you should have a basic app that interacts with Pulze.ai using OpenAI’s Python SDK. The app sends a text and chat request and gets responses from the Pulze.ai platform. The app also shows you how to use custom labels, which can be useful for filtering and locating specific requests.
Was this page helpful?