google-cloud-dialogflow overview (4.21.0)

com.google.cloud.dialogflow.v2

A client to Dialogflow API

The interfaces provided are listed below, along with usage samples.

AgentsClient

Service Description: Service for managing Agents.

Sample for AgentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (AgentsClient agentsClient = AgentsClient.create()) {  LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");  Agent response = agentsClient.getAgent(parent);  }  

AnswerRecordsClient

Service Description: Service for managing AnswerRecords.

Sample for AnswerRecordsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (AnswerRecordsClient answerRecordsClient = AnswerRecordsClient.create()) {  AnswerRecord answerRecord = AnswerRecord.newBuilder().build();  FieldMask updateMask = FieldMask.newBuilder().build();  AnswerRecord response = answerRecordsClient.updateAnswerRecord(answerRecord, updateMask);  }  

ContextsClient

Service Description: Service for managing Contexts.

Sample for ContextsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ContextsClient contextsClient = ContextsClient.create()) {  ContextName name =  ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");  Context response = contextsClient.getContext(name);  }  

ConversationsClient

Service Description: Service for managing Conversations.

Sample for ConversationsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ConversationsClient conversationsClient = ConversationsClient.create()) {  LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");  Conversation conversation = Conversation.newBuilder().build();  Conversation response = conversationsClient.createConversation(parent, conversation);  }  

ConversationDatasetsClient

Service Description: Conversation datasets.

Conversation datasets contain raw conversation files and their customizable metadata that can be used for model training.

Sample for ConversationDatasetsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ConversationDatasetsClient conversationDatasetsClient =  ConversationDatasetsClient.create()) {  ConversationDatasetName name =  ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]");  ConversationDataset response = conversationDatasetsClient.getConversationDataset(name);  }  

ConversationModelsClient

Service Description: Manages a collection of models for human agent assistant.

Sample for ConversationModelsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {  String name = "name3373707";  ConversationModel response = conversationModelsClient.getConversationModel(name);  }  

ConversationProfilesClient

Service Description: Service for managing ConversationProfiles.

Sample for ConversationProfilesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ConversationProfilesClient conversationProfilesClient =  ConversationProfilesClient.create()) {  ConversationProfileName name =  ConversationProfileName.ofProjectConversationProfileName(  "[PROJECT]", "[CONVERSATION_PROFILE]");  ConversationProfile response = conversationProfilesClient.getConversationProfile(name);  }  

DocumentsClient

Service Description: Service for managing knowledge Documents.

Sample for DocumentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (DocumentsClient documentsClient = DocumentsClient.create()) {  DocumentName name =  DocumentName.ofProjectKnowledgeBaseDocumentName(  "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");  Document response = documentsClient.getDocument(name);  }  

EntityTypesClient

Service Description: Service for managing EntityTypes.

Sample for EntityTypesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {  EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]");  EntityType response = entityTypesClient.getEntityType(name);  }  

EnvironmentsClient

Service Description: Service for managing Environments.

Sample for EnvironmentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {  GetEnvironmentRequest request =  GetEnvironmentRequest.newBuilder()  .setName(  EnvironmentName.ofProjectEnvironmentName("[PROJECT]", "[ENVIRONMENT]").toString())  .build();  Environment response = environmentsClient.getEnvironment(request);  }  

FulfillmentsClient

Service Description: Service for managing Fulfillments.

Sample for FulfillmentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (FulfillmentsClient fulfillmentsClient = FulfillmentsClient.create()) {  FulfillmentName name = FulfillmentName.ofProjectName("[PROJECT]");  Fulfillment response = fulfillmentsClient.getFulfillment(name);  }  

IntentsClient

Service Description: Service for managing Intents.

Sample for IntentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (IntentsClient intentsClient = IntentsClient.create()) {  IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");  Intent response = intentsClient.getIntent(name);  }  

KnowledgeBasesClient

Service Description: Service for managing KnowledgeBases.

Sample for KnowledgeBasesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.create()) {  KnowledgeBaseName name =  KnowledgeBaseName.ofProjectKnowledgeBaseName("[PROJECT]", "[KNOWLEDGE_BASE]");  KnowledgeBase response = knowledgeBasesClient.getKnowledgeBase(name);  }  

ParticipantsClient

Service Description: Service for managing Participants.

