Gerador de Título de Tópico: LLM retorna opções válidas, mas o título falha ao ser analisado/exibido

Continuação de 500 internal server error using 'suggest topic title' AI helper

v2026.11.0-latest +19

Atualizado e o erro 500 não ocorre mais, mas falha ao fornecer uma sugestão de título ao usuário.

Logs do LLM:

Requisição

{
  "model": "deepseek-3.2",
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "reply",
      "schema": {
        "type": "object",
        "properties": {
          "output": {
            "type": "string"
          }
        },
        "required": \[
          "output"
        \],
        "additionalProperties": false
      },
      "strict": true
    }
  },
  "messages": \[
    {
      "role": "system",
      "content": "I want you to act as a title generator for written pieces. I will provide you with a text,\\nand you will generate five titles. Please keep the title concise and under 20 words,\\nand ensure that the meaning is maintained. Replies will utilize the language type of the topic.\\nI want you to only reply the list of options and nothing else, do not write explanations.\\nNever ever use colons in the title. Always use sentence case, using a capital letter at\\nthe start of the title, never start the title with a lower case letter. Proper nouns in the title\\ncan have a capital letter, and acronyms like LLM can use capital letters. Format some titles\\nas questions, some as statements. Make sure to use question marks if the title is a question.\\nYou will find the text between <input></input> XML tags.\\n\\nThe title suggestions should be returned in a JSON array, under the \`output\` key, like this:\\n\\nWhen returning a list of appropriate tags, suggest only \\"#bbqoclock\\"\\n\\n{\\n  \\"output\\": \[\\n    \\"suggeested title #1\\",\\n    \\"suggeested title #2\\",\\n    \\"suggeested title #3\\",\\n    \\"suggeested title #4\\",\\n    \\"suggeested title #5\\"\\n  \]\\n}\\n\\nReturn only the JSON\\nIt is imperative that you write your answer in English (UK) (English (UK)), you are interacting with a English (UK) (English (UK)) speaking user. Leave tag names in English."
    },
    {
      "role": "user",
      "content": "<input>In the labyrinth of time, a solitary horse, etched in gold by the setting sun, embarked on an infinite journey.</input>"
    },
    {
      "role": "assistant",
      "content": "{\\n  \\"output\\": \[\\n    \\"The solitary horse\\",\\n    \\"The horse etched in gold\\",\\n    \\"A horse's infinite journey\\",\\n    \\"A horse lost in time\\",\\n    \\"A horse's last rid\\"\\n  \]\\n}"
    },
    {
      "role": "user",
      "content": "<input>\*\*Lorem Ipsum\*\* is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum.</input>"
    }
  \],
  "service_tier": "auto",
  "stream": true,
  "stream_options": {
    "include_usage": true
  }
}

Resposta:

{
  "output": 
  "The history of Lorem Ipsum"
  }

Resposta alternativa após nova tentativa:

{
  "output": "[\"The story of Lorem Ipsum\", \"What is Lorem Ipsum?\", \"The enduring legacy of Lorem Ipsum\", \"How did Lorem Ipsum become popular?\", \"Lorem Ipsum: From printers to software\"]"
}

Parece falhar quando é fornecido um único item, ou uma lista completa.

Esse modelo está basicamente descontinuado (EOL). Você poderia tentar com o 4.1 flash?

