pull/64/head
Zack 1 year ago
parent 6cb595d956
commit 421e5d6c2d

@ -1,9 +1,9 @@
from swarms.models.bing_chat import EdgeGPTModel from swarms.models.bing_chat import EdgeGPTModel
from swarms.workers.worker import Worker from swarms.workers.worker import Worker
from swarms.tools.tool.bing_chat import EdgeGPTTool from swarms.tools.tool import EdgeGPTTool
# Initialize the EdgeGPTModel # Initialize the EdgeGPTModel
edgegpt = EdgeGPTModel(cookies_path="./path/to/cookies.json") edgegpt = EdgeGPTModel(cookies_path="./cookies.txt")
# Initialize the custom tool # Initialize the custom tool
edgegpt_tool = EdgeGPTTool(edgegpt) edgegpt_tool = EdgeGPTTool(edgegpt)

@ -849,3 +849,11 @@ def tool(
return _partial return _partial
else: else:
raise ValueError("Too many arguments for tool decorator") 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)

Loading…
Cancel
Save