From 3c2a0dd839b74cbbd31e1f84458ca59d65eac415 Mon Sep 17 00:00:00 2001 From: hlomzik Date: Fri, 22 Aug 2025 13:13:45 +0100 Subject: [PATCH 1/4] docs: BROS-351: Docs for `Chat` tag --- web/libs/editor/src/tags/object/Chat.js | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 web/libs/editor/src/tags/object/Chat.js diff --git a/web/libs/editor/src/tags/object/Chat.js b/web/libs/editor/src/tags/object/Chat.js new file mode 100644 index 000000000000..8c8eba777681 --- /dev/null +++ b/web/libs/editor/src/tags/object/Chat.js @@ -0,0 +1,40 @@ +// stub file to keep docs for Chat object tag + +/** + * The `Chat` tag displays a conversational chat interface for labeling LLM conversations and message exchanges. Use for conversational AI evaluation, chat flow analysis, and dialogue annotation tasks. + * + * The Chat tag can display existing chat transcripts from task data and allows annotators to extend conversations with new messages during annotation. Each message can be individually selected and annotated with classification controls. + * + * Use with the following data types: JSON arrays containing chat messages. + * @example + * + * + * + * + * + * + * + * + * + * @example + * + * + * + * + * + * @name Chat + * @regions ChatRegion + * @meta_title Chat Tags for Conversational AI Labeling + * @meta_description Label Studio Chat Tags enable labeling and evaluation of conversational AI interactions, chat transcripts, and dialogue flows for machine learning projects. + * @param {string} name Name of the element + * @param {string} value Data field containing an array of chat messages with 'author', 'text', and optional 'timestamp' fields + * @param {string} [llm] LLM model identifier for AI-assisted conversation continuation (e.g., "gpt-5") + * @param {string} [messageRoles=user,assistant] Comma or pipe-separated list of available message roles for new messages + * @param {string} [minMessages] Minimum number of messages required for annotation completion + * @param {string} [maxMessages] Maximum number of messages allowed in the conversation + */ +export const ChatModel = {}; From 54d0d8e9df6ac232adaf6dec0e83c7e8d35652c6 Mon Sep 17 00:00:00 2001 From: hlomzik Date: Fri, 22 Aug 2025 15:32:05 +0100 Subject: [PATCH 2/4] Fix result fields list --- web/libs/editor/src/tags/object/Chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/libs/editor/src/tags/object/Chat.js b/web/libs/editor/src/tags/object/Chat.js index 8c8eba777681..c4fafa2b1eb4 100644 --- a/web/libs/editor/src/tags/object/Chat.js +++ b/web/libs/editor/src/tags/object/Chat.js @@ -31,7 +31,7 @@ * @meta_title Chat Tags for Conversational AI Labeling * @meta_description Label Studio Chat Tags enable labeling and evaluation of conversational AI interactions, chat transcripts, and dialogue flows for machine learning projects. * @param {string} name Name of the element - * @param {string} value Data field containing an array of chat messages with 'author', 'text', and optional 'timestamp' fields + * @param {string} value Data field containing an array of chat messages with 'role', 'content', and optional 'timestamp' fields * @param {string} [llm] LLM model identifier for AI-assisted conversation continuation (e.g., "gpt-5") * @param {string} [messageRoles=user,assistant] Comma or pipe-separated list of available message roles for new messages * @param {string} [minMessages] Minimum number of messages required for annotation completion From 30f58ba2b932e3c829c763978802724da4079e3d Mon Sep 17 00:00:00 2001 From: hlomzik Date: Fri, 22 Aug 2025 15:32:22 +0100 Subject: [PATCH 3/4] Add ChatRegion docs --- web/libs/editor/src/regions/ChatRegion.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 web/libs/editor/src/regions/ChatRegion.js diff --git a/web/libs/editor/src/regions/ChatRegion.js b/web/libs/editor/src/regions/ChatRegion.js new file mode 100644 index 000000000000..786874bc0d27 --- /dev/null +++ b/web/libs/editor/src/regions/ChatRegion.js @@ -0,0 +1,19 @@ +// stub file to keep ChatRegion docs + +/** + * @example + * { + * "value": { + * "chatmessage": { + * "role": "user", + * "content": "Hello, how are you?", + * "timestamp": 1755872989436 + * } + * } + * } + * @typedef {Object} ChatRegionResult + * @property {Object} value + * @property {string} value.chatmessage.role role of the message (user, assistant, system) + * @property {string} value.chatmessage.content content of the message + * @property {number} value.chatmessage.timestamp timestamp of the message (ms) + */ From a2fb2a97442969333a81a60d4348a0e7089b64fa Mon Sep 17 00:00:00 2001 From: robot-ci-heartex Date: Fri, 22 Aug 2025 14:34:40 +0000 Subject: [PATCH 4/4] ci: Build tag docs Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/17158090735 --- docs/source/includes/tags/chat.md | 33 +++++++++++++++ web/libs/core/src/lib/utils/schema/tags.json | 44 ++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 docs/source/includes/tags/chat.md diff --git a/docs/source/includes/tags/chat.md b/docs/source/includes/tags/chat.md new file mode 100644 index 000000000000..f043ed77ca64 --- /dev/null +++ b/docs/source/includes/tags/chat.md @@ -0,0 +1,33 @@ +### Parameters + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| name | string | | Name of the element | +| value | string | | Data field containing an array of chat messages with 'role', 'content', and optional 'timestamp' fields | +| [llm] | string | | LLM model identifier for AI-assisted conversation continuation (e.g., "gpt-5") | +| [messageRoles] | string | "user,assistant" | Comma or pipe-separated list of available message roles for new messages | +| [minMessages] | string | | Minimum number of messages required for annotation completion | +| [maxMessages] | string | | Maximum number of messages allowed in the conversation | + +### Result parameters + +| Name | Type | Description | +| --- | --- | --- | +| value | Object | | +| value.chatmessage.role | string | role of the message (user, assistant, system) | +| value.chatmessage.content | string | content of the message | +| value.chatmessage.timestamp | number | timestamp of the message (ms) | + +### Example JSON +```json +{ + "value": { + "chatmessage": { + "role": "user", + "content": "Hello, how are you?", + "timestamp": 1755872989436 + } + } +} +``` + diff --git a/web/libs/core/src/lib/utils/schema/tags.json b/web/libs/core/src/lib/utils/schema/tags.json index 8ca6da03fe73..04d647e16ce9 100644 --- a/web/libs/core/src/lib/utils/schema/tags.json +++ b/web/libs/core/src/lib/utils/schema/tags.json @@ -195,6 +195,49 @@ } } }, + "Chat": { + "name": "Chat", + "description": "The `Chat` tag displays a conversational chat interface for labeling LLM conversations and message exchanges. Use for conversational AI evaluation, chat flow analysis, and dialogue annotation tasks.\n\nThe Chat tag can display existing chat transcripts from task data and allows annotators to extend conversations with new messages during annotation. Each message can be individually selected and annotated with classification controls.\n\nUse with the following data types: JSON arrays containing chat messages.", + "attrs": { + "name": { + "name": "name", + "description": "Name of the element", + "type": "string", + "required": true + }, + "value": { + "name": "value", + "description": "Data field containing an array of chat messages with 'role', 'content', and optional 'timestamp' fields", + "type": "string", + "required": true + }, + "llm": { + "name": "llm", + "description": "LLM model identifier for AI-assisted conversation continuation (e.g., \"gpt-5\")", + "type": "string", + "required": false + }, + "messageRoles": { + "name": "messageRoles", + "description": "Comma or pipe-separated list of available message roles for new messages", + "type": "string", + "required": false, + "default": "user,assistant" + }, + "minMessages": { + "name": "minMessages", + "description": "Minimum number of messages required for annotation completion", + "type": "string", + "required": false + }, + "maxMessages": { + "name": "maxMessages", + "description": "Maximum number of messages allowed in the conversation", + "type": "string", + "required": false + } + } + }, "HyperText": { "name": "HyperText", "description": "The `HyperText` tag displays hypertext markup for labeling. Use for labeling HTML-encoded text and webpages for NER and NLP projects.\n\nUse with the following data types: HTML.", @@ -2746,6 +2789,7 @@ "children": [ "Audio", "Channel", + "Chat", "HyperText", "Image", "List",