olivebot/agent/tools/getOnRunLinkage.py
xszyou e48b8d8a2d 第4次更新
1、优化prompt;
2、解决日程删除错误;
3、iotm demo tool整体更新。
2023-12-18 16:52:53 +08:00

27 lines
790 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
from typing import Any
from langchain.tools import BaseTool
import agent.tools.IotmService as IotmService
class getOnRunLinkage(BaseTool):
name = "getOnRunLinkage"
description = "此工具用于查询农业箱当前在运行的联动设备序号小风扇1、电热风扇(2)、制冷风扇(3)、肥料开关(4)、补光设备(5)、植物生长灯(6)、二氧化碳(7)"
def __init__(self):
super().__init__()
async def _arun(self, *args: Any, **kwargs: Any) -> Any:
# 用例中没有用到 arun 不予具体实现
pass
def _run(self, para: str) -> str:
infos = IotmService.get_on_run_linkage()
return infos
if __name__ == "__main__":
tool = getOnRunLinkage()
info = tool.run("")
print(info)