Think Thought

Think Thought

This method invokes "Think Thought" using a session ID, this will return Lydia's response to a given input and session ID followed by the session object and session attributes object.
Parameter NameDefault ValueRequiredDescription
session_idNULLTrueThe Session ID given when creating a session with the Create Session method
inputNULLTrueThe user input (eg; "Hello")

Example Success Response

This response is given when the invoke action was a success
{
  "success": true,
  "response_code": 200,
  "results": {
    "output": "I don't know.",
    "session": {
      "session_id": "1b71026489018d5a25889fb15e4660ab2583ff8ca3c3d3f424be72ff2f24f7ce",
      "language": "en",
      "available": true,
      "expires": 1612220389
    },
    "attributes": {
      "ai_emotion": "NEUTRAL",
      "ai_emotion_probability": 68.74342,
      "current_language": "en",
      "current_language_probability": 70.3648620130638
    }
  }
}

Response Structure

NameTypeDescription
outputstringThe output of Lydia
sessionSessionInformation about the session that's currently being used
attributesSessionAttributesAttributes about the session that includes information about the current prediction state of Lydia

Session Object Structure

NameTypeDescription
session_idstringThe ID of the session that must be used for requests like "Think Thought"
languagestringThe ISO 639-1 Language code that this session is based in
availablebooleanIndicates if this session is available or not. A session can be unavailable if it has expired or a session error raises
expiresintegerThe Unix Timestamp for when this session will expire

SessionAttributes Object Structure

NameTypeDescription
ai_emotionstringThe current emotion of the AI, can be 'NEUTRAL', 'HAPPINESS', 'AFFECTION', 'SADNESS' or 'ANGER'
ai_emotion_probabilityfloatThe probability calculation of the current emotion
current_languagestringThe current language that the AI predicts the conversation is based in
current_language_probabilityfloatThe probability calculation of the language detection

Service No Longer Unavailable Error

This error is returned when the session fails due to an error or has expired
{
  "success": false,
  "response_code": 410,
  "error": {
    "error_code": 5,
    "type": "CLIENT",
    "message": "The session is no longer available"
  }
}

Session not found response

This response is given when the given session id was not found
{
  "success": false,
  "response_code": 404,
  "error": {
    "error_code": 4,
    "type": "CLIENT",
    "message": "The session was not found"
  }
}