Learn how to integrate and use OpenAI’s API with Galileo’s wrapper client
When working with OpenAI’s API, it’s important to set up your environment and client correctly to ensure secure and efficient API calls. This guide shows you how to create a basic integration using Galileo’s OpenAI client wrapper.
The Galileo OpenAI wrapper currently only supports the synchronous chat completions API.
Set Up Environment Variables
Create a .env
file in your project root:
This assumes you are using a free Galileo account. If you are using a custom deployment, then you will also need to add the URL of your Galileo Console:
Install Required Dependencies
Install the required dependencies for your app. If you are using Python, create a virtual environment using your preferred method, then install dependencies inside that environment:
Initialize the Client
Create a Chat Completion
Your logging is now set up! You are ready to configure metrics for your project.