Skip to the content.

Table of contents

Chat conversations with an AI

Cf the stack documentation for AI.

io.cozy.ai.chat.conversations

The io.cozy.ai.chat.conversations doctype is used to keep history of chat conversations with an assistant (AI).

Example

{
  "_id": "e21dce8058b9013d800a18c04daba326",
  "_rev": "1-23456",
  "cozyMetadata": {
    "createdAt": "2024-09-24T13:24:07.576Z",
    "createdOn": "http://cozy.localhost:8080/",
    "doctypeVersion": "1",
    "metadataVersion": 1,
    "updatedAt": "2024-09-24T13:24:07.576Z"
  },
  "messages": [
    {
      "id": "eb17c3205bf1013ddea018c04daba326",
      "role": "user",
      "content": "Why the sky is blue?",
      "createdAt": "2024-09-24T13:24:07.576Z"
    },
    {
      "id": "0192756f2428758abe0aec7ecefc0c60",
      "content": "The sky appears blue because of a phenomenon called Rayleigh scattering.",
      "createdAt": "2024-09-24T13:24:08.987Z",
      "role": "assistant"
    }
  ]
}

io.cozy.ai.chat.events

This doctype is not persisted, it is only used on the realtime websockets to allow the application to display the tokens of the response step by step.