> For the complete documentation index, see [llms.txt](https://docs.flowiseai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowiseai.com/espanol/documentacion-oficial/integraciones/langchain/agents/openai-assistant/threads.md).

# Threads

Los [Threads](https://platform.openai.com/docs/assistants/how-it-works/managing-threads-and-messages) solo se utilizan cuando se está usando un OpenAI Assistant. Es una sesión de conversación entre un Assistant y un usuario. Los Threads almacenan mensajes y manejan automáticamente el truncamiento para ajustar el contenido al contexto del modelo.

<figure><img src="https://4068692976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUiD7nOmFRK805sNuiieJ%2Fuploads%2Fgit-blob-fa1ccff7b3fb4a2add14fcb43defaa2cdafc9c27%2Fscreely-1699896158130.png?alt=media" alt=""><figcaption></figcaption></figure>

## Conversaciones separadas para múltiples usuarios

### UI & Embedded Chat

Por defecto, la UI y el Embedded Chat separarán automáticamente los threads para las conversaciones de múltiples usuarios. Esto se hace generando un **`chatId`** único para cada nueva interacción. Esa lógica es manejada internamente por Flowise.

### Prediction API

POST /`api/v1/prediction/{your-chatflowid}`, especifica el **`chatId`**. El mismo thread se usará para el mismo chatId.

```json
{
    "question": "hello!",
    "chatId": "user1"
}
```

### Message API

* GET `/api/v1/chatmessage/{your-chatflowid}`
* DELETE `/api/v1/chatmessage/{your-chatflowid}`

También puedes filtrar por **`chatId`** - `/api/v1/chatmessage/{your-chatflowid}?chatId={your-chatid}`

Todas las conversaciones pueden ser visualizadas y gestionadas desde la UI también:

<figure><img src="https://4068692976-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUiD7nOmFRK805sNuiieJ%2Fuploads%2Fgit-blob-96a4803b3faddacc9e7e2c4a24873413041060e9%2Fimage%20(77).png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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.flowiseai.com/espanol/documentacion-oficial/integraciones/langchain/agents/openai-assistant/threads.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.
