ImanuelBertrand / MMM-ChatGPT

ChatGPT module for MagicMirror²
MIT License
6 stars 2 forks source link

initial prompt gives an error #2

Open teitelbot opened 11 months ago

teitelbot commented 11 months ago

Ive added your sample code and added my API My magic mirror wont start and If I look at the developing mode it says there are error codes with the initial prompt If I comment out the initial prompt the module will work but I'm assuming it doesnt know the actual time and weather any idea why this would be happening

teitelbot commented 11 months ago

I found the problem. There seems to be a plus sign after the last initialprompt that shouldnt be there also the weather module takes longer to load than the gpt so it will possibly say it doesnt have any weather info otherwise I'm really enjoying this module and trying to learn how to make it do other things like link to my calendar

ImanuelBertrand commented 11 months ago

Thank you for noticing that! I fixed the plus sign. You can work around the weather puffin loading slower by using the initialDelay :)

teitelbot commented 11 months ago

Thanks. Can I ask you how would I pull info from my calendar as well. Where can I find out what exactly is in the module information that I am pulling. For example I understand the initial prompt is sending the clock info but I don't know what info that is exactly and where to look that up. Trying to learn more

ImanuelBertrand commented 11 months ago

The module uses JS DOM function to find the information in the document (the magicmorror content that is displayed): document.querySelectorAll('.clock')[0].innerText searches for the first element that has the class clock and returns its text content. I can not help you with your calendar, but if you know basic HTML structure and query selectors (think CSS selectors), you can work it out yourself using the developer tools of your browser (F12, usually).

teitelbot commented 11 months ago

I just want to to mention one more important thing. I was having issues recently where nothing was showing up and when I checked my api I was being charged lots of usage. I found the error was a time out but it wasn't a time out on open AI end but a timeout in the module. I increased the timeout value and it fixed the issue.

On Sun, Dec 10, 2023, 4:47 PM Imanuel @.***> wrote:

The module uses JS DOM function to find the information in the document (the magicmorror content that is displayed): document.querySelectorAll('.clock')[0].innerText searches for the first element that has the class clock and returns its text content. I can not help you with your calendar, but if you know basic HTML structure and query selectors (think CSS selectors), you can work it out yourself using the developer tools of your browser (F12, usually).

— Reply to this email directly, view it on GitHub https://github.com/ImanuelBertrand/MMM-ChatGPT/issues/2#issuecomment-1849096359, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANK6QZEDPRGFUIE7EFBJ54TYIYUWRAVCNFSM6AAAAABAB42BB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGA4TMMZVHE . You are receiving this because you authored the thread.Message ID: @.***>