Let $U\sim \text{Unif}(0,1)$, and let $\mu \in \mathcal{P}(\mathbb{R})$ be an arbitrary probability measure on $\mathbb{R}$. Then from $\mu$, we can derive an associated CDF $F(x) = \mu((-\infty,x])$. We consider the following inverse of $F$:
$$F^{-1}(u) = \inf\{x \in \mathbb{R}: F(x) \geq u\}.$$
Then it's easy to show that $F^{-1}(U)\sim \mu$. In other words, $F^{-1}(U)$ is a sample of a random variable distributed like $\mu$.
Is there a similar construction when we now assume that $\mu \in \mathcal{P}(S)$ is a probability distribution on some arbitrary Polish space $S$? That is, does there exist a random element $X$ taking values in some other Polish space $T$ and a mapping $\psi: \mathcal{P}(S) \to (T \to S)$ from probability measures on $S$ to measurable functions from $T$ to $S$ such that $\psi(\mu)(X)\sim \mu$ for all $\mu \in \mathcal{P}(S)$?
I would be interested in proofs that such a mapping exists (or even more interesting, doesn't), but it would be absolutely amazing if the proof was constructive. I'd also be interested in references to the literature where this problem may have already been addressed. Thank you!