langchain_experimental.tools.python.tool.sanitize_input¶

langchain_experimental.tools.python.tool.sanitize_input(query: str) str[source]¶

Sanitize input to the python REPL.

Remove whitespace, backtick & python (if llm mistakes python console as terminal)

Parameters

query (str) – The query to sanitize

Returns

The sanitized query

Return type

str