EvanZhouDev / bard-ai

A lightweight library to access Google Bard.
https://www.npmjs.com/package/bard-ai
GNU General Public License v3.0
117 stars 31 forks source link

✨ Renew Examples, and new Image Examples. Improve upload image buffer validation #34

Closed Aldhanekaa closed 1 year ago

Aldhanekaa commented 1 year ago

✨ Renew Examples, and new Image Examples.

I renew all of the examples along with the new example of uploading image!

🐛 Improve Image Buffer Validation

It is quiet interesting that Buffer.isBuffer failed on validating the fetched image buffer from Internet (ArrayBuffer), so by checking the instance of ArrayBuffer (config.image.buffer instanceof ArrayBuffer) is the solution

✨ Image alt on images response

It's quiet difficult to handle if the images url returned from Bard is invalid, having alt returned might help to inform user the invalid image.

EvanZhouDev commented 1 year ago

Nice! I'll be reviewing and merging soon!

EvanZhouDev commented 1 year ago

Merging... I'll do a few tiny edits myself, but thanks!

EvanZhouDev commented 1 year ago

Wrong button 😅