Pular para o conteúdo principal

Classificar Mensagem Publicitária do Twitch

Workflow manual que classifica uma mensagem de chat do Twitch como publicitária ou não usando um LLM com saída estruturada (JSON schema). Demonstra workflowInput, concatenação de strings em CEL, structured_output_schema e returnExpression com get(step(0), ...).

manual llm structured-output json-schema moderation twitch

Baixar ZIP

O que está incluído

CampoValor
NomeClassificar Mensagem Publicitária do Twitch
TipoWorkflow
Triggermanual
Etapas1
Entradas2

JSON Completo

Clique 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. Baixe o arquivo ZIP usando o botão acima
  2. Navegue até Configurações da Empresa → Transferência de Dados no seu painel AutoTalk
  3. Clique em Importar e selecione o arquivo ZIP baixado
  4. Revise o resumo da importação e confirme
  5. Todos os IDs de documentos são remapeados automaticamente — nenhuma edição manual de IDs é necessária