mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 03:52:10 +00:00
experimental: docstrings update (#18048)
Added missed docstrings. Formatted docsctrings to the consistent format.
This commit is contained in:
@@ -24,6 +24,7 @@ def _get_default_python_repl() -> PythonREPL:
|
||||
|
||||
def sanitize_input(query: str) -> str:
|
||||
"""Sanitize input to the python REPL.
|
||||
|
||||
Remove whitespace, backtick & python (if llm mistakes python console as terminal)
|
||||
|
||||
Args:
|
||||
@@ -41,7 +42,7 @@ def sanitize_input(query: str) -> str:
|
||||
|
||||
|
||||
class PythonREPLTool(BaseTool):
|
||||
"""A tool for running python code in a REPL."""
|
||||
"""Tool for running python code in a REPL."""
|
||||
|
||||
name: str = "Python_REPL"
|
||||
description: str = (
|
||||
@@ -76,11 +77,13 @@ class PythonREPLTool(BaseTool):
|
||||
|
||||
|
||||
class PythonInputs(BaseModel):
|
||||
"""Python inputs."""
|
||||
|
||||
query: str = Field(description="code snippet to run")
|
||||
|
||||
|
||||
class PythonAstREPLTool(BaseTool):
|
||||
"""A tool for running python code in a REPL."""
|
||||
"""Tool for running python code in a REPL."""
|
||||
|
||||
name: str = "python_repl_ast"
|
||||
description: str = (
|
||||
|
Reference in New Issue
Block a user