Google Bard
is Google's experimental, conversational, AI chat service. It is meant to function similarly to ChatGPT, with the biggest difference being that Google's service will pull its information from the web.
I want to use Google Bard
automatically in an easier way, so I built a Java library for it. Tthe library supports continuous conversation with the same client.
For maven project:
<dependencies>
<dependency>
<groupId>com.pkslow</groupId>
<artifactId>google-bard</artifactId>
<version>0.2.0</version>
</dependency>
</dependencies>
- 0.2.0: Support images and it's not compatible with previous versions;
It's easy to make the call:
AIClient client = new GoogleBardClient(token);
Answer answer = client.ask("can you show me a picture of clock?");
We need to get the token from browser for authentication. It a cookie named __Secure-1PSID
, and we need to copy the value.
Google Bard
is now under development so it may not be available for your country, so you may set the proxy before you run the application:
NetworkUtils.setUpProxy("localhost", "7890");
Sure, here is a picture of a clock. [Image of Clock]
Do you want to see a picture of a specific type of clock? For example, a digital clock, an analog clock, or a grandfather clock?