4
votes

I am working on automating the deployment of my agent, but I'm having trouble doing some steps programmatically.

Dialogflow Fulfillment URL I was able to get Export/Restore to work using the Dialogflow Enterprise API: https://cloud.google.com/dialogflow-enterprise/docs/reference/rest/v2beta1/projects.agent/export and https://cloud.google.com/dialogflow-enterprise/docs/reference/rest/v2beta1/projects.agent/restore with the agentContent. But, since the agentContent is an encoded string, there is no way to replace the Fulfillment URL before restoring. Is there a way to update the Fulfillment URL via API?

Dialogflow Google Assistant Integration Settings Same question with the Google Assistant Integration Settings. Because this is part of the Dialogflow console, I see this as part of the agent. Ideally, we can programmatically create all parts of the agent. Is this available or on the roadmap?

Google Actions: Action Discovery and Update Lastly, there is the Action Discovery and Update section of the Google Actions console, where we enable intents for push or daily updates. Is there a way to programmatically do this as well?

Thanks.

2

2 Answers

1
votes

There is no way to update the fulfilment URL through the API.

0
votes

agent_content is indeed an encoded byte string of the zip file. But it's possible to programmatically generate the byte string after editing the contents of the export before zipping it.

Here's a python code snippet that may help:-

with open("skeleton_bot/agent.json", "r") as jsonFile:
    data = json.load(jsonFile)

data['webhook']['url'] = "https://yoururl.com"

with open("skeleton_bot/agent.json", "w") as jsonFile:
    json.dump(data, jsonFile)

shutil.make_archive('skeleton_bot', 'zip', 'skeleton_bot')

with open("../config/skeleton_bot.zip", 'rb') as file_data:
    agent_content = file_data.read()

You can then use this byte string to import/restore to dialogflow