Saltar al contenido principal
EjemploAvanzado1 min de lecturaActualizado el Apr 4, 2026
workflowmanualllmstructured-outputtwitchmoderationspam

Workflow de Moderación de Twitch (Clasificador de Anuncios)

Workflow usado por el bot moderador de Twitch para clasificar mensajes publicitarios de venta de espectadores, venta de suscriptores y similares como spam, y luego emitir el veredicto de moderación como texto de conversación.

Descargar ZIP · 5.2 KB

JSON Completo

Clic para expandir
{
"description": "Workflow used by the Twitch moderator bot to classify spammy viewer-selling, subscriber-selling, and similar advertising messages, then emit the moderation verdict as conversation text.",
"tags": [
"workflow",
"manual",
"llm",
"structured-output",
"twitch",
"moderation",
"spam"
],
"linkedExamples": [
{
"type": "agents",
"variant": "twitch-bot-assistant-moderator",
"relationship": "Companion Twitch bot agent routes non-command chat messages into this workflow for moderation."
}
],
"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",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"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}",
"onFailure": "fallback",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"messages": [
{
"role": "user",
"content_type": "text",
"audio_format": "mp3",
"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.'",
"onFailure": "fallback",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
},
{
"role": "user",
"content_type": "text",
"audio_format": "mp3",
"content": {
"expr": "'Twitch username: ' + twitch_username + '\\nMessage: ' + twitch_message",
"onFailure": "fallback",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
]
}
}
},
{
"condition": {
"expr": "true",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
},
"action": {
"actionType": "actions/messaging/conversation/response/compose",
"actions/messaging/conversation/response/compose": {
"messages": [
{
"type": "text",
"payload": {
"text": {
"expr": "json_stringify(get(step(0), 'choices.0.message.content.is_advertising'))",
"onFailure": "throw",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}
]
}
}
}
],
"customAttributes": {},
"returnExpression": {
"expr": "\"\"",
"onFailure": "fallback",
"fallback": "",
"resultType": "any",
"strict": false,
"useSimpleCel": false
}
}
}

Cómo Usar

Importe este workflow junto con el agente complementario Twitch Moderator Bot, que enruta hacia él los mensajes de chat que no son comandos para su moderación.

TipoWorkflow
Reglas2
Canaltwitch
Versión1.0.0
Descargar ZIP
twitch-bot-assistant-moderator5.2 KB
En esta página