1

I am writing a piece of software in Java which implements the IBM Watson Java API, specifically the conversation section. What is confusing me is the below line being incorrect:

    String userInput = input;

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

I have used IBMs Watson API for Android and every piece of research I have done have specified the use of a MessageRequest().Builder() yet when I try and implement that piece of code I get the following error:

"Cannot Resolve Symbol 'Builder'

Any ideas as to why would be great!

1 Answers1

0

Try it..

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

I think you are using older version of sdk. Update it https://github.com/watson-developer-cloud/java-sdk/releases Message request is no longer available. Use MessageOptions.

Rohit
  • 187
  • 6