Python-in-Python Sandboxing LLM Generated Code

I've been experimenting with Langchain for GPT based queries. One problem we often encounter with GPT is hallucinations. This makes certain classes of problems unsuited to GPT, one example is maths and statistics. Whilst there are improvements for recent models often the maths cannot be trusted. When I try to …