Slack Support Bot, Cites Sources using Multiple Indexes

Concepts: Document Indexes, Metadata, Zapier, Slack, Citing Sources, Combining Sources

Slack Support Bot, Cites Sources using Multiple Indexes Example Workflow

Passing JSON Arrays in Zapier can be tricky. Instead, you can use Code Blocks to make it easier.

You can use the follow code snippet as inspiration for your own API calls with Zapier Code Blocks and Python.

1 import requests
2
3 # Replace with your actual Vellum API key
4 VELLUM_API_KEY = "..."
5
6 url = "https://predict.vellum.ai/v1/execute-workflow"
7
8 headers = {
9 "Content-Type": "application/json",
10 "X_API_KEY": VELLUM_API_KEY
11 }
12
13 data = {
14 "workflow_deployment_name": "vellum-customer-support-q-a-demos",
15 "release_tag": "LATEST",
16 "inputs": [
17 {
18 "type": "STRING",
19 "name": "question",
20 "value": input_data["user_question"] # whatever Zapier values you want to use here
21 }
22 ]
23 }
24
25 response = requests.post(url, headers=headers, json=data)
26
27 # Print the response from the server
28 print(response.status_code)
29 print(response.json())
30
31 return response.json()
Built with