OpenAI Wrappers

For your convenience, we've wrapped OpenAI's and Azure OpenAI's libraries to make it SUPER easy to automagically collect analytics and responses for your OpenAI queries.

If you want to take a look at our open source OpenAI wrappers, check out https://github.com/orgs/Spryngtime/repositories

We highly recommend setting a user field in your OpenAI calls. Setting user will also help you track and rate limit as per OpenAI's docs.

Here's an example in node:


const chatCompletion = await openai.chat.completions.create({
    messages: [{ role: 'user', content: query }],
    model: 'gpt-3.5-turbo-1106',
    max_tokens: 100,
    user:"user_123456", // Set this to the customer/user you want the query to be tracked to
});

What you get out of the box with one line change:

  • Tracking latency

  • All your prompts and responses logged

  • All your OpenAI usage logged and tracked

Last updated