Spaces:
Running
Running
Download server/agent/tools/shell.py from Zulelee/langchain-chatchat: direct link, hf CLI and curl.
- Browser
- Download file 303 Bytes
-
https://huggingface.co/spaces/Zulelee/langchain-chatchat/resolve/main/server/agent/tools/shell.py
- Command line
-
hf download hf://spaces/Zulelee/langchain-chatchat/server/agent/tools/shell.py
-
curl -L -o shell.py https://huggingface.co/spaces/Zulelee/langchain-chatchat/resolve/main/server/agent/tools/shell.py
303 Bytes
| # LangChain 的 Shell 工具 | |
| from pydantic import BaseModel, Field | |
| from langchain.tools import ShellTool | |
| def shell(query: str): | |
| tool = ShellTool() | |
| return tool.run(tool_input=query) | |
| class ShellInput(BaseModel): | |
| query: str = Field(description="一个能在Linux命令行运行的Shell命令") |