Skip to content

Commit

Permalink
Switch to ChatGPT Token from username and password (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT authored May 9, 2023
1 parent 5c04c4f commit dfafa91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 3 additions & 2 deletions docs/providers/CHATGPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
We are not responsible if OpenAI bans your ChatGPT account for doing this. This may not be consistent with their rules to use their services in this way. This was developed for experimental purposes and we assume no responsibility for how you use it.

## Quick Start Guide

### Update your agent settings

1. Enter your `CHATGPT_USERNAME` and `CHATGPT_PASSWORD` with your login credentials for ChatGPT.
2. `AI_MODEL` is `gpt-3.5-turbo` for ChatGPT.
1. Set `AI_PROVIDER` to `chatgpt`
2. Set `CHATGPT_TOKEN` to your token from https://chat.openai.com/api/auth/session
12 changes: 5 additions & 7 deletions provider/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,13 @@ class ChatgptProvider:

def __init__(
self,
CHATGPT_USERNAME: str = "",
CHATGPT_PASSWORD: str = "",
CHATGPT_TOKEN: str = (None,),
AI_MODEL: str = "gpt-3.5-turbo",
**kwargs,
):
"""
Initialize the ChatGPT object\n
:param session_token: The session token to use for authentication
:param CHATGPT_TOKEN: The session token to use for authentication
:param conversation_id: The conversation ID to use for the chat session
:param auth_type: The authentication type to use (`google`, `microsoft`, `openai`)
:param email: The email to use for authentication
Expand All @@ -71,7 +70,6 @@ def __init__(
:param moderation: Whether to enable message moderation
:param verbose: Whether to enable verbose logging
"""
session_token: str = (None,)
conversation_id: str = ("",)
auth_type: str = (None,)
login_cookies_path: str = ("",)
Expand All @@ -83,11 +81,11 @@ def __init__(
verbose: bool = (False,)
self.__init_logger(verbose)
self.AI_MODEL = AI_MODEL
self.__session_token = session_token
self.__session_token = CHATGPT_TOKEN
self.__conversation_id = conversation_id
self.__auth_type = auth_type
self.__email = CHATGPT_USERNAME
self.__password = CHATGPT_PASSWORD
self.__email = None
self.__password = None
self.__login_cookies_path = login_cookies_path
self.__captcha_solver = captcha_solver
self.__solver_apikey = solver_apikey
Expand Down

0 comments on commit dfafa91

Please sign in to comment.