Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatGPT proposed code, refering to function in this library, which does not exist #41

Open
369Martin369 opened this issue May 17, 2024 · 2 comments

Comments

@369Martin369
Copy link

Hi, Code ChatGPT suggested:

String generateQRCode(const String& data) {
QRCode qrcode;
uint8_t qrcodeData[qrcode_getBufferSize(3)];
qrcode_initText(&qrcode, qrcodeData, 3, 0, data.c_str());

String qrCodeHtml = "<img src="data:image/png;base64,";
qrCodeHtml += qrcode_getQRCode(&qrcode);
qrCodeHtml += "">";

return qrCodeHtml;
}

But..."qrcode_getQRCode" is not declared in qrcode.h!:
How comes that ChatGPT thinks this is part of Richard Moore's library??

@ricmoo
Copy link
Owner

ricmoo commented May 17, 2024

CharGPT will often hallucinate. You cannot take its suggestions at face value and will often have to do additional research beyond code it proposes.

@ricmoo
Copy link
Owner

ricmoo commented May 17, 2024

(my low-level libraries tend to be exclusively C, so if you see C++ syntax it is likely a hallucination)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants