Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Class Client

Jasmine Anteunis edited this page Jan 15, 2019 · 3 revisions

Instantiation

The Client can be instantiated with a token and a language (both optional).

Client client = new Client(YOUR_TOKEN, YOUR_LANGUAGE)

Attributes

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

Methods

Text Converse

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.

Text Request

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.

File Request

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

Clone this wiki locally