public static class MessageRequest.Builder extends Object
Constructor and Description |
---|
Builder()
Instantiates a new Builder.
|
Modifier and Type | Method and Description |
---|---|
MessageRequest.Builder |
alternateIntents(Boolean alternateIntents)
Sets the alternate intents flag.
|
MessageRequest |
build()
Generates a new
MessageRequest object. |
MessageRequest.Builder |
context(Map<String,Object> context)
Sets the context/state which is to be sent to the message API as a part of the service request.
|
MessageRequest.Builder |
entities(List<Entity> entities)
Sets the list the entities to be send as part of the request.
Existing entities will be replaced. |
MessageRequest.Builder |
entity(Entity entity)
Adds an entity to the list of entities to be send as part of the request.
|
MessageRequest.Builder |
input(Map<String,Object> input)
Sets the input which is to be sent to the message API as a part of the service request.
|
MessageRequest.Builder |
inputText(String text)
Sets the input text which is to be sent to the message API as a part of the service request.
|
MessageRequest.Builder |
intent(Intent intent)
Adds an intent to the list of intents to be send as part of the request.
|
MessageRequest.Builder |
intents(List<Intent> intents)
Sets the list the intents to be send as part of the request.
Existing intents will be replaced. |
public MessageRequest.Builder alternateIntents(Boolean alternateIntents)
alternateIntents
- the alternate intents flagpublic MessageRequest build()
MessageRequest
object. It will contain the parameters set in the builder.MessageRequest
instancepublic MessageRequest.Builder context(Map<String,Object> context)
context
object which represents the state as defined by the service.
The state is not maintained by the service, so the client must keep the state from each API call, and pass that
state in as a part of any subsequent requests.context
- a map containing key value pairs representing the state/context of the conversationpublic MessageRequest.Builder input(Map<String,Object> input)
text
property (key and value). The text
property is generally interpreted as
being the user/system input which the service must parse for intents, entities etc..inputText(String)
method is sufficient to send text to the service on behalf of the
user/system.input
- a map of properties to be sent to the service under the input propertypublic MessageRequest.Builder entity(Entity entity)
entity
- the entitypublic MessageRequest.Builder intent(Intent intent)
intent
- the intentpublic MessageRequest.Builder entities(List<Entity> entities)
entities
- the entitiespublic MessageRequest.Builder intents(List<Intent> intents)
intents
- the intentspublic MessageRequest.Builder inputText(String text)
text
- the textual value to be assigned to the 'text' property on the input object.Copyright © 2015–2016 IBM Watson. All rights reserved.