If you have not read my series of blog posts on how I connected Sitecore SaaS products and chat gpt for a hackathon use case, you can start below and follow along.
Now, after I was done with the use case implementation as I mentioned on my last blog post here, I started thinking can I use Sitecore Connect as my data connection instead of chat gpt directly. I wanted to experiment and I was actually successful, lets see how.
I created a different decisioning model on Personalize instance for this very purpose
It is pretty simple because all logic for it will be on Sitecore connect this time around. It would look like this
Programmable here is just reading from our event data that we pushed originally and add geo data to the same. You can read about this on my blog post here
Data system here points to a new data connection created that is essentially pointing to webhook created on Sitecore Connect. It would look something like below
This is how the webhook is configured on Sitecore Connect in recipes
what this hook does is reads the prompt that is read/passed on Personalize data connection, sends that to open AI and then updates the guest on CDP with output from chat gpt.
Do note that UpdateGuest is a custom step I had added though it was very simple and does not have anything crazy in there
Action Name: UpdateGuest
Method: POST
Path: /v2/guests/Guestref Step 1/extext -> GuestRef is dynamic from step 1 payload which has guest reference ID that is needed to update guest on CDP and is unique identifier.
Request Type: JSON Request Body
Response Type: JSON Response
For this flow to work, connections should be in place for both Open AI and CDP account on which user will get updated. This was simple when all information needed is on hand. For instance, for CDP below are needed:
Region
Client Key
API Token
You can get these from CDP, developer settings once you are logged in
For open AI, you will need API key and that is it!
When you start the recipe and fire off the variant that would fire off decisioning path noted above, the whole flow should work and you should see that on CDP the guest is updated with the output from chat GPT. Of course, this is not perfect, but, this proves that low code/no code is possible!