GoogleBard icon indicating copy to clipboard operation
GoogleBard copied to clipboard

Empty response when the query includes a url

Open nerblock opened this issue 1 year ago • 0 comments

The response is empty when the query includes a link to a webpage. For example try this query:

Can you summarize this article for me? https://blog.google/technology/ai/code-with-bard/

This happens because resData[3] contains an empty string. To get the actual response text the ask method needs to be modified to return resData[1]:

    async ask(prompt, conversationId) {
        let resData = await this.send(prompt, conversationId);
        return resData[3].length > 0 ? resData[3] : resData[1];
    }

nerblock avatar Jul 14 '23 02:07 nerblock