Lydia Basics

How Lydia works

Lydia is a active learning chat bot that learns from conversations and can speak in many languages "natively". This section will briefly explain how Lydia works and how it's intended to be used in environments.

Sessions

Using the general mindset for how a conversation works, for every response in a conversation the response must be related to the current conversation. This is accomplished in Lydia using sessions, these sessions allows the bot to hold a memory of the current conversation including sentimental values that the bot predicts during the conversation.

Before you start a conversation with Lydia, you must initialize a session and then give your input using that session. See Create Session for more details on how to create one.
  • Hello John!
  • Hello! How are you?
  • Great!

Languages

Though Lydia can speak in many languages; every output is the result of active learning. This means the more you speak to it the more it learns. Nothing in active learning is hard-coded and occasionally you will notice spelling mistakes or responses that do not make sense. The same goes when the conversation is based in another language.
There is no way to enforce a specific language to be used throughout the whole conversation, however. There is a way to enforce the conversation to start in a specific language, doing this will have a higher probability for Lydia to respond correctly in the assigned language. You can only accomplish this upon creating a session. See Create Session for more details on how to accomplish this.
Find Content

API Methods

API Response Change

Most of these API methods has been updated with minor changes, for example in JSON responses, instead of returning payload as the results, it will return results
Method NameAccess URIMethodsDescription
create_lydia_sessioncoffeehouse/v1/lydia/session/createGETPOSTCreates a nw chat session with Lydia
get_lydia_sessioncoffeehouse/v1/lydia/session/getGETPOSTGets an existing chat session and it's details
get_lydia_session_attributescoffeehouse/v1/lydia/session/attributesGETPOSTGets the attributes of ane xisting session
lydia_think_thoughtcoffeehouse/v1/lydia/session/thinkGETPOSTInvokes the think method and allows Lydia to return a proper response from user input

API Authentication

CoffeeHouse's API is powered by Intellivoid API. This uses the standard "API Key" authentication method which is the same across all other Intellivoid APIs.
Hint: Your Access Key is your API Key
The following authentication methods are available
  • Basic HTTP Authentication
  • GET/POST Parameter

Basic HTTP Authentication

You can authenticate by providing your access key via the password field, the username can be left blank and you should not provide your access key via a username.

GET/POST Parameter

You can provide your access key via a GET Parameter or within a POST (multipart/form-data), the parameter name that is applicable to both methods is access_key, for example.

Security Notice

All official APIs by Intellivoid are done through api.intellivoid.net, followed by the service name and version of the API Handler. For example
Any unauthorized requests will result in a 401 Unauthorized response such as this
{
  "success": false,
  "response_code": 401,
  "error": {
    "error_code": 0,
    "type": "CLIENT",
    "message":
    "Unauthorized Access, Authentication is required"
  }
}
Additionally WWW-Authenticate: Basic realm="API Authentication" will be provided in the response headers, if you are using a web browser you will be prompted to authenticate, you can authenticate by providing your Access Key in the password field as explained above.

Troubleshooting

All API responses returns a X-Request-ID header with a unique value set with every response you get. It is important to log this request ID if you encounter unexpected issues and server-side errors. Intellivoid can use this ID to get more details about the request and troubleshoot the error.

Data protection

To protect your data, we do not store the information our server returns to your client, the only data we keep track of is the request data you sent and server-side details that are not visible in the request such as exception dumps, cache information and so on. This information is automatically deleted from our server after two weeks. This data is used to troubleshoot any problems with our services and to address them accordingly.