mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-01-19 21:37:20 +08:00
12 lines
302 B
Python
12 lines
302 B
Python
# LangChain 的 Shell 工具
|
|
from server.pydantic_v1 import BaseModel, Field
|
|
from langchain_community.tools import ShellTool
|
|
|
|
|
|
def shell(query: str):
|
|
tool = ShellTool()
|
|
return tool.run(tool_input=query)
|
|
|
|
class ShellInput(BaseModel):
|
|
query: str = Field(description="The command to execute")
|