How can I access to trial name with functional api?

I want to save some image of the model inside of trial directory, so there shouldn’t be duplicated image name, but how can I access to trial directory name when I am using functional API?