natbot
natbot copied to clipboard
Getting started + Requirements.txt
trafficstars
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.
After all this is done I can confirm it works :D
I did everything but still have the error
@Krasnomakov It does seem openai is installed but somehow it's not getting the value. Setting openai.api_key = "key" worked for me, as did injecting via console like OPENAI_API_KEY=key python natbot.py. What happens if you remove line 15 and run it. If that doesn't work, what happens if you revert to the original code for line 14 (and 15 still removed) and try running from console as above