Skip to content

conversations

Conversations between a signed-in person and youSleep's staff.

A person writes about a topic and the staff answer in the same thread, which belongs to the person's account. Staff appear as youSleep, never by name. Someone without an account emails contact@yousleep.ai instead.

ConversationCreate pydantic-model

Bases: BaseModel

The first message of a conversation, and what it is about.

Fields:

ConversationOut pydantic-model

Bases: BaseModel

A conversation, as the person who started it sees it.

Fields:

messages = None pydantic-field

Every message, oldest first; on a single conversation only.

preview pydantic-field

The start of the latest message.

unread pydantic-field

youSleep has written since the person last read it.

ConversationPage pydantic-model

Bases: PaginatedResponse

A page of the caller's conversations, the latest first.

Asked for with limit=0, it carries the totals and no conversations: what an unread badge needs.

Fields:

limit pydantic-field

Maximum items in this page; 0 asks for the totals only.

unread_total pydantic-field

How many of the caller's conversations have a message they have not read.

MessageCreate pydantic-model

Bases: BaseModel

A message added to a conversation.

Fields:

  • body (MessageBody)

MessageOut pydantic-model

Bases: BaseModel

One message in a conversation.

Fields:

  • id (UUID)
  • from_staff (bool)
  • body (str)
  • created_at (datetime)

from_staff pydantic-field

Written by youSleep's staff.