Recommendations AI

189 views
Skip to first unread message

Mauli Patel

unread,
Apr 3, 2021, 10:43:45 PM4/3/21
to cloud-recommendations-users
Hi, 

I am still struggling to get the recommended products from the Recommendations AI API in POSTMAN. I have successfully created a model, placement everything. 

I am using API - https://retail.googleapis.com/v2/projects/project-id/locations/global/catalogs/default_catalog/placements/placement-id:predict

I am defining data like this.       
data='{
          "userEvent": {
               "eventType": "detail-page-view",
               "userInfo": {
                    "visitorId": "456",
                    "userId": "123"
               },
              "productEventDetail": {
                  "productDetails": [
                       {
                        "id": "p1004"
                       }
                  ]
              }
         }
     }'

Can anyone give me an example of how I can define the data with this API to get the recommended products? 

Mauli Patel

unread,
Apr 5, 2021, 8:57:34 AM4/5/21
to cloud-recommendations-users
Can anyone reply to me asap? 

elarson

unread,
Apr 5, 2021, 11:53:45 AM4/5/21
to cloud-recommendations-users
Here's a simple curl script with a predict request.  The json format you're using doesn't match the v2 schema, that looks like the beta format.
predict.sh

Mauli Patel

unread,
Apr 5, 2021, 12:40:52 PM4/5/21
to cloud-recommendations-users
When I tried the example given by you, it returned an attribute token. not the product list. 

To display the products what should we do? Which API needs to try?

Eric Larson

unread,
Apr 5, 2021, 1:05:49 PM4/5/21
to Mauli Patel, cloud-recommendations-users
You probably want to take out the filter tag

--
You received this message because you are subscribed to a topic in the Google Groups "cloud-recommendations-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cloud-recommendations-users/S9FYesFSYmg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cloud-recommendatio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-recommendations-users/ce0f5376-fe9c-45a5-9e05-11e6f8b3fe87n%40googlegroups.com.

Mauli Patel

unread,
Apr 5, 2021, 1:06:41 PM4/5/21
to cloud-recommendations-users
I did take out the filter tag. 

Eric Larson

unread,
Apr 5, 2021, 1:10:18 PM4/5/21
to Mauli Patel, cloud-recommendations-users
Are you seeing any results in the admin console when you use the Prediction Preview for that placement?

Mauli Patel

unread,
Apr 5, 2021, 1:11:08 PM4/5/21
to cloud-recommendations-users
no, I am not able to see there too.

Peng Ren

unread,
Apr 5, 2021, 1:56:13 PM4/5/21
to Mauli Patel, cloud-recommendations-users
Hi Mauli,

Could you please give us your project number so that we can help to debug on our side.
My guess is that since you did not upload any data to our system, we cannot predict you anything even for recently-viewed placement type.

Thanks,

Peng

You received this message because you are subscribed to the Google Groups "cloud-recommendations-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-recommendatio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-recommendations-users/b83759fb-4de4-4a07-836b-42e12ecaac3en%40googlegroups.com.

Peng Ren

unread,
Apr 5, 2021, 4:58:58 PM4/5/21
to Mauli Patel, cloud-recommendations-users
Thanks for your reply Mauli(in a private channel).

I checked the status of your project. Basically, the model you queried for prediction was a recently viewed model type. For this type of model, it will just return product items that are recently viewed by the user/visitor from our user event logs. To be able to get prediction results, you need to make sure to set a visitor id in your prediction request('s user event) that you have already ingested user events for that visitor. Could you try to do that and see whether it works? Thanks.

Best,

Peng

Mauli Patel

unread,
Apr 5, 2021, 5:06:06 PM4/5/21
to Peng Ren, cloud-recommendations-users

But for that recently viewed model type it returned only attribute token. it didn't return any product item. 


​I need to return product list based on the visitor id. 







Thanks & Regards,
Mauli Patel

From: Peng Ren <gei...@google.com>
Sent: Monday, April 5, 2021 3:58 PM
To: Mauli Patel
Cc: cloud-recommendations-users
Subject: Re: [cloud-recommendations-users] Re: Recommendations AI
 
Caution: Please do not click links or open attachments unless you recognize the sender and know the content is safe.

============================================================================================================================ Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra. ============================================================================================================================

Peng Ren

unread,
Apr 5, 2021, 6:38:02 PM4/5/21
to Mauli Patel, cloud-recommendations-users
That's the intended behavior as I mentioned before: there were no recently viewed items by that visitor/user specified in your prediction request. Thanks.
Reply all
Reply to author
Forward
0 new messages