Former-commit-id: 421e5d6c2d
discord-bot-framework
Zack 1 year ago
parent bd6df93eaf
commit 7d62879947

@ -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)

@ -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)

Loading…
Cancel
Save