本文整理汇总了Java中com.amazon.speech.speechlet.SessionStartedRequest类的典型用法代码示例。如果您正苦于以下问题:Java SessionStartedRequest类的具体用法?Java SessionStartedRequest怎么用?Java SessionStartedRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SessionStartedRequest类属于com.amazon.speech.speechlet包,在下文中一共展示了SessionStartedRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(final SessionStartedRequest request, final Session session)
throws SpeechletException {
log.info("onSessionStarted requestId={}, sessionId={}", request.getRequestId(),
session.getSessionId());
//All session initialization goes here - Beginning of lifecycle
//TODO EDIT HERE: Add Conversation objects to registry
supportedConversations.add(new KnockKnockConversation());
//Populate a map of supported intents to conversations for later dispatch
for(Conversation convo : supportedConversations) {
for(String intentName : convo.getSupportedIntentNames()) {
supportedIntentsByConversation.put(intentName, convo);
}
}
}
示例2: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Test
public void onSessionStarted() throws Exception {
IntrospectionData data = registry.getDataForPath("/invoked").orElseThrow(RuntimeException::new);
final ArrayListMultimap<String, InvokableMethod> methods = ArrayListMultimap.create();
data.getMethods().forEach(m->methods.put(m.getName(), m));
InvokedTestSkill skill = new InvokedTestSkill();
DynamicSpeechlet speechlet = new DynamicSpeechlet(methods, data, new FormatterMappings(),
registry, skill, new DefaultTypeFactory());
SessionStartedRequest request = SessionStartedRequest.builder()
.withRequestId("id")
.withTimestamp(new Date()).build();
Stopwatch stopwatch = Stopwatch.createStarted();
speechlet.onSessionStarted(request, session);
Logger.getAnonymousLogger().info("onSessionStarted complete in "+stopwatch.elapsed(TimeUnit.MILLISECONDS));
assertTrue(skill.onSessionStarted.get());
}
示例3: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(final SessionStartedRequest request, final Session session)
throws SpeechletException {
log.info("onSessionStarted requestId={}, sessionId={}", request.getRequestId(),
session.getSessionId());
// any initialization logic goes here
}
示例4: getSpeechletRequest
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public SpeechletRequest getSpeechletRequest() {
return SessionStartedRequest.builder()
.withLocale(session.getClient().getLocale())
.withTimestamp(session.getClient().getCurrentTimestamp())
.withRequestId(generateRequestId())
.build();
}
示例5: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(final SessionStartedRequest request, final Session session)
throws SpeechletException {
log.info("onSessionStarted requestId={}, sessionId={}", request.getRequestId(),
session.getSessionId());
// any initialization logic goes here
}
示例6: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(final SessionStartedRequest request, final Session session)
throws SpeechletException {
log.info("onSessionStarted requestId={}, sessionId={}", request.getRequestId(),
session.getSessionId());
// any initialization logic goes here
}
示例7: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(
final SessionStartedRequest request, final Session session)
throws SpeechletException {
log.info("onSessionStarted requestId={}, sessionId={}",
request.getRequestId(), session.getSessionId());
}
示例8: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
public void onSessionStarted(SessionStartedRequest request, Session session) throws SpeechletException {
LOGGER.info("onSessionStarted requestId={}, sessionId={}", request.getRequestId(), session.getSessionId());
}
示例9: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(final SessionStartedRequest request, final Session session) throws SpeechletException {
logger.info("onSessionStarted requestId={}, sessionId={}", request.getRequestId(), session.getSessionId());
service = new SwitchService();
}
示例10: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
void onSessionStarted(SpeechletRequestEnvelope<SessionStartedRequest> requestEnvelope);
示例11: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(final SpeechletRequestEnvelope<SessionStartedRequest> requestEnvelope) {
}
示例12: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(SpeechletRequestEnvelope<SessionStartedRequest> req) {
for(SpeechletHandler<OnSessionStarted> startHandler : handler.onSessionStarted) {
call(startHandler, req);
}
}
示例13: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(SessionStartedRequest request, Session session) throws SpeechletException {
// Do nothing
}
示例14: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(SessionStartedRequest request, Session session) throws SpeechletException {
handleVoidEvent(SessionStarted.class, request, session);
}
示例15: onSessionStarted
import com.amazon.speech.speechlet.SessionStartedRequest; //导入依赖的package包/类
@Override
public void onSessionStarted(final SessionStartedRequest request, final Session session)
throws SpeechletException {
provideSessionForRequest(session);
}