How to disable Chat History in a specific "Generate Text" block?

Hello,

I am building a workflow and I’ve noticed that my ‘Generate Text’ blocks are sending the entire chat history in every request to the AI model.

In my recent debuggers, the prompt size reached over 37,000 tokens, even though my System Prompt is much smaller. This is significantly increasing my token usage and costs.

Could you please guide me on how to:

  1. Disable the automatic inclusion of chatHistory in a specific ‘Generate Text’ block?

  2. Configure the block to only send the current System Prompt and specific variables without the previous messages from the session?

I want to ensure each run is independent to optimize performance and reduce costs.

Hi @estevankmp,

Thanks for the post!

You can control this by adjusting the Chat History Behavior setting in your Generate Text block. Set it to “Hide”:

Please note that only Generate Text blocks with their output set to “Display to User” will include their generated output in chat history when Chat History Behavior is set to “Include”. If yours aren’t set to display, please share a remix link to your Agent, so I can take a closer look.

You can find the remix link in the Remixing settings of your agent. Please make sure to click Publish before sharing the remix link, so I can copy the latest version of your agent.