It took a while but I managed to create the integration with Make and wait for the Make response to enrich the conversation with the user.
This means you can send a request to Make, wait for Make to do something with it (e.g. check calendar availability, book an appointment, extract information from a CRM based on payload) and send the information back with the 200 response. The information is passed to the LLM that can use it to provide specific answers to the user…unlimited possibilities!
Code below.
Note you will need to edit / add the variables you need
import requests
def make_webhook(player_name: str):
"""
Send a request to Make.com when the chat ends and capture the response.
Args:
player_name (string): The player's name at the end of the chat.
"""
# Your Make.com webhook URL
url = "https://hook.eu2.make.com/XXXXXXXXXXXX"
# Payload to send with the request
payload = {
"player_name": player_name
}
# Log payload to verify it
print("Payload being sent:", payload)
# Sending the POST request to the webhook URL
try:
response = requests.post(url, json=payload, timeout=10)
# Log status code and response content
print(f"Status code: {response.status_code}")
print(f"Response content: {response.text}")
# Check if the request was successful
if response.status_code == 200:
# Capture response data
response_data = response.json()
print("Webhook sent successfully!")
print("Response from webhook:", response_data)
# Example: Extracting specific information from the response
message = response_data.get("message", "No message received")
additional_info = response_data.get("additional_info", {})
# Return AI-ready response
ai_response = {
"player_name": player_name,
"message": message,
"additional_info": additional_info
}
return ai_response
else:
print(f"Failed to send webhook. Status code: {response.status_code}, Response: {response.text}")
return None
except requests.exceptions.Timeout:
print("The request timed out")
return None
except requests.exceptions.RequestException as e:
# Handle any request exceptions
print(f"An error occurred: {e}")
return None
# Example usage:
player_name = "LeBron James" # Replace this with the actual player's name from the chat
ai_data = make_webhook(player_name) # Only calling make_webhook once and storing the result
# Checking if the ai_data is available and printing it
if ai_data:
print("AI can now process the following data:", ai_data)
Just a small correction on the code: you don’t have to call the function manually, as the bot will automatically call and fill in the player_name parameter for you.
Also, instead of using return, just print the data directly within the function. This will simplify things!
Example:
import requests
def make_webhook(player_name: str):
"""
Send a request to Make.com when the chat ends and capture the response.
Args:
player_name (string): The player's name at the end of the chat.
"""
# Your Make.com webhook URL
url = "https://hook.eu2.make.com/XXXXXXXX"
# Payload to send with the request
payload = {
"player_name": player_name
}
# Log payload to verify it
print("Payload being sent:", payload)
# Sending the POST request to the webhook URL
try:
response = requests.post(url, json=payload, timeout=10)
# Log status code and response content
print(f"Status code: {response.status_code}")
print(f"Response content: {response.text}")
# Check if the request was successful
if response.status_code == 200:
# Capture response data
response_data = response.json()
print("Webhook sent successfully!")
print("Response from webhook:", response_data)
# Example: Extracting specific information from the response
message = response_data.get("message", "No message received")
additional_info = response_data.get("additional_info", {})
# Return AI-ready response
ai_response = {
"player_name": player_name,
"message": message,
"additional_info": additional_info
}
print("AI can now process the following data:", ai_response)
else:
print(f"Failed to send webhook. Status code: {response.status_code}, Response: {response.text}")
except requests.exceptions.Timeout:
print("The request timed out")
except requests.exceptions.RequestException as e:
# Handle any request exceptions
print(f"An error occurred: {e}")
When you create the pickaxe you now have an act section to create the integration.
Unless you need to do other operations in Make, you can create an action with the CRM in Pickaxe (I’m assuming it has APIs if you are using Make to connect to it)
Yes, you can add this code in the “Act” section of the builder, as @andreab mentioned above. We have also just added a public Make integration which you should be able to see in the builder as well! It looks like this:
Yes you can. But I am not finding that easy to do the integration. Sure, a simple one variable was ok, but beyond that, I cannot seem to figure it out.