code-yeongyu / AiShell

AiShell: A Natural Language Shell like GitHub Copilot X, Powered by ChatGPT
MIT License
151 stars 14 forks source link

Use Access Token instead of Session Token #55

Closed code-yeongyu closed 1 year ago

code-yeongyu commented 1 year ago

This issue contains the content of #52:

As a solution of this, I am thinking of:

1. Update config json like following
  ```json
{
    "language_model": "reverse_engineered_chatgpt",
    "openai_api_key": null,
    "browser": "brave" // firefox, chrome, safari or whatever
}
  1. Replace session token retrieving code as access token retrieving code

    • Using the browser's cookie, send request to https://chat.openai.com/api/auth/session to get the access token
  2. Send request to ChatGPT using configured information from 2

code-yeongyu commented 1 year ago

I am thinking of accomplish this by adopt this method to ygka and have ygka as dependency like I have mentioned in #49