Robert Levy
Robert Levy

Reputation: 29073

Create dialogflow agent programmatically

Is there a way to programmatically create a new dialogflow agent programmatically?

I've done gcloud projects create [name] followed by gcloud services enable dialogflow.googleapis.com

I assumed this would be enough to use the projects.agent.import API but the API is giving an error:

Dialogflow API has not been used in project {REDACTED} before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/dialogflow.googleapis.com/overview?project={REDACTED} then retry.

Is there really no way to spin up a new project without interacting with the dialogflow console?

Upvotes: 9

Views: 1915

Answers (4)

Nikhil Savaliya
Nikhil Savaliya

Reputation: 2166

According to new release you can now create agents with Rest API,

  1. https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects/agent

For more info, Release Note of June 13, 2019

https://cloud.google.com/dialogflow/docs/release-notes

Upvotes: 4

Anthony V
Anthony V

Reputation: 2227

You can now create and update agents with the API. See the REST and RPC documentation.

Upvotes: 1

Arghya Polley
Arghya Polley

Reputation: 1

Unfortunately you can't create any agent directly from their dashboard, though if you can pass the api which can fetch the agent creation function then might be its been possible. It might be tough at the beginning and not sure whether google will approve it or not as they offer the integration only at the end to deliver the service.

Upvotes: 0

Alberto
Alberto

Reputation: 672

If you check the v2 API documentation, you won't find any create method for projects.agent.

What you are doing is to create a new project. You should first assign the Dialogflow API to the project in Google Cloud Platform.

enter image description here

Upvotes: -1

Related Questions