您好我指的是this Android sdk Watson语言翻译示例,并替换为Conversation Service以在Android平台上部署该应用程序。在示例代码中,他们在MainActivity.java上有一个类(下图)。如何对此特定类的对话服务的语法格式进行必要的更改?请帮忙。
答案 0 :(得分:0)
ConversationService conversationService = new ConversationService(ConversationService.VERSION_DATE_2016_07_11, userName, password);
MessageRequest.Builder messageRequestBuilder = new MessageRequest.Builder();
messageRequestBuilder.inputText(question);
ServiceCall<MessageResponse> response = conversationService.message(workspaceId, messageRequestBuilder.build());
MessageResponse answer = response.execute();