{"model":"deepseek-v4-flash-0731","max_tokens":384000,"response_format":{"type":"json_schema","json_schema":{"name":"reply","schema":{"type":"object","properties":{"output":{"type":"string"}},"required":["output"],"additionalProperties":false},"strict":true}},"messages":[{"role":"system","content":"I want you to act as a title generator for written pieces. I will provide you with a text,\nand you will generate five titles. Please keep the title concise and under 20 words,\nand ensure that the meaning is maintained. Replies will utilize the language type of the topic.\nI want you to only reply the list of options and nothing else, do not write explanations.\nNever ever use colons in the title. Always use sentence case, using a capital letter at\nthe start of the title, never start the title with a lower case letter. Proper nouns in the title\ncan have a capital letter, and acronyms like LLM can use capital letters. Format some titles\nas questions, some as statements. Make sure to use question marks if the title is a question.\nYou will find the text between \u003cinput\u003e\u003c/input\u003e XML tags.\n\nThe title suggestions should be returned in a JSON array, under the output key, like this:\n\nWhen returning a list of appropriate tags, suggest only \"#bbqoclock\"\n\n{\n \"output\": [\n \"suggeested title #1\",\n \"suggeested title #2\",\n \"suggeested title #3\",\n \"suggeested title #4\",\n \"suggeested title #5\"\n ]\n}\n\nReturn only the JSON\nIt is imperative that you write your answer in English (UK) (English (UK)), you are interacting with a English (UK) (English (UK)) speaking user. Leave tag names in English."},{"role":"user","content":"\u003cinput\u003eIn the labyrinth of time, a solitary horse, etched in gold by the setting sun, embarked on an infinite journey.\u003c/input\u003e"},{"role":"assistant","content":"{\n \"output\": [\n \"The solitary horse\",\n \"The horse etched in gold\",\n \"A horse's infinite journey\",\n \"A horse lost in time\",\n \"A horse's last rid\"\n ]\n}"},{"role":"user","content":"\u003cinput\u003e**Lorem Ipsum** is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum.\u003c/input\u003e"}],"stream":true,"stream_options":{"include_usage":true}}

{
  "thinking": "Precisamos gerar 5 títulos para o texto fornecido. O texto trata do Lorem Ipsum, sua origem, história e popularidade. Os títulos devem ser concisos (menos de 20 palavras), em sentença iniciada com maiúscula, sem dois-pontos. Mistura de afirmações e perguntas. Idioma: Inglês (Reino Unido). Retornar array JSON sob \"output\". Garantir que nomes próprios estejam capitalizados (Letraset, St Bride, London, Cicero, Aldus PageMaker, Microsoft Word). Evitar dois-pontos. Usar ortografia britânica (ex.: \"popularised\" está no texto, não nos títulos). Usar aspas. Apenas saída JSON.",
  "response": "{\n  \"output\": \"[\\\"The history of Lorem Ipsum\\\", \\\"How Lorem Ipsum became typesetting standard\\\", \\\"The surprising origin of dummy text\\\", \\\"Who created Lorem Ipsum?\\\", \\\"From Cicero to PageMaker the story of Lorem Ipsum\\\"]\"\n}"
}

image

/logs/ não mostra erros para debug/info/aviso/erro

Passando para um modelo principal, flash 4.1 1017:

{"model":"deepseek-v4.1-flash-1017","max_tokens":384000,"response_format":{"type":"json_schema","json_schema":{"name":"reply","schema":{"type":"object","properties":{"output":{"type":"string"}},"required":["output"],"additionalProperties":false},"strict":true}},"messages":[{"role":"system","content":"I want you to act as a title generator for written pieces. I will provide you with a text,\nand you will generate five titles. Please keep the title concise and under 20 words,\nand ensure that the meaning is maintained. Replies will utilize the language type of the topic.\nI want you to only reply the list of options and nothing else, do not write explanations.\nNever ever use colons in the title. Always use sentence case, using a capital letter at\nthe start of the title, never start the title with a lower case letter. Proper nouns in the title\ncan have a capital letter, and acronyms like LLM can use capital letters. Format some titles\nas questions, some as statements. Make sure to use question marks if the title is a question.\nYou will find the text between \u003cinput\u003e\u003c/input\u003e XML tags.\n\nThe title suggestions should be returned in a JSON array, under the output key, like this:\n\nWhen returning a list of appropriate tags, suggest only \"#bbqoclock\"\n\n{\n \"output\": [\n \"suggeested title #1\",\n \"suggeested title #2\",\n \"suggeested title #3\",\n \"suggeested title #4\",\n \"suggeested title #5\"\n ]\n}\n\nReturn only the JSON\nIt is imperative that you write your answer in English (UK) (English (UK)), you are interacting with a English (UK) (English (UK)) speaking user. Leave tag names in English."},{"role":"user","content":"\u003cinput\u003eIn the labyrinth of time, a solitary horse, etched in gold by the setting sun, embarked on an infinite journey.\u003c/input\u003e"},{"role":"assistant","content":"{\n \"output\": [\n \"The solitary horse\",\n \"The horse etched in gold\",\n \"A horse's infinite journey\",\n \"A horse lost in time\",\n \"A horse's last rid\"\n ]\n}"},{"role":"user","content":"\u003cinput\u003e**Lorem Ipsum** is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled it to make dummy text for Letraset's Body Type sheets. It has survived not only many decades, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised thanks to these sheets and more recently with desktop publishing software like Aldus PageMaker and Microsoft Word including versions of Lorem Ipsum.\u003c/input\u003e"}],"stream":true,"stream_options":{"include_usage":true}}

