bard

Nim interface for Google Bard batchexecute API

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.8.0
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • Thiago Navarro

Installation

nimble install bard
choosenim install bard
git clone https://github.com/thisago/bard

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
bard - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.0 No
util - No

Source

Repository https://github.com/thisago/bard
Homepage https://github.com/thisago/bard
Registry Source nimble_official

README

Google Bard Logo # Bard #### Nim interface for Google Bard batchexecute API **[About](#about) - [Usage](#usage) - [FAQ](#faq)** - [License](#license)

About

Google Bard AI batchexecute implementation in Nim

Take a look at clibard, to learn more about the use of this lib.

This project was based in

Usage

Note Google Bard allows up to 200 requests per hour. - Source: Google Bard

Individual prompts example

let ai = waitFor newBardAi({
  "__Secure-1PSID": "Google session PSID"
  "__Secure-1PSIDTS": "Google session PSIDTS"
})

echo waitFor(ai.prompt "Tell me an Asian traditional history in ten words").text
output
Sure, here is an Asian traditional history in 10 words:

* **Ancient civilizations, rich cultures, and diverse peoples.**

This 10-word summary captures the essence of Asian traditional history. It highlights the long and rich history of the continent, as well as the diversity of its peoples and cultures. From the ancient civilizations of China, India, and Japan to the more recent cultures of Southeast Asia and the Middle East, Asia is a continent with a vast and complex history.

Here are some other 10-word summaries of Asian traditional history:

* **The Silk Road, trade, and cultural exchange.**
* **Buddhism, Hinduism, and Confucianism.**
* **Imperial dynasties, wars, and revolutions.**
* **Monumental architecture, art, and literature.**
* **Myths, legends, and folktales.**

These are just a few examples of the many ways to summarize Asian traditional history in 10 words. The continent's rich and complex history can be described in many different ways, but these 10-word summaries capture the essence of what makes Asian history so fascinating.

Chat example

let ai = waitFor newBardAi({
  "__Secure-1PSID": "Google session PSID"
  "__Secure-1PSIDTS": "Google session PSIDTS"
})

var chat = ai.newBardAiChat

discard waitFor chat.prompt "my name is Luke"
echo waitFor(chat.prompt "what's my name?").text
output
Your name is Luke. You told me that in your previous response.

FAQ

What is "Google Bard sent an unrecognizable response" error?

It's generally rate limit.

View error example ``` Exception message: Google Bard sent an unrecognizable response: `)]}' [["wrb.fr",null,null,null,null,[8]],["di",69],["af.httprm",69,"3783202389886124604",21]]` [BardUnrecognizedResp] ```

License

This library is FOSS, licensed over MIT license.