Skip to main content

Add your description here

Project description

Browser-gpt-api

Interact with ChatGPT via an API running on a local server using Selenium under the hood.

What is it?

A python tool to help you send prompts to ChatGPT webpage and get response via API calls. With Browser-GPT you can get infinite amount of API calls without worrying about any credits. This works by automating the process of sending a prompt to ChatGPT and getting the response back using Selenium.

How to Install & run:

This project uses Rye Package manager

  1. Clone the repository:

    git clone https://github.com/vertexcover-io/browser-gpt-api.git
    cd src/browser_gpt_api
    
  2. Install project dependencies using Rye:

    rye sync
    
  3. Create a copy of the environment variable template file and edit it according to your configuration:

    cp .env.template .env
    
  4. Download Chrome Driver based on your chrome version and OS.

  5. Add the location of chromedriver.exe file as a System variable in Environmental variables.

  6. In the main directory run setup.py:

    python setup.py
    
  7. To setup your local-server run server.py:

    python server.py
    
  8. Now you can access ChatGPT via the API endpoint : http://127.0.0.1:8000/chat/completion

Stack

  • Rye
  • Selenium
  • FastAPI
  • uvicorn

Pre-Commit

Set up pre-commit hooks to automatically check your code for linting and formatting issues before the commit. Run following command to install pre-commit hooks:

rye run pre-commit install

Format and Lint

This project uses Ruff for code formatting and linting. Use following commands to format and lint your code:

  • Check for issues:
ruff check 
  • Format your code:
ruff format

For more information refer to the Ruff Documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

browser_gpt_api-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

browser_gpt_api-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file browser_gpt_api-0.1.0.tar.gz.

File metadata

  • Download URL: browser_gpt_api-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for browser_gpt_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 742250d8085ba1ba60ccbdefd494edab1c26ab64fb39ffe46c4dec1f3ce210ed
MD5 fbc287f31280e37de11a384dbba922c5
BLAKE2b-256 ab362640b1db79e2395950d4e97d64d61b1850d7fb3e37f512eef74409e3b060

See more details on using hashes here.

File details

Details for the file browser_gpt_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for browser_gpt_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96bcfe28a9e236d3e334b2530548cc0a05d516e8d89500dd78956ba71eb0fa26
MD5 668e5a78454fa56bec2bcc16808454c6
BLAKE2b-256 d30e8b4a8b5bce1f15d77778c4012503b8930b1c18814c13928eeedb16d97702

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page