【问题标题】:MessageRequest().Builder() unresolvable using IBM Cloud Conversation Service in JavaMessageRequest().Builder() 在 Java 中使用 IBM Cloud Conversation Service 无法解析
【发布时间】:2018-02-13 11:05:38
【问题描述】:

我正在用 Java 编写一个实现 IBM Watson Java API 的软件,特别是对话部分。令我困惑的是以下行不正确:

    String userInput = input;

    MessageRequest newMessage = new MessageRequest.Builder().inputText(input).context(context).build();

我使用了 IBMs Watson API for Android,并且我所做的每一项研究都指定了 MessageRequest().Builder() 的使用,但是当我尝试实现那段代码时,我收到以下错误:

"Cannot Resolve Symbol 'Builder'

关于为什么会很棒的任何想法!

【问题讨论】:

    标签: java ibm-cloud watson-conversation


    【解决方案1】:

    试试吧..

    MessageOptions newMessage = new MessageOptions.Builder().workspaceId("")
                    .input(new InputData.Builder(input).build()).context(context).build();
            MessageResponse response = service.message(newMessage).execute();
    

    我认为您使用的是旧版本的 sdk。 更新它https://github.com/watson-developer-cloud/java-sdk/releases 消息请求不再可用。使用 MessageOptions。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-23
      • 2021-06-21
      • 1970-01-01
      • 1970-01-01
      • 2020-07-23
      • 1970-01-01
      相关资源
      最近更新 更多