Is there a way in Streamlit to:
Select text in a text area
Click a button to have the selected text be used an an input to a backend function
So this would take only the text excerpt selected by the user and send that as a function input and not the entire text in the text area.
Researched and haven't found a way to do this. Thanks.

Here is a simple example with a callback associated to a button, on which you give a text input by a user as argument:
It gives that when running:
I used these text input doc and button doc.