nat / natbot Goto Github PK
View Code? Open in Web Editor NEWDrive a browser with GPT-3
License: MIT License
Drive a browser with GPT-3
License: MIT License
Hi Nat,
Super interesting work! I was trying it out and although GPT-3 generates a valid response, no actions are taken in the browser. I.e. it gets stuck in google.com and GPT-3 generates same response over and over again. Not sure if it's just me.
Welcome to natbot! What is your objective?
bloom
Parsing time: 0.10 seconds
Traceback (most recent call last):
File "/home/ubuntu/natbot/natbot.py", line 602, in
gpt_cmd = get_gpt_command(objective, _crawler.page.url, prev_cmd, browser_content)
File "/home/ubuntu/natbot/natbot.py", line 561, in get_gpt_command
response = openai.Completion.create(model="text-davinci-003", prompt=prompt, temperature=0.5, best_of=10, n=3, max_tokens=50)
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 149, in create
) = cls.__prepare_create_request(
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 106, in __prepare_create_request
requestor = api_requestor.APIRequestor(
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 138, in init
self.api_key = key or util.default_api_key()
File "/usr/local/lib/python3.10/dist-packages/openai/util.py", line 186, in default_api_key
raise openai.error.AuthenticationError(
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.
I checked API issues using:
curl -X GET https://api.openai.com/v1/models -H "Authorization: Bearer sk-kufw3eq_MY_API_KEY_asdqe23adg"
I TYPESUBMIT google and lead me to result page, I SCROLL DOWN then click, found nothing changed.
The element buffer is updated correctly, but I can't click that in the page
openai.error.InvalidRequestError: Must provide an 'engine' parameter to create a <class 'openai.api_resources.completion.Completion'>
Do you know how to surpass this?
click (c
) and type submit (t
) aren't working as expected. page goto URL (g
), page up (u
), page down (d
) seem to work fine. anyone else?
Natbot opens the browser, navigates to google and then does nothing. I suspect it's tripped up by the cookie settings screen that Google has to display due to the EU legislation
Seems like Playwright lies about devicePixelRatio on Windows the same way it does on Darwin. It makes alll browsing incorrect.
I think the only way to solve it is to manually specify devicePixelRatio for your device.
Hello, Im amazed at this implementation of GPT-3.
I would love to add an extra later to theprompt by preprocessing the text and adding entities with metalabel while passing prompt to GPT-3
An example would be:
Buy [Brand] Adidas shoes from Amazon [company] India [location] under $200 [numeric]
We could achieve this using the hello haptik repository (link: https://github.com/hellohaptik/chatbot_ner)
Im not completely sure if this will help the output. What do you think?
Kudos!
Hi Nat,
While looking at the DOM parsing bit, I noticed a few potential bugs:
ancestor_node
is not used anywhere?converted_node_name != "textarea"
, should this be converted_node_name != "text"
?child_nodes
, however this is always empty (never populated)?Let me know what you think, thanks!
On first run:
Traceback (most recent call last):
File "/home/sam/git/natbot/natbot.py", line 8, in <module>
from playwright.sync_api import sync_playwright
ModuleNotFoundError: No module named 'playwright'
So, so far I know I need playwright, OpenAI
Traceback (most recent call last):
File "/home/sam/git/natbot/natbot.py", line 11, in <module>
import openai
ModuleNotFoundError: No module named 'openai'
Then I need to run this to prepare
playwright._impl._api_types.Error: Executable doesn't exist at /home/sam/.cache/ms-playwright/chromium-1024/chrome-linux/chrome
╔════════════════════════════════════════════════════════════╗
║ Looks like Playwright was just installed or updated. ║
║ Please run the following command to download new browsers: ║
║ ║
║ playwright install ║
║ ║
║ <3 Playwright Team ║
╚════════════════════════════════════════════════════════════╝
and I also need an API key
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = <API-KEY>', or you can set the environment variable OPENAI_API_KEY=<API-KEY>). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = <PATH>'. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email [email protected] if you have any questions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.