AgGrid: Expand / Collapse Groups via API

there is doc JavaScript Grid: Row Grouping - Opening Groups | AG Grid how to call AgGrid api and expand or collapse groups by clicking the button.

Can you help me to implement the same functionality with streamlit ?