Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/source/includes/tags/chat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
### Parameters

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| name | <code>string</code> | | Name of the element |
| value | <code>string</code> | | Data field containing an array of chat messages with 'role', 'content', and optional 'timestamp' fields |
| [llm] | <code>string</code> | | LLM model identifier for AI-assisted conversation continuation (e.g., "gpt-5") |
| [messageRoles] | <code>string</code> | <code>&quot;user,assistant&quot;</code> | Comma or pipe-separated list of available message roles for new messages |
| [minMessages] | <code>string</code> | | Minimum number of messages required for annotation completion |
| [maxMessages] | <code>string</code> | | Maximum number of messages allowed in the conversation |

### Result parameters

| Name | Type | Description |
| --- | --- | --- |
| value | <code>Object</code> | |
| value.chatmessage.role | <code>string</code> | role of the message (user, assistant, system) |
| value.chatmessage.content | <code>string</code> | content of the message |
| value.chatmessage.timestamp | <code>number</code> | timestamp of the message (ms) |

### Example JSON
```json
{
"value": {
"chatmessage": {
"role": "user",
"content": "Hello, how are you?",
"timestamp": 1755872989436
}
}
}
```

44 changes: 44 additions & 0 deletions web/libs/core/src/lib/utils/schema/tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -2746,6 +2789,7 @@
"children": [
"Audio",
"Channel",
"Chat",
"HyperText",
"Image",
"List",
Expand Down
19 changes: 19 additions & 0 deletions web/libs/editor/src/regions/ChatRegion.js
Original file line number Diff line number Diff line change
@@ -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)
*/
40 changes: 40 additions & 0 deletions web/libs/editor/src/tags/object/Chat.js
Original file line number Diff line number Diff line change
@@ -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
* <!--Basic chat labeling configuration -->
* <View>
* <Chat name="conversation" value="$dialog" />
* <Choices name="message_quality" toName="conversation">
* <Choice value="helpful" />
* <Choice value="harmful" />
* <Choice value="neutral" />
* </Choices>
* </View>
* @example
* <!--Chat with LLM integration and role restrictions -->
* <View>
* <Chat name="chat" value="$messages"
* llm="gpt-5"
* messageRoles="user,assistant"
* minMessages="2"
* maxMessages="10" />
* <Rating name="message_quality" toName="chat" perRegion="true" />
* </View>
* @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 '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
* @param {string} [maxMessages] Maximum number of messages allowed in the conversation
*/
export const ChatModel = {};
Loading