# Stats

## Computes text quality indexes for a Memori.

> This API requires a Giver session.

````json
{"openapi":"3.0.1","info":{"title":"Memori Web API V2","version":"v2"},"paths":{"/memori/v2/TextQualityIndexes/{strSessionID}/{strLatestUpdate}":{"get":{"tags":["Stats"],"summary":"Computes text quality indexes for a Memori.","description":"This API requires a Giver session.","operationId":"Stats-GetTextQualityIndexes","parameters":[{"name":"strSessionID","in":"path","description":"The session ID","required":true,"schema":{"type":"string"}},{"name":"strLatestUpdate","in":"path","description":"The optional latest update timestamp, in UTC time, in the format yyyyMMddHHmmssfff","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTextQualityIndexesResponse"}}}}}}}},"components":{"schemas":{"GetTextQualityIndexesResponse":{"type":"object","properties":{"textQualityIndex":{"type":"number","description":"An index of text quality of this Memori. It is the ratio of\r\ndefined words vs. the total of unique words used in questions\r\nand stories. A value of 1.0 means that no words are undefined,\r\na value of 0.0 means that all words are undefined.\r\nIf ```Null``` it means the index has not changed since\r\nthe last time it was updated.","format":"double","nullable":true},"undefinedWords":{"type":"array","items":{"type":"string"},"description":"List of undefined words found in questions and stories.\r\nUndefined words may have a profound negative impact on the ability\r\nto match content with user input.\r\nIf ```Null``` it means the list has not changed since\r\nthe last time it was updated.","nullable":true},"contentTextQualityIndex":{"type":"number","description":"An index of text quality of the content of this Memori. It is the\r\nratio of correct questions and stories vs. the total number\r\nof questions and stories. A question or story is defined as\r\n\"correct\" if it contains no undefined words, while it is defined\r\nas \"faulty\" if it contains at least one undefined word.\r\nA value of 1.0 means that all questions and stories have no\r\nundefined words, a value of 0.0 means that all questions and\r\nstories contain at least an undefined word.\r\nIf ```Null``` it means the index has not changed since\r\nthe last time it was updated.","format":"double","nullable":true},"faultyMemories":{"type":"array","items":{"$ref":"#/components/schemas/MemorySpecs"},"description":"List of faulty Memory objects (questions and stories). A question\r\nor story is defined as \"faulty\" if it contains at least one\r\nundefined word.\r\nIf ```Null``` it means the list has not changed since\r\nthe last time it was updated.","nullable":true},"requestID":{"type":"integer","description":"Progressive number of the request (since the Server started).\r\nUse this number, together with the RequestDateTime property,\r\nto report an anomalous response.","format":"int64"},"requestDateTime":{"type":"string","description":"Timestamp of the request.\r\nUse this timestamp, together with the RequestID property,\r\nto report an anomalous response.","format":"date-time"},"resultCode":{"type":"integer","description":"Result code. A code of ```0``` means no errors.\r\nWhen the request fails, its value is equivalent to the HTTP\r\nstatus code.","format":"int32"},"resultMessage":{"type":"string","description":"Result message. A message of ```Ok``` means no errors.","nullable":true}},"additionalProperties":false,"description":"Response of a Get Text Quality Indexes request."},"MemorySpecs":{"type":"object","properties":{"memoryID":{"type":"string","description":"Memory object ID.","nullable":true},"memoryType":{"type":"string","description":"Memory type, e.g. <code>Question</code>, <code>Story</code> or <code>Default</code>. Required during Add operations. <br> Currently possible values are:<ul> <li><code>Question</code>: this Memory is a question, hence its title is expected in interrogative form</li> <li><code>Story</code>: this Memory is a story, hence its title is expected in affirmative form</li> <li><code>Default</code>: this Memory is a default answer, hence its title is ignored (empty or null)</li> <li><code>CompletionDraft</code>: this Memory is draft from a completion, obtained via a generative AI.</li> <li><code>ExpertReference</code>: this Memory is the results of a question asked to a Board of Experts, and the answer is the name of the Expert that replied to the question.</li> </ul>","nullable":true},"lastRead":{"type":"string","description":"Timestamp of the last time this Memory has been shown to a Receiver.\r\nThis value is also used when picking random memories to avoid showing\r\nmemories that have already been shown recently.\r\n```Null``` if the Memory has not been shown yet.","format":"date-time","nullable":true},"readOccurrences":{"type":"integer","description":"Number of times this Memory has been shown to a Receiver.\r\n```Null``` if the Memory has not been shown yet.","format":"int32","nullable":true},"receiverID":{"type":"string","description":"ID of the Person object to whom this Memory belongs.\r\n```Null``` if the Memory is public. When updating,\r\nset it to a single dash character (```-```) to remove a\r\npreviously set association with a Person.","nullable":true},"receiverTag":{"type":"string","description":"Tag of the Person object to whom this Memory belongs.\r\n```Null``` if the Memory is public.","nullable":true},"receiverName":{"type":"string","description":"Name of the Person object to whom this Memory belongs.\r\n```Null``` if the Memory is public.","nullable":true},"media":{"type":"array","items":{"$ref":"#/components/schemas/MediumSpecs"},"description":"List of Medium objects associated with this Memory.\r\nMay be empty.","nullable":true},"title":{"type":"string","description":"Title of the Question or Story.\r\nNull if this Memory is a Default.","nullable":true},"titleVariants":{"type":"array","items":{"type":"string"},"description":"Title variants of this Question or Story.\r\nEmpty if this Memory is a Default.","nullable":true},"answers":{"type":"array","items":{"$ref":"#/components/schemas/AnswerSpecs"},"description":"List of its Answer objects.\r\nAt least one answer must be present.","nullable":true},"date":{"type":"string","description":"Approximate date associated with this Memory.\r\nWhen updating, set it to midnight Jan. 1st 1 A.D.\r\n(```01/01/01 00:00:00```) to clear any previously set\r\nDate and DateUncertaintyDays.","format":"date-time","nullable":true},"dateUncertaintyDays":{"type":"number","description":"Uncertainty in the date associated with this Memory,\r\nexpressed in days.","format":"double","nullable":true},"placeName":{"type":"string","description":"Name of the place associated with this Memory.\r\nWhen updating, set it to a single dash character\r\n(```-```) to clear any previously set Place (by name or\r\ncoordinates) and PlaceUncertaintyKm.","nullable":true},"placeLatitude":{"type":"number","description":"Latitude of the place associated with this Memory.","format":"double","nullable":true},"placeLongitude":{"type":"number","description":"Longitude of the place associated with this Memory.","format":"double","nullable":true},"placeUncertaintyKm":{"type":"number","description":"Uncertainty of the place associated with this Memory,\r\nexpressed in kilometers.","format":"double","nullable":true},"conclusive":{"type":"boolean","description":"If ```True```, when this Memory is emitted it is NOT followed by a continuation prompt,\r\nsuch as \"Is there anything else you want to know?\".","nullable":true},"notPickable":{"type":"boolean","description":"If ```True```, this Memory can't be randomly picked with a Timeout Event, or\r\nexplicitly searching for random Memory objects.\r\nIgnored for Memory of type Default.","nullable":true},"help":{"type":"boolean","description":"If ```True```, this Memory's content can be emitted if the user fails\r\nto find a question with an answer at the beginning of a session.\r\nIgnored for Memory of type Default.","nullable":true},"hints":{"type":"array","items":{"type":"string"},"description":"Hints for this Memory.","nullable":true},"minTimeout":{"type":"number","description":"Minimum idle timeout, in seconds. If not specified, by default it is set to 20 seconds. <br> The idle timeout is the time after which the client sends a Timeout event and, typically, a random question or story is picked up and proposed to the user. The actual idle timeout is computed as a random number between <code>MinTimeout</code> and <code>MaxTimeout</code> plus the reading time, where the reading time is in turn computed as the time it would take to read the answer at 150 words per minute.","format":"double","nullable":true},"maxTimeout":{"type":"number","description":"Maximum idle timeout, in seconds. If not specified, by default it is set to 40 seconds. <br> The idle timeout is the time after which the client sends a Timeout event and, typically, a random question or story is picked up and proposed to the user. The actual idle timeout is computed as a random number between <code>MinTimeout</code> and <code>MaxTimeout</code> plus the reading time, where the reading time is in turn computed as the time it would take to read the answer at 150 words per minute.","format":"double","nullable":true},"contextVarsToSet":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"List of variable-value pairs to be used to alter the context when this Memory is matched.\r\nUse the special value ```-``` (a single dash character) to clear a context variable.","nullable":true},"contextVarsToMatch":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"List of variable-value pairs to be used to match this Memory with the context. If the context\r\ncontains a variable listed here, the value must match for the Memory to match.","nullable":true},"dcmOutcomeType":{"type":"string","description":"Optional type of the outcome to be sent to the DCM platform when this Memory is emitted.","nullable":true},"dcmOutcomeCode":{"type":"string","description":"Optional code of the outcome to be sent to the DCM platform when this Memory is emitted.","nullable":true},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for this Memory.","nullable":true},"creationTimestamp":{"type":"string","description":"Timestamp of creation. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"creationSessionID":{"type":"string","description":"ID of the session that created this object.","nullable":true},"lastChangeTimestamp":{"type":"string","description":"Timestamp of latest change. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"lastChangeSessionID":{"type":"string","description":"ID of the latest session that changed this object.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Memory object."},"MediumSpecs":{"type":"object","properties":{"mediumID":{"type":"string","description":"Medium object ID.","nullable":true},"url":{"type":"string","description":"URL of the Medium. If specified, the Content property must be ```Null```.\r\nUse this property to link large amounts of data stored externally.\r\nIf the amount of data is modest the Content property may be used as an alternative.","nullable":true},"content":{"type":"string","description":"Content of the Medium. If specified, the URL property must be ```Null```.\r\nDon't use this property to store large amounts of data. Can be used to store limited \r\ntext for a maximum of 10 KiB. For larger amounts store the data externally and link it\r\nvia the URL property.","nullable":true},"mimeType":{"type":"string","description":"MIME type of the Medium.\r\nRequired during Add operations.","nullable":true},"title":{"type":"string","description":"Title of the Medium.","nullable":true},"properties":{"type":"object","additionalProperties":{"type":"string","nullable":true},"description":"Key-value pairs for additional structured content storage.","nullable":true},"creationTimestamp":{"type":"string","description":"Timestamp of creation. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"creationSessionID":{"type":"string","description":"ID of the session that created this object.","nullable":true},"lastChangeTimestamp":{"type":"string","description":"Timestamp of latest change. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"lastChangeSessionID":{"type":"string","description":"ID of the latest session that changed this object.","nullable":true}},"additionalProperties":false,"description":"Specifications of a Medium object."},"AnswerSpecs":{"type":"object","properties":{"text":{"type":"string","description":"Text of the Answer.\r\nRequired during Add operations.","nullable":true},"preformatted":{"type":"boolean","description":"If ```True```, when this Answer is emitted no reformatting is applied.","nullable":true},"creationTimestamp":{"type":"string","description":"Timestamp of creation. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"creationSessionID":{"type":"string","description":"ID of the session that created this object.","nullable":true},"lastChangeTimestamp":{"type":"string","description":"Timestamp of latest change. Always present when reading/receiving\r\nan object, ignored when writing/sending an object.","format":"date-time","nullable":true},"lastChangeSessionID":{"type":"string","description":"ID of the latest session that changed this object.","nullable":true}},"additionalProperties":false,"description":"Specifications of an Answer object."}}}}
````
