feat: remove cookies.json requirement, update env

Former-commit-id: a606f504b1
blog-agent
Zack 2 years ago
parent 1f7c9b0c46
commit efb4bb876c

@ -10,9 +10,7 @@ from swarms.models.bing_chat import BingChat
dotenv.load_dotenv(".env")
# Initialize the EdgeGPTModel
cookie = os.environ.get("BING_COOKIE")
auth = os.environ.get("AUTH_COOKIE")
model = BingChat(cookies_path="./cookies.json", bing_cookie="BING_COOKIE",auth_cookie="AUTH_COOKIE")
model = BingChat()
response = model("Generate")

@ -28,7 +28,7 @@ class BingChat:
def __init__(self, cookies_path: str = None, auth_cookie: str = None, auth_cookie_SRCHHPGUSR: str = None):
auth_cookie = os.environ("AUTH_COOKIE")
auth_cookie_SRCHHPGUSR
auth_cookie_SRCHHPGUSR = os.enviro("AUTH_COOKIE_SRCHHPGUSR")
if cookies_path:
self.cookies = json.loads(open(cookies_path, encoding="utf-8").read())
elif auth_cookie:

Loading…
Cancel
Save