BrowserGPT

所属分类:GPT/ChatGPT
开发工具:JavaScript
文件大小:22665KB
下载次数:0
上传日期:2023-03-30 05:45:34
上 传 者sh-1993
说明:  使用GPT命令浏览器
(Command your browser with GPT ,)

文件列表:
.env.example (59, 2023-03-30)
.eslintrc.json (233, 2023-03-30)
.husky (0, 2023-03-30)
.husky\pre-commit (57, 2023-03-30)
.prettierrc.json (109, 2023-03-30)
LICENSE.md (1086, 2023-03-30)
index.js (5823, 2023-03-30)
package-lock.json (250317, 2023-03-30)
package.json (899, 2023-03-30)
playwright.config.js (2440, 2023-03-30)
public (0, 2023-03-30)
public\browsergpt.gif (12223166, 2023-03-30)
public\browsergpt.mp4 (13462433, 2023-03-30)

# BrowserGPT This project allows you to control your browser using natural language. It integrates OpenAI's GPT-4 with the Playwright library, enabling seamless browser navigation. GPT-4 generates code snippets, which Playwright executes to carry out specified tasks. ## Demo ![BrowserGPT in action](https://github.com/mayt/BrowserGPT/blob/master/./public/browsergpt.gif) ## Installation ### Install the required packages: ```sh npm install ``` ### Create a `.env` file in the project root directory and add the following line: ``` OPENAI_API_KEY=your_openai_api_key ``` Replace `your_openai_api_key` with your actual OpenAI API key. ### Run the script: ```sh npm run start ``` ### Options: ``` Usage: npm run start -- [options] Options: -u, --url url to start on (default: "https://www.google.com") -m, --model openai model to use (default: "gpt-3.5-turbo") -h, --help display help for command ``` ## Usage The script opens a browser window. In the terminal, you'll be prompted to enter a task. Type your task using natural language (e.g., "Generate an interesting phrase and type it into Google") and press Enter. GPT-4 can recognize buttons and text on the page and will navigate the browser to complete the specified task. To stop the script, press `Ctrl + C` in the terminal. ## Examples Here are some example tasks you can input: - `go to hn` - `click on the abc article` - `enter abc@test.com into the email box. John and Doe in the first and last name boxes respectively` - `generate a spicy comment on what xyz said and put it in the comment box` ## Limitations This script serves as a demonstration of GPT-4 and Playwright integration, and may not perform flawlessly for every task or website. Generated code snippets could fail to execute, or the model might not comprehend specific inputs. Consider providing a more detailed task description or rephrasing your input in these situations. Some websites might be too large to fit in the prompt; for these cases, try switching to `gpt4-32k`. ## License This project is licensed under the MIT License. See the LICENSE file for details.

近期下载者

相关文件


收藏者