CaioElias
CaioElias4w ago

agent block response

I have a function that splits a paragraph into shorter sentences. When I used prompt blocks, I could easily use this function because I was able to store the prompt's response in a variable. However, I’m having trouble doing the same with an Agent block response. How can I store the Agent block's response in a variable or make the Agent reply in shorter, separated sentences instead of one long paragraph? I’ll be using this on WhatsApp, so shorter messages are better than large blocks of text. How can I make the function called inside the Agent block receive as input the message the AI is about to send to the user? I want this function to break the message into a maximum of 5 shorter sentences. Also, how can I configure the Agent to send each of these sentences as separate replies to the user (for example, on WhatsApp), instead of sending one long message?
1 Reply
Dali
Dali4w ago
If you have n8n, I suggest you to create a webhook flow that takes in input the sentence and returns the paragraph broken down in sentences. You’d pass the input to an ai model and return the result.

Did you find this page helpful?