Skip to content

Commit

Permalink
clean up of bingchapgpt, revgpt, cookies, json, schemas in swarms
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Oct 22, 2023
1 parent f5f95f3 commit ccb239d
Show file tree
Hide file tree
Showing 22 changed files with 1,553 additions and 138 deletions.
19 changes: 0 additions & 19 deletions bingchat.py

This file was deleted.

6 changes: 0 additions & 6 deletions cookies.json

This file was deleted.

7 changes: 2 additions & 5 deletions playground/agents/revgpt_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
"plugin_ids": [os.getenv("REVGPT_PLUGIN_IDS")],
"disable_history": os.getenv("REVGPT_DISABLE_HISTORY") == "True",
"PUID": os.getenv("REVGPT_PUID"),
"unverified_plugin_domains": [os.getenv("REVGPT_UNVERIFIED_PLUGIN_DOMAINS")]
"unverified_plugin_domains": [os.getenv("REVGPT_UNVERIFIED_PLUGIN_DOMAINS")],
}

llm = RevChatGPTModel(access_token=os.getenv("ACCESS_TOKEN"), **config)

worker = Worker(
ai_name="Optimus Prime",
llm=llm
)
worker = Worker(ai_name="Optimus Prime", llm=llm)

task = "What were the winning boston marathon times for the past 5 years (ending in 2022)? Generate a table of the year, name, country of origin, and times."
response = worker.run(task)
Expand Down
10 changes: 4 additions & 6 deletions playground/models/bingchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
from swarms.workers.worker import Worker
from swarms.tools.autogpt import EdgeGPTTool, tool
from swarms.models import OpenAIChat
import os
import os

api_key = os.getenv("OPENAI_API_KEY")

# Initialize the EdgeGPTModel
edgegpt = BingChat(cookies_path="./cookies.txt")


@tool
def edgegpt(task: str = None):
"""A tool to run infrence on the EdgeGPT Model"""
return EdgeGPTTool.run(task)


# Initialize the language model,
# This model can be swapped out with Anthropic, ETC, Huggingface Models like Mistral, ETC
llm = OpenAIChat(
Expand All @@ -22,11 +24,7 @@ def edgegpt(task: str = None):
)

# Initialize the Worker with the custom tool
worker = Worker(
llm=llm,
ai_name="EdgeGPT Worker",
external_tools=[edgegpt]
)
worker = Worker(llm=llm, ai_name="EdgeGPT Worker", external_tools=[edgegpt])

# Use the worker to process a task
task = "Hello, my name is ChatGPT"
Expand Down
2 changes: 1 addition & 1 deletion revgpt.py → playground/models/revgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"plugin_ids": [os.getenv("REVGPT_PLUGIN_IDS")],
"disable_history": os.getenv("REVGPT_DISABLE_HISTORY") == "True",
"PUID": os.getenv("REVGPT_PUID"),
"unverified_plugin_domains": [os.getenv("REVGPT_UNVERIFIED_PLUGIN_DOMAINS")]
"unverified_plugin_domains": [os.getenv("REVGPT_UNVERIFIED_PLUGIN_DOMAINS")],
}

# For v1 model
Expand Down
Loading

0 comments on commit ccb239d

Please sign in to comment.