如何使用liberty.java将watson会话连接到我的webapp(github)?请有人给我详细的编码。现在,我有这样的:如何使用liberty.java将Watson Conversation连接到我的webapp(github)?
public class Conversation {
ConversationService service = new ConversationService("2016-12-06");
service.setUsernameAndPassword("uname","pass");
MessageRequest newMessage = new MessageRequest.Builder().inputText("Hi").build();
String workspaceId = "wsId";
MessageResponse response = service.message(workspaceId, newMessage).execute();
System.out.println(response);
}
怎么办我在html中显示它? –
在这种情况下,您可以在我现在编辑的链接中使用简单的会话。这个SDK在Node.js中,你也可以修改你想要的,在我的情况下,我发现它更简单,因为我在公用文件夹内的index.html中进行了更改。 –
谢谢@Sayuri –