Saltar al contenido principal

Clasificar Mensaje Publicitario de Twitch

Workflow manual que clasifica un mensaje de chat de Twitch como publicitario o no usando un LLM con salida estructurada (JSON schema). Demuestra workflowInput, concatenación de cadenas en CEL, structured_output_schema y returnExpression con get(step(0), ...).

manual llm structured-output json-schema moderation twitch

Descargar ZIP

Qué está incluido

CampoValor
NombreClasificar Mensaje Publicitario de Twitch
TipoWorkflow
Triggermanual
Pasos1
Entradas2

JSON Completo

Clic para expandir
{
"description": "Manual workflow that classifies a Twitch chat message as advertising or not using an LLM with structured output (JSON schema). Demonstrates workflowInput, CEL string concatenation, structured_output_schema, and returnExpression with get(step(0), ...).",
"tags": [
"manual",
"llm",
"structured-output",
"json-schema",
"moderation",
"twitch"
],
"document": {
"name": "Classify Twitch Advertising Message",
"enabled": true,
"log_level": "info",
"trigger": {
"type": "manual"
},
"workflowInput": [
{
"name": "twitch_username",
"description": "Twitch username that sent the chat message",
"schema": {
"type": "string",
"required": true,
"enableEnums": false,
"enum": []
}
},
{
"name": "twitch_message",
"description": "Raw Twitch chat message text to classify",
"schema": {
"type": "string",
"required": true,
"enableEnums": false,
"enum": []
}
}
],
"steps": [
{
"condition": {
"expr": "true"
},
"action": {
"actionType": "actions/ai/llm/chat/generate",
"actions/ai/llm/chat/generate": {
"is_advanced": true,
"platform": "openai",
"model": "gpt-4.1-mini",
"temperature": 0,
"max_tokens": 400,
"enable_structured_outputs": true,
"structured_output_schema_name": "output",
"structured_output_schema": {
"expr": "{\n \"type\": \"object\",\n \"description\": \"Classify Twitch chat for moderation.\",\n \"additionalProperties\": false,\n \"required\": [\"is_advertising\", \"confidence\", \"category\", \"reason\", \"signals\"],\n \"properties\": {\n \"is_advertising\": { \"type\": \"boolean\" },\n \"confidence\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1 },\n \"category\": {\n \"type\": \"string\",\n \"enum\": [\"viewer_advertising\", \"bot_spam_advertising\", \"not_advertising\"]\n },\n \"reason\": { \"type\": \"string\", \"minLength\": 1, \"maxLength\": 200 },\n \"signals\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"string\", \"minLength\": 1, \"maxLength\": 80 }\n }\n }\n}"
},
"messages": [
{
"role": "user",
"content_type": "text",
"content": {
"expr": "'You classify Twitch chat for moderation. Return ONLY valid JSON with exact keys: is_advertising (boolean), confidence (number from 0 to 1), category (viewer_advertising|bot_spam_advertising|not_advertising), reason (short string), signals (array of short strings). Mark as advertising for promotions, self-promo, follower/follow-back, links, codes, giveaways, paid offers, suspicious repetitive spam, or DM bait. If uncertain, return not_advertising with lower confidence. Do not include markdown code fences.'"
}
},
{
"role": "user",
"content_type": "text",
"content": {
"expr": "'Twitch username: ' + twitch_username + '\\nMessage: ' + twitch_message"
}
}
]
}
}
}
],
"returnExpression": {
"expr": "get(step(0), 'choices.0.message.content')"
}
}
}

Como Importar

  1. Descargue el archivo ZIP usando el botón de arriba
  2. Navegue a Configuración de la Empresa → Transferencia de Datos en su panel de AutoTalk
  3. Haga clic en Importar y seleccione el archivo ZIP descargado
  4. Revise el resumen de importación y confirme
  5. Todos los IDs de documentos se remapean automáticamente — no se necesita edición manual de IDs