The interfaces provided are listed below, along with usage samples.
============ AgentsClient ============
Service Description: Manages conversational agents.
Refer to [documentation](https://dialogflow.com/docs/agents) for more details # about agents.
Standard methods.
Sample for AgentsClient:
try (AgentsClient agentsClient = AgentsClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Agent response = agentsClient.getAgent(parent);
}
============== ContextsClient ==============
Service Description: Manages contexts.
Refer to [documentation](https://dialogflow.com/docs/contexts) for more # details about contexts.
Standard methods.
Sample for ContextsClient:
try (ContextsClient contextsClient = ContextsClient.create()) {
ContextName name = ContextName.of("[PROJECT]", "[SESSION]", "[CONTEXT]");
Context response = contextsClient.getContext(name);
}
================= EntityTypesClient =================
Service Description: Manages agent entity types.
Refer to [documentation](https://dialogflow.com/docs/entities) for more # details about entity types.
Standard methods.
Sample for EntityTypesClient:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
EntityType response = entityTypesClient.getEntityType(name);
}
============= IntentsClient =============
Service Description: Manages agent intents.
Refer to [documentation](https://dialogflow.com/docs/intents) for more # details about agent intents.
Standard methods.
Sample for IntentsClient:
try (IntentsClient intentsClient = IntentsClient.create()) {
IntentName name = IntentName.of("[PROJECT]", "[INTENT]");
Intent response = intentsClient.getIntent(name);
}
======================== SessionEntityTypesClient ========================
Service Description: Manages session entity types.
Session entity types can be redefined on a session level, allowing for specific concepts, like a user's playlists.
Standard methods.
Sample for SessionEntityTypesClient:
try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
SessionEntityTypeName name = SessionEntityTypeName.of("[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
}
============== SessionsClient ==============
Service Description: Manages user sessions.
Custom methods.
Sample for SessionsClient:
try (SessionsClient sessionsClient = SessionsClient.create()) {
SessionName session = SessionName.of("[PROJECT]", "[SESSION]");
QueryInput queryInput = QueryInput.newBuilder().build();
DetectIntentResponse response = sessionsClient.detectIntent(session, queryInput);
}
Copyright © 2017 Google. All rights reserved.