Interface NCEmbeddedResult
-
- All Superinterfaces:
NCMetadata
public interface NCEmbeddedResult extends NCMetadata
Result container for the embedded probe. When an embedded probe completes query processing for one of its deployed models it calls registered callbacks, if any, with this container before the results are sent back to the REST server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getBody()
Gets optional result body.int
getErrorCode()
Gets optional error code.String
getErrorMessage()
Gets optional error message.String
getIntentId()
Gets ID of the intent that was matched against the input sentence.String
getLogJson()
Gets request processing log as JSON string.String
getModelId()
Gets the ID of the model that produced this result.String
getOriginalText()
Gets original text of the request that produced this result.String
getProbeId()
Gets ID of the probe this result was generated by.String
getServerRequestId()
Gets ID of the request that produced this result.String
getType()
Gets optional result type.long
getUserId()
Gets ID of the user that made the request this result is for.-
Methods inherited from interface org.apache.nlpcraft.model.NCMetadata
getMetadata, meta, meta, metaOpt, metax
-
-
-
-
Method Detail
-
getModelId
String getModelId()
Gets the ID of the model that produced this result. Note that embedded probe can host more than one data model hence this parameter is important to distinguish to which model this result belongs.- Returns:
- ID of the model produced this result.
-
getServerRequestId
String getServerRequestId()
Gets ID of the request that produced this result.- Returns:
- ID of the request that produced this result.
-
getOriginalText
String getOriginalText()
Gets original text of the request that produced this result.- Returns:
- Original text of the request that produced this result.
-
getUserId
long getUserId()
Gets ID of the user that made the request this result is for.- Returns:
- ID of the user that made the request this result is for.
-
getBody
String getBody()
Gets optional result body. Note that either both result body and type are set or error message and error code are set, but not both pairs.- Returns:
- Result body or
null
if error occurred.
-
getType
String getType()
Gets optional result type. Note that either both result body and type are set or error message and error code are set, but not both pairs.- Returns:
- Result type or
null
if error occurred.
-
getErrorMessage
String getErrorMessage()
Gets optional error message.- Returns:
- Error message or
null
if no errors occurred.
-
getErrorCode
int getErrorCode()
Gets optional error code. One of the following codes:Error codes. Code Description 1
Rejected by the model. 100
Unexpected system error. 101
Model's result is too big. 102
Recoverable system error. 10001
Too many unknown words. 10002
Sentence is too complex (too many free words). 10003
Too many suspicious or unrelated words. 10004
Swear words found and are not allowed. 10005
Sentence contains no nouns. 10006
Only latin charset is supported. 10007
Only english language is supported. 10008
Sentence seems unrelated to data model. 10009
Sentence is too short (before processing). 10010
Sentence is ambiguous. 10011
Sentence is too short (after processing). 10012
Sentence is too long. - Returns:
- Error code if error message is not
null
.
-
getProbeId
String getProbeId()
Gets ID of the probe this result was generated by.- Returns:
- ID of the probe this result was generated by.
-
getLogJson
String getLogJson()
Gets request processing log as JSON string.- Returns:
- Request processing log as JSON string.
-
getIntentId
String getIntentId()
Gets ID of the intent that was matched against the input sentence. Only set if result was successful.- Returns:
- ID of the matching intent.
-
-