public class AIDataService
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG |
| Constructor and Description |
|---|
AIDataService(android.content.Context context,
AIConfiguration config) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
doSoundRequest(java.io.InputStream voiceStream,
java.lang.String queryData)
Method extracted for testing purposes
|
protected java.lang.String |
doTextRequest(java.lang.String requestJson)
Method extracted for testing purposes
|
AIResponse |
request(AIRequest request)
Make request to the ai service.
|
boolean |
resetContexts()
Forget all old contexts
|
AIResponse |
voiceRequest(java.io.InputStream voiceStream,
java.util.List<AIContext> aiContexts)
Make requests to the ai service with voiceData.
|
public AIDataService(android.content.Context context,
AIConfiguration config)
public AIResponse request(AIRequest request) throws AIServiceException
request - request object to the serviceAIServiceExceptionpublic AIResponse voiceRequest(java.io.InputStream voiceStream, java.util.List<AIContext> aiContexts) throws AIServiceException
voiceStream - voice data stream for recognitionAIServiceExceptionpublic boolean resetContexts()
protected java.lang.String doTextRequest(java.lang.String requestJson)
throws java.net.MalformedURLException,
AIServiceException
java.net.MalformedURLExceptionAIServiceExceptionprotected java.lang.String doSoundRequest(java.io.InputStream voiceStream,
java.lang.String queryData)
throws java.net.MalformedURLException,
AIServiceException
java.net.MalformedURLExceptionAIServiceException