Finish_reason:length - Splitt text

Describe the problem/error/question

Hello, I translate voice messages about 20-30 minutes from voice to text. Then I have an English text. In the next step, I want to translate it with OpenAI to German. Now I have the problem with the length and max token. Is there any option that I can say split the text from the SET Node every time by 50% into two other SET nodes?

Maybe someone has a good hint or trick?

cheers

What is the error message (if any)?

Please share your workflow

In progress

Share the output returned by the last node

finish_reason:length and the text is missing

Information on your n8n setup

  • **n8n version: 1.50.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker)
  • **Operating system: ubuntu

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @chris2, thanks for posting! :sun_with_face:

One option could be to use the code node that takes an input string and splits it into two halves, and returns them. Like so:

2 Likes

Thanks, yes it works for my solution perfect :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.