Configure lspconfig root for a repo with more than one language

I have a repo which uses typescript for frontend and python for backend, they are on separate folders, how can I tell each language server on which folder they should treat as root ?

Each language server already has it’s own root directory detection, so just make sure whatever function you are passing to root_dir in your setup call to implement your custom root directory rules matches the root dir you want for each language server.