-
Notifications
You must be signed in to change notification settings - Fork 13
Class Client
The Client can be instantiated with a token and a language (both optional).
Client client = new Client(YOUR_TOKEN, YOUR_LANGUAGE)
An instance of the Client class provides each of the following attributes:
Attributes | Type |
---|---|
token | String: the request token from the SAP Conversational AI platform |
language | String: the default language used to make the requests to the API |
textConverse(text, options = { token: YOUR_TOKEN, language: YOUR_LANGUAGE, conversationToken: YOUR_CONVERSATION_TOKEN, memory: YOUR_MEMORY})
If you pass a token or a language in the options parameter, it will override your default client language or token.
Conversation conversation = client.request.doTextConverse(YOUR_TEXT)
If a language is provided: the language you've given is used for processing if your bot has expressions for it, else your bot's primary language is used.
If no language is provided: the language of the text is detected and is used for processing if your bot has expressions for it, else your bot's primary language is used for processing.
textRequest(text)
Reponse reponse = client.textRequest(YOUR_TEXT)
If a language is provided: the language you've given is used for processing if your bot has expressions for it, else your bot's primary language is used.
If no language is provided: the language of the text is detected and is used for processing if your bot has expressions for it, else your bot's primary language is used for processing.
fileRequest(file)
file format: .wav
client.fileRequest('myFile.wav')
If a language is provided: Your bot's primary language is used for processing as we do not provide language detection for speech.
If no language is provided: The language you've given is used for processing if your bot has expressions for it, else your bot's primary language is used