Skip to content
FacebookYouTubeX (Twitter)

How to Use GPT & Set of Variables to Make Enquiries About Products

This tutorial will show you how to combine global variables with GPT functionality in Pingstreams to create an intelligent product inquiry system that can answer customer questions about pricing and product details.

First, select “Globals” from the left sidebar menu in your Pingstreams dashboard.

Then, add a new global variable, as shown in the image below:

Adding Global Variable

Next, choose a Key for your variables and input your price list in the Value section.

See the example configuration below:

Price List Configuration

Now, return to the Blocks section to design the bot.

You’ll need an action called “Capture User Reply” to capture the customer’s response. You can assign an attribute to it. In this case, we used ‘UserReply’ as the attribute:

Capture User Reply

For the next block, use the ‘ChatGPT Task’ action.

You can see the prompt that includes the Global’s attribute created earlier under ‘pricetable’. Getting the perfect prompt might require a few attempts to get it just right:

ChatGPT Task Configuration

Finally, add a new reply block and simply choose the gpt_reply attribute:

Reply Block Configuration

That’s it! In the demonstration below, you can see how the bot finds the price in the table and shares it with the user:

Bot Demo

The system works by:

  1. Storing product data in global variables that can be accessed throughout the bot flow
  2. Capturing user queries about products or pricing
  3. Using GPT to intelligently parse the user’s request and match it against the stored product data
  4. Providing accurate responses based on the information in your price table

This method offers several advantages:

  • Dynamic pricing updates: Easily update prices in global variables without changing the bot flow
  • Flexible queries: Users can ask questions in natural language
  • Accurate responses: GPT intelligently matches user queries to your product data
  • Scalable solution: Add more products and information as needed
  • Cost-effective: No need for external database connections for simple product catalogs

This system is perfect for:

  • E-commerce product inquiries
  • Service pricing information
  • Restaurant menu and pricing
  • Course or training program costs
  • Subscription plan details
  • Product specification queries

To enhance this system further:

  • Add multiple global variables for different types of product information (specifications, availability, etc.)
  • Use structured data formats like JSON in your global variables for complex product catalogs
  • Implement conditional logic to handle different types of queries
  • Create specialized prompts for different product categories
  • Add follow-up questions to help users find exactly what they need

Here’s an example prompt structure for the ChatGPT Task:

You are a helpful product assistant. Use the following product information to answer customer questions:

{{pricetable}}

Customer question: {{UserReply}}

Please provide a helpful and accurate response based on the product information above. If the requested item is not available, suggest similar alternatives if possible.

This combination of global variables and GPT creates a powerful, flexible system for handling product inquiries in Pingstreams, providing customers with accurate, real-time information about your products and services.

Cheers, The Pingstreams Team