llm-workflow-engine icon indicating copy to clipboard operation
llm-workflow-engine copied to clipboard

Headless mode to run in docker

Open agentzhao opened this issue 3 years ago • 3 comments

Is there a way to set up the authentication such that it can be ran inside a docker container?

agentzhao avatar Jan 14 '23 08:01 agentzhao

I'd like to know this too!

kbfifi avatar Jan 14 '23 13:01 kbfifi

This could be a bit challenging. There are a few ways to approach this:

  • Automating authentication: There are services that can automate the filling of captchas, allowing for seamless authentication.
  • Using cookies from a previous session as parameters when starting the script: You can start the script locally, export the cookies, and then use them as parameters when starting the script in a Docker container. This would involve two steps: first, starting the script locally and exporting the cookies, and then starting the Docker container with the local parameters.

Both cases require some involved modifications to the script. If you tackle this, I would welcome any PR (no worries if the code is not clean, I can help improving it).

mmabrouk avatar Jan 17 '23 12:01 mmabrouk

You could do it like this:

  1. Set your session location (user_dir from https://github.com/mmabrouk/chatgpt-wrapper/blob/main/chatgpt_wrapper/chatgpt.py#L50) to be shared using a docker volume
  2. Run wrapper and log in locally
  3. Start the docker container, using the same state from above

This isn't a perfect solution as you still need to detect session time out. But I can't think of a better way to feasibly do this.

brandonrobertz avatar Jan 17 '23 20:01 brandonrobertz

This would probably need somebody to make a PR, or sponsorship.

thehunmonkgroup avatar Apr 01 '23 20:04 thehunmonkgroup

Since the browser backend has been deprecated, the Docker container has been changed to leverage the API backed, and authentication is handled via API key.

thehunmonkgroup avatar Apr 11 '23 18:04 thehunmonkgroup