Constructor and Description |
---|
Builder(String utterance)
Creates a new result builder.
|
Modifier and Type | Method and Description |
---|---|
NLUResult |
build()
Uses the current builder state to create an NLU result.
|
NLUResult.Builder |
withConfidence(float confidence)
Set the confidence for the intent classification.
|
NLUResult.Builder |
withContext(Map<String,Object> context)
Attaches the context returned by the NLU service.
|
NLUResult.Builder |
withError(Throwable error)
Attaches an error encountered while performing NLU.
|
NLUResult.Builder |
withIntent(String intent)
Attaches the user intent classified by the NLU service.
|
NLUResult.Builder |
withSlots(Map<String,Slot> slots)
Attaches the slot values extracted from the user utterance.
|
public Builder(String utterance)
utterance
- The user's original utterance.public NLUResult.Builder withError(Throwable error)
error
- The error to attach.public NLUResult.Builder withIntent(String intent)
intent
- The user intent.public NLUResult.Builder withConfidence(float confidence)
confidence
- The classifier's confidence for its intent
prediction.public NLUResult.Builder withSlots(Map<String,Slot> slots)
slots
- The slots present in the user utterance.public NLUResult.Builder withContext(Map<String,Object> context)
context
- The context to attach.public NLUResult build()
Copyright © 2020. All rights reserved.