diff --git a/bingchat.py b/bingchat.py index 07c2a21b..db4db08b 100644 --- a/bingchat.py +++ b/bingchat.py @@ -1,9 +1,9 @@ from swarms.models.bing_chat import EdgeGPTModel from swarms.workers.worker import Worker -from swarms.tools.tool.bing_chat import EdgeGPTTool +from swarms.tools.tool import EdgeGPTTool # Initialize the EdgeGPTModel -edgegpt = EdgeGPTModel(cookies_path="./path/to/cookies.json") +edgegpt = EdgeGPTModel(cookies_path="./cookies.txt") # Initialize the custom tool edgegpt_tool = EdgeGPTTool(edgegpt) diff --git a/swarms/tools/tool.py b/swarms/tools/tool.py index 783f0946..ed364556 100644 --- a/swarms/tools/tool.py +++ b/swarms/tools/tool.py @@ -849,3 +849,11 @@ def tool( return _partial else: raise ValueError("Too many arguments for tool decorator") + +class EdgeGPTTool(BaseTool): + def __init__(self, model, name="EdgeGPTTool", description="Tool that uses EdgeGPTModel to generate responses"): + super().__init__(name=name, description=description) + self.model = model + + def _run(self, prompt): + return self.model.__call__(prompt)