Quantum Circuit Generation via test-time learning with large language models