[全量] 初始化项目代码、配置、文档及Agent协同harness
This commit is contained in:
9
langchain-chat/server/agent/tools/shell.py
Normal file
9
langchain-chat/server/agent/tools/shell.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# 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命令")
|
||||
Reference in New Issue
Block a user