You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Registry to store default preamble values for tools.
58
59
Currently, it's implemented as a class with predefined values, but we can use set_preamble to set values.
59
60
"""
60
61
_default_preambles= {
61
-
"toolkit_python_interpreter": "If you decide to use toolkit_python_interpreter tool and are going to plot something, try returning result as a png. Ensure that the generated code does not include any internet connection, and avoid using the module named requests. ",
62
+
"toolkit_python_interpreter": "If you decide to use toolkit_python_interpreter tool and are going to plot something, try returning result as a png. Ensure that the generated code does not include any internet connection.",
62
63
"read_file": "When using the read_file tool, always ensure that the file parameter is prepared as a tuple in the format (filename, file ID). The order of the tuple fields is critical. ",
63
64
"search_file":"When using the search_file tool, always ensure that the `files` parameter is prepared as a list of tuples in the format (filename, file ID). The order of the tuple fields is critical. "
preamble=f"If you decide to use the toolkit_python_interpreter tool and plan to plot something, try returning the result as a PNG. Ensure that the generated code does not require an internet connection. Avoid using the following packages in code generation: {forbidden_preamble_packages}. "
105
+
returnpreamble
106
+
exceptExceptionase:
107
+
logger.error(f"Error while retrieving the Python interpreter preamble.: {str(e)}")
0 commit comments