GPTBoost Props

Enhance log records with custom properties

Apart from the HEADERS used to omit logging GPTBoost offers additional custom properties that you can include in the HEADERS to add more data to the logs. Tracking of such supplementary details allows seamless user and thread management.

Include any custom property that will benefit your work. Just remember to incorporate them in the HEADERS with GPTBoost-prefix and they'll be added to your OpenAI request ;).

Utilizing Properties:

  • The Key follows the format GPTBoost-Prop-{PropertyName}, where you replace {Name} with your chosen property name.

  • The Value represents the string value associated with the property in the request.

# This example is for v1+ of the openai: https://pypi.org/project/openai/
from openai import OpenAI

client = OpenAI( 
    base_url = "https://turbo.gptboost.io/v1",
    api_key = os.getenv("OPENAI_API_KEY"),
)

# Custom Headers
headers = {
      "GPTBoost-Prop-Plan": "free",
      "GPTBoost-Prop-IP": "1.1.1.1",
      "GPTBoost-Prop-Session": "session_id",
      "GPTBoost-Prop-User": "user_id"
  }

response = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "user", "content": "Tell me a joke about GPTBoost"},
    ], 
    extra_headers=headers
)

print(response.choices[0].message.content)

Properties Example Usage:

  • GPTBoost-Prop-User - Collecting data for a specific user by adding its Id to the request allows you to track individual users' preferences, behaviours, and trends. Say goodbye to generic insights: now you can serve personalized experiences and understand user journeys like never before.

  • GPTBoost-Prop-Session - Adding the Session-Id helps you group related requests together, creating a coherent storyline. This is a game-changer when it comes to analyzing multi-step interactions or complex dialogues. For instance, you can evaluate the effectiveness of a chatbot's guidance throughout a session, identify key turning points, and assess user satisfaction based on how sessions are structured.

  • GPTBoost-Prop-Plan - Knowing a user's plan level (e.g., free, basic, premium) allows you to correlate user behaviour with their subscription tier, helping you understand the value users derive from different plans. For instance, you can analyze the cost-effectiveness of each plan, optimize feature offerings, and even predict user churn by identifying patterns among subscription levels.

  • GPTBoost-Prop-Ip - By capturing unique IP addresses tied to each user's device or network, you gain valuable insights. Discover where your users are located, ensuring tailored responses based on their geographical context. Improve security by detecting unauthorized access through unusual IP patterns.

By harnessing the magic of GPTBoost custom properties, your data analysis transforms into a dynamic adventure. You can uncover personalized insights, enhance user experiences, and make data-driven decisions that propel your LLM-powered application to new heights! 🚀

Last updated