Injecting prompt to chat through action or api

I am trying to develop some automation, and I would need to be able to “inject” prompt into currently active chat, reference rules, files…etc.
I have tried to find appropriate action, but to no success.
Does anyone have an idea on how to do this ?