I have created a simple playbook in Conversational agent. The instruction in the playbook is to connect to tool to search for products. The tool is configured with OpenAPI schema that points to Cloud Function URL. The setup works, and I am able to call the playbook using postman.
I am returning a JSON payload from Cloud function but Playbook would summarize the results in a plain text. e.g. I have found 3 products that match your search criteria and these are the 3 products. Which is okay, but I am also looking to get the exact JSON payload that is returned so I can process the data for different use case. How do I get get this? Below is the response part of OpenAPI schema. Please suggest if you have any thoughts on how to resolve this. I can get this working with Webhook but that will be without the playbook route.
"responses": {
"200": {
"description": "Successfully got results (may be empty)",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the response"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Product Name": {
"type": "string",
"description": "Name of the product"
},
"Product Price": {
"type": "number",
"description": "Price of the product"
}
}
}
}
}
}
}
}
},
"404": {
"description": "Cannot reach endpoint (may be empty)"
}
}
It seems that Playbook Agents doesn't support custom JSON payload as of the moment. I suggest submitting this as a feature request. You can try filing this as a feature request in Google Cloud. They might consider adding this for future updates.