Sample for ParticipantsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ParticipantsClient participantsClient = ParticipantsClient.create()) {  ConversationName parent =  ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");  Participant participant = Participant.newBuilder().build();  Participant response = participantsClient.createParticipant(parent, participant);  }  

SessionsClient

Service Description: A service used for session interactions.

For more information, see the API interactions guide.

Sample for SessionsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (SessionsClient sessionsClient = SessionsClient.create()) {  SessionName session = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");  QueryInput queryInput = QueryInput.newBuilder().build();  DetectIntentResponse response = sessionsClient.detectIntent(session, queryInput);  }  

SessionEntityTypesClient

Service Description: Service for managing SessionEntityTypes.

Sample for SessionEntityTypesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {  SessionEntityTypeName name =  SessionEntityTypeName.ofProjectSessionEntityTypeName(  "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");  SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);  }  

VersionsClient

Service Description: Service for managing Versions.

Sample for VersionsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (VersionsClient versionsClient = VersionsClient.create()) {  VersionName name = VersionName.ofProjectVersionName("[PROJECT]", "[VERSION]");  Version response = versionsClient.getVersion(name);  }  

com.google.cloud.dialogflow.v2.stub

com.google.cloud.dialogflow.v2beta1

A client to Dialogflow API

The interfaces provided are listed below, along with usage samples.

AgentsClient

Service Description: Service for managing Agents.

Sample for AgentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (AgentsClient agentsClient = AgentsClient.create()) {  LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");  Agent response = agentsClient.getAgent(parent);  }  

AnswerRecordsClient

Service Description: Service for managing AnswerRecords.

Sample for AnswerRecordsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (AnswerRecordsClient answerRecordsClient = AnswerRecordsClient.create()) {  GetAnswerRecordRequest request =  GetAnswerRecordRequest.newBuilder().setName("name3373707").build();  AnswerRecord response = answerRecordsClient.getAnswerRecord(request);  }  

ContextsClient

Service Description: Service for managing Contexts.

Sample for ContextsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ContextsClient contextsClient = ContextsClient.create()) {  ContextName name =  ContextName.ofProjectSessionContextName("[PROJECT]", "[SESSION]", "[CONTEXT]");  Context response = contextsClient.getContext(name);  }  

ConversationsClient

Service Description: Service for managing Conversations.

Sample for ConversationsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ConversationsClient conversationsClient = ConversationsClient.create()) {  LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");  Conversation conversation = Conversation.newBuilder().build();  Conversation response = conversationsClient.createConversation(parent, conversation);  }  

ConversationProfilesClient

Service Description: Service for managing ConversationProfiles.

Sample for ConversationProfilesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ConversationProfilesClient conversationProfilesClient =  ConversationProfilesClient.create()) {  ConversationProfileName name =  ConversationProfileName.ofProjectConversationProfileName(  "[PROJECT]", "[CONVERSATION_PROFILE]");  ConversationProfile response = conversationProfilesClient.getConversationProfile(name);  }  

DocumentsClient

Service Description: Service for managing knowledge Documents.

Sample for DocumentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (DocumentsClient documentsClient = DocumentsClient.create()) {  DocumentName name =  DocumentName.ofProjectKnowledgeBaseDocumentName(  "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");  Document response = documentsClient.getDocument(name);  }  

EntityTypesClient

Service Description: Service for managing EntityTypes.

Sample for EntityTypesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {  EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]");  EntityType response = entityTypesClient.getEntityType(name);  }  

EnvironmentsClient

Service Description: Service for managing Environments.

Sample for EnvironmentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {  GetEnvironmentRequest request =  GetEnvironmentRequest.newBuilder()  .setName(  EnvironmentName.ofProjectEnvironmentName("[PROJECT]", "[ENVIRONMENT]").toString())  .build();  Environment response = environmentsClient.getEnvironment(request);  }  

FulfillmentsClient

Service Description: Service for managing Fulfillments.

Sample for FulfillmentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (FulfillmentsClient fulfillmentsClient = FulfillmentsClient.create()) {  FulfillmentName name = FulfillmentName.ofProjectName("[PROJECT]");  Fulfillment response = fulfillmentsClient.getFulfillment(name);  }  

IntentsClient

Service Description: Service for managing Intents.

Sample for IntentsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (IntentsClient intentsClient = IntentsClient.create()) {  IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");  Intent response = intentsClient.getIntent(name);  }  

KnowledgeBasesClient

Service Description: Service for managing KnowledgeBases.

Sample for KnowledgeBasesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.create()) {  KnowledgeBaseName name =  KnowledgeBaseName.ofProjectKnowledgeBaseName("[PROJECT]", "[KNOWLEDGE_BASE]");  KnowledgeBase response = knowledgeBasesClient.getKnowledgeBase(name);  }  

ParticipantsClient

Service Description: Service for managing Participants.

Sample for ParticipantsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (ParticipantsClient participantsClient = ParticipantsClient.create()) {  ConversationName parent =  ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");  Participant participant = Participant.newBuilder().build();  Participant response = participantsClient.createParticipant(parent, participant);  }  

SessionsClient

Service Description: A service used for session interactions.

For more information, see the API interactions guide.

Sample for SessionsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (SessionsClient sessionsClient = SessionsClient.create()) {  SessionName session = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");  QueryInput queryInput = QueryInput.newBuilder().build();  DetectIntentResponse response = sessionsClient.detectIntent(session, queryInput);  }  

SessionEntityTypesClient

Service Description: Service for managing SessionEntityTypes.

Sample for SessionEntityTypesClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {  SessionEntityTypeName name =  SessionEntityTypeName.ofProjectSessionEntityTypeName(  "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");  SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);  }  

VersionsClient

Service Description: Service for managing Versions.

Sample for VersionsClient:

  // This snippet has been automatically generated and should be regarded as a code template only.  // It will require modifications to work:  // - It may require correct/in-range values for request initialization.  // - It may require specifying regional endpoints when creating the service client as shown in  // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library  try (VersionsClient versionsClient = VersionsClient.create()) {  VersionName name = VersionName.ofProjectVersionName("[PROJECT]", "[VERSION]");  Version response = versionsClient.getVersion(name);  }  

com.google.cloud.dialogflow.v2beta1.stub