AdamSEY / bard-unofficial-api

Google's Bard ChatBot Unofficial NodeJS API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error msg after install

cameronj86 opened this issue · comments

Here's my CLI:


macallik@penguin:~$ bard -h
file:///usr/local/lib/node_modules/bard-bot/src/ChatBot.js:104
this.choiceId = results.choices[0]?.id || "Google Bard couldn't answer this question.";

SyntaxError: Unexpected token '.'


Ran it through bard & received the following response:


_The error message means that the JavaScript interpreter encountered an unexpected token, the period (.) The period (.) is an operator that is used to access the properties of an object. In this case, the interpreter is expecting a property name, but instead it found a period. This is most likely a typo, and the correct code should be:

this.choiceId = results.choices[0].id || "Google Bard couldn't answer this question.";_


Not sure that this is true, went to ~/node_modules/bard-bot/src/ChatBot.js and removed the period (and separately removed the '?' but no dice either way. Might be a clear sign of Bard hallucimagining a solution lol, but curious what to do to fix the issue? I only D/L'd npm/nodejs for this use case if that matters

Outdated node package (latest stock Debian version via apt is outdated) was causing the error.