Question and Answer Chain - Character Limit around 1100 to 1300 - Can’t get responses that are longer
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:
n8n version: 1.42.1
Database: supabase
n8n EXECUTIONS_PROCESS setting: v1_recommended
Operating system - Windows 11 Home Version 23H2 OS build 22631.3593
@barn4k or @bartv - tagging y’all because y’all seem the most active.
Want to build out more apps for other companies but need this functionality resolved first though. Let me know if you have any questions.
Hey @dustinAIAIDE,
Can you share the actual JSON for your workflow so we can test it? We don’t think there is a hard set limit so we want to check the options you are using.
@Jon - I think I pasted the JSON correctly. Let me know if that helped! Thank you for looking into this!
@Jon - Bump. Would love to have a solution for this.
@barn4k / @bartv - I see Jon hasn’t responded to any posts for 5 days (I’m guessing he is on vacation). Bumping y’all again too to see if I can get a solution. Thank you.
Hi Dustin,
There are two things I would suggest:
Use the gpt3.5-turbo-16k model. This gives you access to a model that has a bigger context window and is not too much more expensive than gpt3.5-turbo.
The second thing is to set the Maximum Number of Tokens parameter in the OpenAI node. There is an option for that. Set it to 4000, for example.
Hope that helps.
Derek
@Derek_Cheung Your suggestions won’t help I don’t believe. It’s simply that the response is getting cut off at the end. Here is an example of what I see in Slack and also what happens in n8n. I think it’s a bug in n8n to be honest. I believe the model to be responding correctly. But, somehow the back-end code of n8n is shortening the character limit displayed.
@Derek_Cheung Actually, I tried what you said and it did help not get the response to be cut off anymore. So, thank you so much for that.
I changed the model and tested the Max Number of Tokens between 4000, 8000, 12000, 16000. Still my Slackbot response is limiting out around 3200 characters tops. Asking for more sections and rules actually really helped extend (increase the number of characters in…) the response. I am trying to get it to respond with more. But, it won’t listen to my minimum character limit request. Thoughts?
I thought telling it to respond in a certain amount of characters would do the trick. But, it hasn’t.
This response had 3,158 characters in this snapshot above.
There’s two additional approaches to try. Use a different model that tends to produce more detailed answers. For example, Claude 3 family (haiku, sonnet, opus) are good options to try. Another option is Google’s Gemini family (flash and pro 1.5)
The harder approach is to take a similar approach to what this template does:
Giulio on the n8n team does a brilliant job at creating an approach that uses a LLM call to create a set of prompts that dive into various aspects of a task; then has multiple LLM calls for each detail and then combines the result.
If you combine that approach with using the vector store as a tool, you can control the size of the output. (I have a sample template with stock analysis that does that kind of thing).
The downsize is the complexity and time for the query, so it might not be feasible for your use case.
Hope that helps,
Derek
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.