parent
138fa40b48
commit
5f81b0ae03
@ -0,0 +1,19 @@
|
|||||||
|
from swarms.models.bing_chat import BingChat
|
||||||
|
from swarms.workers.worker import Worker
|
||||||
|
from swarms.tools.autogpt import EdgeGPTTool, tool
|
||||||
|
|
||||||
|
|
||||||
|
# Initialize the language model,
|
||||||
|
# This model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC
|
||||||
|
llm = BingChat(cookies_path="./cookies.json")
|
||||||
|
|
||||||
|
# Initialize the Worker with the custom tool
|
||||||
|
worker = Worker(
|
||||||
|
llm=llm,
|
||||||
|
ai_name="EdgeGPT Worker",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Use the worker to process a task
|
||||||
|
task = "Hello, my name is ChatGPT"
|
||||||
|
response = worker.run(task)
|
||||||
|
print(response)
|
@ -0,0 +1,6 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "cookie1",
|
||||||
|
"value": "1GJjj1-tM6Jlo4HFtnbocQ3r0QbQ9Aq_R65dqbcSWKzKxnN8oEMW1xa4RlsJ_nGyNjFlXQRzMWRR2GK11bve8-6n_bjF0zTczYcQQ8oDB8W66jgpIWSL7Hr4hneB0R9dIt-OQ4cVPs4eehL2lcRCObWQr0zkG14MHlH5EMwAKthv_NNIQSfThq4Ey2Hmzhq9sRuyS04JveHdLC9gfthJ8xk3J12yr7j4HsynpzmvFUcA"
|
||||||
|
}
|
||||||
|
]
|
@ -1,2 +1,2 @@
|
|||||||
from swarms.structs.workflow import Workflow
|
# from swarms.structs.workflow import Workflow
|
||||||
from swarms.structs.task import Task
|
# from swarms.structs.task import Task
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
from swarms.tools.tool import BaseTool
|
|
||||||
|
|
||||||
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…
Reference in new issue