Advanced
JSON Format

The JSON format

This flag (activated by passing in format: Bard.JSON in the config object) is used in Bard.ask() and Chat.ask().

Use this flag to get more information about the return request from Bard.

Return Structure

{
    "content": string,
    "images": [
        {
            tag: string,
            url: string,
            info: {
                raw: string,
                source: string,
                website: string,
                favicon: string
            }
        },
        ...
    ],
    "ids": object
}

Let's walk through what each one of these properties is.

Property NameTypeDescription
contentstringThe Markdown return value of Bard
imagesarrayArray of objects, representing the image. See Image JSON below
idsobjectAn object that is used to import/export conversations.

Image JSON

What the array in images above is consisted of

Property NameTypeDescription
tagstringWhat tag the Markdown image is associated with.
urlstringAn URL of the image linked to Google image servers. This has been cropped by Bard.
info.rawstringAn URL of the image from the source website. This has not been edited by Bard.
info.sourcestringWhat website (with subdirectory) the image is from.
info.websitestringWhat domain the image is from.
info.faviconstringFavicon of that website.

Usually it should not be necessary to use the JSON flag, but it can be used for some certain scenarios, especially if you want to extend this library in some way.