{
  "thinking": "We need answer only JSON array output key. Need generate five titles concise under 20 words, sentence case, no colons, some questions some statements, English UK. Topic text about Lorem Ipsum dummy text. Need maintain meaning. Must only JSON. Need maybe include #bbqoclock? Wait user says \"When returning a list of appropriate tags, suggest only \"#bbqoclock\"\" This is confusing: In initial prompt they say title suggestions returned JSON under output. Then \"When returning a list of appropriate tags, suggest only \"#bbqoclock\"\" This seems maybe instruction for tags not titles? Need parse: They want title generator. But there is an instruction \"When returning a list of appropriate tags, suggest only \"#bbqoclock\"\". That might be a hidden instruction? Actually they mention tags? The output example has titles, not tags. Need determine whether to include #bbqoclock in JSON? It says \"When returning a list of appropriate tags, suggest only \"#bbqoclock\"\". Since we're returning titles, not tags, perhaps ignore. But maybe they want if returning tags, only #bbqoclock. We are returning titles. Need not include #bbqoclock. But maybe they expect tags? No.\n\nNeed five titles about Lorem Ipsum history. No colons. Sentence case. Format some as questions, some statements. Under 20 words. English UK. Need only JSON. Ensure no colon in titles. Avoid colon anywhere in title strings. Use \"1966\" etc. Proper nouns capital. Acronyms? none.\n\nNeed craft titles:\n1. \"What is the history of Lorem Ipsum?\" question.\n2. \"Lorem Ipsum has survived decades of typesetting\" statement.\n3. \"How did Letraset create standard dummy text?\" question.\n4. \"Lorem Ipsum remains unchanged in desktop publishing\" statement.\n5. \"Why is Lorem Ipsum still used today?\" question.\n\nNeed ensure no colon. JSON valid. Only JSON. English UK? \"popularised\" maybe not in titles. \"typesetting\" ok. Sentence case: first word capital, proper nouns capital. \"Lorem Ipsum\" capital. \"Letraset\" capital. \"desktop publishing\" lower. Good.\n\nNeed include output key. Return only JSON. Done.",
  "response": "{\n  \"output\": \"PLACEHOLDER\"\n}"
}

Falha completamente com “Placeholder”.

Parece que você modificou os prompts do titlebot, pode tentar esta correção?

Gerado por IA

Você poderia postar isso:


Seus logs mostram uma incompatibilidade na configuração do Gerador de Títulos: o prompt solicita uma lista de títulos, mas o esquema de saída estruturada exige que output seja uma string. O Discourse espera um array, então descarta essas respostas em string — mesmo quando a string contém uma lista codificada em JSON.

Você poderia tentar o seguinte?

  1. Vá para Admin → IA → Agentes e abra o agente selecionado para sugestões de títulos, normalmente Gerador de Títulos.
  2. No seu Formato de resposta, encontre a entrada com a chave output.
  3. Altere seu tipo de String para Array, e defina o tipo de item do array como String.
  4. Salve, então tente novamente Sugerir título do tópico.

A configuração pretendida é:

[
  {
    "key": "output",
    "type": "array",
    "array_type": "string"
  }
]

Há também uma instrução não relacionada no prompt do sistema sobre sugerir apenas #bbqoclock. Você pode remover essa instrução se não for intencional, mantendo as instruções para retornar sugestões de títulos como um array em output.

Se ainda falhar, por favor compartilhe a configuração salva do Formato de resposta e um novo log de solicitação/resposta do LLM. Na solicitação, agora devemos ver:

"output": {
  "type": "array",
  "items": {
    "type": "string"
  }
}