I’m working on a project in which I’m executing code from an LLM in a Jupyter Kernel to play around with and iterate on. I’m using the jupyter-client library to instantiate a kernel and allow the LLM to send code for execution.
However, I want to be able to have some preset variables (for example, a dataframe called df
which was already read in/created). However, this should be programmatic, and not hardcoded (i.e. I don’t want to import a module because its contents can change depending on the use case). Is there any way to pass objects directly to a jupyter kernel, perhaps on startup?