Intent Args
Represents a Dialogflow intent. Intents convert a number of user expressions or patterns into an action. An action is an extraction of a user command or sentence semantics. To get more information about Intent, see:
How-to Guides
Example Usage
Dialogflow Intent Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.diagflow.Agent;
import com.pulumi.gcp.diagflow.AgentArgs;
import com.pulumi.gcp.diagflow.Intent;
import com.pulumi.gcp.diagflow.IntentArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var basicAgent = new Agent("basicAgent", AgentArgs.builder()
.displayName("example_agent")
.defaultLanguageCode("en")
.timeZone("America/New_York")
.build());
var basicIntent = new Intent("basicIntent", IntentArgs.builder()
.displayName("basic-intent")
.build(), CustomResourceOptions.builder()
.dependsOn(basicAgent)
.build());
}
}
Dialogflow Intent Full
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
import com.pulumi.gcp.serviceAccount.Account;
import com.pulumi.gcp.serviceAccount.AccountArgs;
import com.pulumi.gcp.projects.IAMMember;
import com.pulumi.gcp.projects.IAMMemberArgs;
import com.pulumi.gcp.diagflow.Agent;
import com.pulumi.gcp.diagflow.AgentArgs;
import com.pulumi.gcp.diagflow.Intent;
import com.pulumi.gcp.diagflow.IntentArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var agentProjectProject = new Project("agentProjectProject", ProjectArgs.builder()
.projectId("my-project")
.orgId("123456789")
.build());
var agentProjectService = new Service("agentProjectService", ServiceArgs.builder()
.project(agentProjectProject.projectId())
.service("dialogflow.googleapis.com")
.disableDependentServices(false)
.build());
var dialogflowServiceAccount = new Account("dialogflowServiceAccount", AccountArgs.builder()
.accountId("my-account")
.build());
var agentCreate = new IAMMember("agentCreate", IAMMemberArgs.builder()
.project(agentProjectService.project())
.role("roles/dialogflow.admin")
.member(dialogflowServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email)))
.build());
var basicAgent = new Agent("basicAgent", AgentArgs.builder()
.project(agentProjectProject.projectId())
.displayName("example_agent")
.defaultLanguageCode("en")
.timeZone("America/New_York")
.build());
var fullIntent = new Intent("fullIntent", IntentArgs.builder()
.project(agentProjectProject.projectId())
.displayName("full-intent")
.webhookState("WEBHOOK_STATE_ENABLED")
.priority(1)
.isFallback(false)
.mlDisabled(true)
.action("some_action")
.resetContexts(true)
.inputContextNames(agentProjectProject.projectId().applyValue(projectId -> String.format("projects/%s/agent/sessions/-/contexts/some_id", projectId)))
.events("some_event")
.defaultResponsePlatforms(
"FACEBOOK",
"SLACK")
.build(), CustomResourceOptions.builder()
.dependsOn(basicAgent)
.build());
}
}
Import
Intent can be imported using any of these accepted formats:
$ pulumi import gcp:diagflow/intent:Intent default {{name}}
Constructors
Properties
The list of platforms for which the first responses will be copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). Each value may be one of: FACEBOOK
, SLACK
, TELEGRAM
, KIK
, SKYPE
, LINE
, VIBER
, ACTIONS_ON_GOOGLE
, GOOGLE_HANGOUTS
.
The name of this intent to be displayed on the console.
The collection of event names that trigger the intent. If the collection of input contexts is not empty, all of the contexts must be present in the active user session for an event to trigger this intent. See the events reference for more details.
The list of context names required for this intent to be triggered. Format: projects/
Indicates whether this is a fallback intent.
Indicates whether Machine Learning is disabled for the intent. Note: If mlDisabled setting is set to true, then this intent is not taken into account during inference in ML ONLY match mode. Also, auto-markup in the UI is turned off.
The unique identifier of the parent intent in the chain of followup intents. Format: projects/
Indicates whether to delete all contexts in the current session when this intent is matched.
Indicates whether webhooks are enabled for the intent.