That makes no sense. Why don't you just set a char-limit on the input and reject anything that's too long?
If I trim I may lost important context. I understand the concern here.
Who said anything about trimming?
Make your text box only hold as much data as you can transmit. Or send two messages if you need to. Do you think someone is going to paste a novel in there or something? This is a VERY stupid reason to use an LLM.