Queries might reference common packages-- including those in the standard library-- that are not in the namespace of the .query method.
A workaround is to add an instruction in the query to "import any packages you need", but this is cumbersome.
Consider leveraging langchain's PythonREPL and supporting agentic behavior (e.g., so that standard library packages can be imported when needed).