> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-3.md).

# Chat tables

{% hint style="info" %}
Generated from the staging database schema, with descriptions drafted by agents ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/db/tables/viewpoint-3.md).
{% endhint %}

## Description

Task chat messages, their reactions and voice transcripts, and the chat item types.

## Tables

| Name                                                                                                                       | Columns | Comment                                                                                                                                                                                                                                                                                                                                                                            | Type       |
| -------------------------------------------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| [tPri\_JobChat](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobchat.md)                                  | 28      | One line of a task's chat: a message, picture, video, drawing, voice transcript or reply, or an audit line such as a status change.                                                                                                                                                                                                                                                | BASE TABLE |
| [tPri\_JobChat\_Reaction](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobchat_reaction.md)               | 11      | One user's reaction to a task chat line; each user has one row per line, updated when the reaction changes.                                                                                                                                                                                                                                                                        | BASE TABLE |
| [tPri\_JobChat\_VoiceTranscript](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobchat_voicetranscript.md) | 15      | The transcript, AI title and image of a voice message in a task's chat, with the raw replies of the Google, AWS and ChatGPT services \[[ASK-177](https://github.com/snapfix/docs/blob/main/ASK.md#ask-177-do-the-customer-terms-cover-sending-task-text-photos-recordings-and-chats-to-ai-providers)]. The newest row is from 2023-05; php-apis still has the code that writes it. | BASE TABLE |
| [tPri\_Log\_JobChat\_Reaction](https://docs.snapfix.com/engineering-reference/db/tables/tpri_log_jobchat_reaction.md)      | 9       | One add or remove of a task chat reaction, kept as history; rows are only inserted.                                                                                                                                                                                                                                                                                                | BASE TABLE |
| [tPub\_ChatItemType](https://docs.snapfix.com/engineering-reference/db/tables/tpub_chatitemtype.md)                        | 6       | A reference list of chat item types, each with a number (message\_id), a name (fName), an example and a comment. Only php-apis's generic table actions name it, and nothing calls them.                                                                                                                                                                                            | BASE TABLE |

## Relations

```mermaid
erDiagram

"tPri_JobChat_Reaction" }o--o| "tPri_JobChat" : "FOREIGN KEY (uuid_tJobChat) REFERENCES tPri_JobChat (uuid)"
"tPri_JobChat_VoiceTranscript" }o--o| "tPri_JobChat" : "FOREIGN KEY (uuid_tJobChat) REFERENCES tPri_JobChat (uuid)"
"tPri_Log_JobChat_Reaction" }o--o| "tPri_JobChat" : "FOREIGN KEY (uuid_tJobChat) REFERENCES tPri_JobChat (uuid)"

"tPri_JobChat" {
  varchar_255_ uuid
}
"tPri_JobChat_Reaction" {
  varchar_255_ uuid_tJobChat
}
"tPri_JobChat_VoiceTranscript" {
  varchar_255_ uuid_tJobChat
}
"tPri_Log_JobChat_Reaction" {
  varchar_255_ uuid_tJobChat
}
"tPub_ChatItemType" {
}
```

***

> Generated by [tbls](https://github.com/k1LoW/tbls)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-3.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
