extracting list of products and correcting for pro...
# šŸ¤help
p
I'm building a simple ordering tool for my customers and I'd like them to input the order in natural language. e.g 5 Apples, 6 x bananas, 8 sliced cheese, 5 packs of chips I'd like to: 1/ determine the correct product code for each product - I've set up a custom entity list that has all the codes, and synonyms for the wonrderfully creative ways the customers describe the product. 2/ insert the output into a new table row that extracts the quantity for the relevant product and puts it in the right column. In a native chatgpt instance, I can get this to work by providing the product list and it turns it into a neat table with the correct sku, product name and quantity. Struggling to achieve the same thing in botpress.
b
Hello, taking the order in natural language and extracting the items is what I see as the most difficult, it is achieved but there is a lot of trial and error until you have the correct result, it requires a good prompt and it can be done, once these items have been extracted, you can do it. the respective queries and showing the answer is now easier. But you know that people have many ways of ordering and you have to manage most of them, it would be nice if they only ordered "5 Apples, 6 x bananas, 8 sliced ​​cheese, 5 packs of chips" but they can come with anything haha
Have you made any progress with capturing that initial input and identifying the items?
This must be resolved in parts and the first thing is to be able to identify the input items and separate them.
s
To build your ordering tool in Botpress where customers can input orders in natural language and you can extract product codes and quantities to insert into a table, follow these steps: 1. Store Product Catalog in a Table: First, ensure your product catalog, including product codes (SKU) and synonyms for each product, is stored in a Botpress table. This will facilitate the mapping of customer inputs to your product codes. 2. Use [Raw Capture Card](https://botpress.com/docs/cloud/toolbox/capture-information/)**:** Utilize the Raw Capture card to extract the entire customer order input. This card captures the raw text input from the user and stores it in a variable, allowing you to process this data in the next steps​​. 3. Find [Table Records](https://botpress.com/docs/cloud/toolbox/table-actions/)**:** Employ the "Find Records" action within the Table cards to search and extract the top products that match the user's input. This step can help narrow down the potential products that the customer is referring to, based on the synonyms and product names in your catalog​​.
4. [AI Task Card](https://botpress.com/docs/cloud/toolbox/ai-task/) for Product and Quantity Extraction: Use an AI Task Card to process the raw input along with the top product matches from the previous step. This AI Task should be designed to extract the product names and their quantities from the natural language input. Provide clear instructions and inputs to the AI Task Card to ensure accurate extraction of product details and quantities​​. 5. Store the Result in a Workflow Variable: Once the AI Task Card processes the input, store the extracted information (product codes and quantities) in a workflow variable. This variable will be used to insert the records into the table. 6. [Create Table](https://botpress.com/docs/cloud/toolbox/table-actions/) Records: Finally, use the "Insert Record" card to add new records into your order table, using the product codes and quantities stored in the workflow variable from the AI Task Card processing. This action will create a new row in the table for each product in the order, correctly capturing the order details in a structured format​​. By following these steps, you can effectively replicate the functionality of extracting and tabulating product orders from natural language input, similar to what you achieved with a native ChatGPT instance.
3 Views