GithubHelp home page GithubHelp logo

steffanburnette / bard-ai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evanzhoudev/bard-ai

0.0 0.0 0.0 2.7 MB

A lightweight library to access Google Bard.

Home Page: https://www.npmjs.com/package/bard-ai

License: GNU General Public License v3.0

JavaScript 100.00%

bard-ai's Introduction

bard-ai v2 Banner

Docs | NPM | FAQ

Features

Highlights

Warning

Google is trying to stop these 3rd party APIs, so bard-ai may not work for some of you. Try following the steps on the FAQ. However, if that still does not work, it may be time to migrate to the palm-api package, for the official PaLM v2 API.

Comparison

Compared to alternative Bard API googlebard:

bard-ai Compared to GoogleBard
Learn more...

bard-ai surpasses leading competition GoogleBard by PawanOsman for three key reasons:

Size

bard-ai is a tiny 2.5kb minzipped, nearly 98% smaller than googlebard (112.8kb minzipped). This leads to faster downloads, and maximum efficiency.

Speed

bard-ai performs up to a whopping 2.25x faster than googlebard, when subjected to 4 consecutive requests, as measured with hyperfine.1

Features

bard-ai is updated with the latest and most advanced features available in Google Bard itself, including powerful Image Recognition with Google Lens.

Quick Start

Copy the cookie labled __Secure-1PSID on bard.google.com, and use it in the code here:

import Bard from "bard-ai";

let myBard = new Bard(COOKIE);

console.log(await myBard.ask("Hello, world!"));

Continue to explore full features, including Google Lens integration, with the docs.

Contributors

A special shoutout to these amazing indviduals:


@acheong08
Original Python Bard API

@ThatXliner
Maintainer

@Aldhanekaa
Typescript and Feature Developer, Maintainer

@RFS-ADRENO
TypeScript Developer, Maintainer

However, we thank every person that helps in the development process of this library, no matter that be in code, ideas, or anything else.

Read the docs to get started.

Footnotes

  1. Run with hyperfine --runs 3 between bard-ai v2.0 and googlebard. Equivalent code was used in the runs:

    bard-ai:

    import Bard from "bard-ai";
    
    let bot = new Bard(COOKIE);
    
    console.log(await bot.ask("Hello world!"));
    console.log(await bot.ask("What is 1+1?"));
    console.log(await bot.ask("What about 2+2?"));
    console.log(await bot.ask("Goodbye."));
    

    googlebard:

    import { Bard } from "googlebard";
    
    let bot = new Bard(`__Secure-1PSID=${COOKIE}`);
    
    console.log(await bot.ask("Hello world!"));
    console.log(await bot.ask("What is 1+1?"));
    console.log(await bot.ask("What about 2+2?"));
    console.log(await bot.ask("Goodbye."));
    

    Result:

    Benchmark 1: node bard-ai.js
    Time (mean ± σ):     18.346 s ±  0.768 s    [User: 0.307 s, System: 0.067 s]
    Range (min … max):   17.531 s … 19.057 s    3 runs
    
    Benchmark 2: node googlebard.js
      Time (mean ± σ):     37.179 s ±  3.714 s    [User: 1.416 s, System: 0.191 s]
      Range (min … max):   34.230 s … 41.349 s    3 runs
    
    Summary
    'node bard-ai.js' ran
    2.03 ± 0.22 times faster than 'node googlebard.js'
    

bard-ai's People

Contributors

evanzhoudev avatar aldhanekaa avatar rfs-adreno avatar thatxliner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.