Wopee-io / playwright-ai-bot-demo

2 stars 0 forks source link

Config can not be accessed #1

Closed astepanova911 closed 3 days ago

astepanova911 commented 4 days ago

After downloading sourse code, updating api_key, adding base url and all required packages I have following error when running: npm run crawl Basically, config can not be reached. Could you please let me know what could be the issue (I am new to Playwright and node.js in general)

image


marcel-veselka commented 4 days ago

Thank you!

Could you please provide your URL (and ideally the entire config file)? It seems that you are not using the correct URL format.

I will also improve the error handling.

marcel-veselka commented 4 days ago

Also possible workaround could be to past the URL here: image

astepanova911 commented 4 days ago

just remove txt expension as otherwise was not allowing to attach

playwright.config.ts.txt

astepanova911 commented 4 days ago

I can provide URL manually and crawl is done. But the on test cases creation i will have ✘ Error generating stories: AuthenticationError: 401 You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your br owser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.

marcel-veselka commented 4 days ago

just remove txt expension as otherwise was not allowing to attach

playbot.config.js.txt playwright.config.ts.txt

Thanks for sharing details.

Please NEVER share your OpenAI API key with me. It will now be blocked automatically by the GitHub crawler as it was disclosed. However, I recommend revoking it.

marcel-veselka commented 4 days ago

I can provide URL manually and crawl is done. But the on test cases creation i will have ✘ Error generating stories: AuthenticationError: 401 You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your br owser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.

I originally implemented and tested this on macOS, so it appears this issue is specific to Windows environments.

To resolve this, here are a few steps you can try:

Check Your Terminal Type It looks like you're currently using PowerShell or Command Prompt (CMD) as the default terminal in VS Code. These environments may not fully support UNIX-like commands used in the script.

To improve compatibility, I recommend switching to Git Bash or WSL (Windows Subsystem for Linux), both of which should handle the commands more smoothly. Here’s how to switch terminals in VS Code:

Once you’ve made this change, try running npm run crawl again. At this point, the URL should be correctly taken from the configuration file.

astepanova911 commented 4 days ago

unfortunately switching to bash did not resolve the issue

marcel-veselka commented 4 days ago

🎉 Great news! 🎉

Thank you so much for your patience—I'm happy to announce that the issue should now be fixed in version 1.4.1! 🚀 Please give it a go by updating with the command:

npm i playwright-ai-bot@latest

I can't wait to hear your feedback! 🤞

P.S. I’ve started testing on Windows too, so expect smoother sailing ahead as I tackle any more Windows quirks that pop up! 💻🔧

marcel-veselka commented 3 days ago

@astepanova911 did you have a chance to retest? Is it ok now?

astepanova911 commented 3 days ago

Hi Marcel, Sorry for the delay. Thanks issue is resolved and login page can be crawled. Now there is issue with AI ;) 429 - Rate limit reached for requests | Cause: You are sending requests too quickly.Solution: Pace your requests. Read the Rate limit guide. Should I purchse some plan to be able to continue testing?

marcel-veselka commented 3 days ago

Hi Marcel, Sorry for the delay. Thanks issue is resolved and login page can be crawled. Now there is issue with AI ;) 429 - Rate limit reached for requests | Cause: You are sending requests too quickly.Solution: Pace your requests. Read the Rate limit guide. Should I purchse some plan to be able to continue testing?

The issue you're encountering is likely related to your API token. I recommend generating a new token and trying again. That should resolve the rate limit problem.

Let me know if you need further assistance!