开发了一个Java库的Google Bard API,可以自动化与AI对话了

开发了一个Java库的Google Bard API,可以自动化与AI对话了

Google Bard是Google提供的还在实验阶段的人工智能对话服务。这明显是对标ChatGPT来的,它可以提供更实时的答案,会基于Google强大的网页数据。

为了更方便的使用并实现自动化,我写了一个Java类库,GitHub仓库地址为:https://github.com/LarryDpk/Google-Bard

欢迎大家STAR...

如何使用

使用是非常简单的,只要网络通就可以了。

引入依赖

<dependencies><dependency><groupId>com.pkslow</groupId><artifactId>google-bard</artifactId><version>0.0.1</version></dependency>
</dependencies>

拿到验证Token

目前没有用户名密码的方式,直接有Token就行。但这个要从网页上拿。它其实就是一个Cookie,名为__Secure-1PSID

据说Google未来会开放API接口,拭目以待吧。

Java代码

两行代码即可:

AIClient client = new GoogleBardClient(token);
List<String> answers = client.ask("How to be a good father?");

返回的是一个列表: 如果Google Bard能够回答问题,一般会给出三个答案。第一个是推荐的答案。

for (int i = 0; i < answers.size(); i++) {if (i == 0) {System.out.println("### Recommended Answer");System.out.println(answers.get(i));} else {System.out.println("### Answer " + i);System.out.println(answers.get(i));}
}

Google Bard目前还是实验阶段,只在美国英国可用,所以你懂的:

NetworkUtils.setUpProxy("localhost", "7890");

这个要在程序最开始设置。

我尝试的问题如答案

我问了一个问题:How to be a good father? 答案是Markdown格式的,我获得的答案如下:

Here are some tips on how to be a good father:

  • Spend time with your child. Quality time is essential for building a strong relationship with your child. Make time for activities that you both enjoy, such as playing games, going to the park, or reading stories.
  • Be a good role model. Children learn by watching the adults in their lives. Set a good example by being honest, kind, and respectful.
  • Be supportive. Let your child know that you are there for them, no matter what. Offer them your support and encouragement, especially when they are going through tough times.
  • Be a good communicator. Talk to your child about their day, their feelings, and their hopes and dreams. Let them know that they can come to you with anything.
  • Be patient. Parenting is a journey, not a destination. There will be times when you feel frustrated or overwhelmed. Remember to be patient with yourself and your child.
  • Be loving. The most important thing a father can do is to love his child unconditionally. Let your child know that you love them every day.

Being a good father is a lifelong journey. There is no one right way to do it. Just remember to be there for your child, be a good role model, and show them love.

Answer 1

Here are some tips on how to be a good father:

  • Spend time with your child. Quality time is essential for building a strong relationship with your child. Make time for activities that you both enjoy, such as playing games, going to the park, or reading stories.
  • Be a good role model. Children learn by watching the adults in their lives. Set a good example by being honest, kind, and respectful.
  • Be supportive. Let your child know that you are there for them, no matter what. Offer them your support and encouragement, especially when they are going through tough times.
  • Be a good communicator. Talk to your child about their day, their feelings, and their hopes and dreams. Let them know that they can come to you with anything.
  • Be patient. Parenting is a journey, not a destination. There will be times when you feel frustrated or overwhelmed. Remember to be patient with yourself and your child.
  • Be loving. The most important thing a father can do is to love his child unconditionally. Let your child know that you love them every day.

Being a good father is a lifelong journey. There is no one right way to do it. Just remember to be there for your child, be a good role model, and show them love.

Answer 2

Here are some tips on how to be a good father:

  • Spend time with your children. Make time for them, even if it's just for a few minutes each day. Talk to them, listen to them, and play with them.
  • Discipline with love and positive parenting. Set rules and boundaries, but be fair and consistent. Use positive reinforcement, such as praise and rewards, to encourage good behavior.
  • Be your child's role model. Show them what it means to be a good person by being honest, trustworthy, and kind.
  • Earn the right to be heard. Be a good listener and take your children's concerns seriously. When you give them advice, make sure it's based on your own experience and wisdom.
  • Be your child's teacher. Teach them about the world around them and help them to grow into responsible, independent adults.
  • Be there for your children, no matter what. Love them unconditionally and support them through thick and thin.

Being a good father is a lifelong journey. There will be times when you make mistakes, but that's okay. The important thing is to learn from your mistakes and keep trying to be the best father you can be.

Answer 3

Here are some tips on how to be a good father:

  • Spend time with your child. This is one of the most important things you can do as a father. Make time for your child every day, even if it's just for a few minutes. Play with them, read to them, or just talk to them.
  • Discipline with love and positive parenting. Discipline is important, but it should be done in a loving and positive way. Avoid yelling or hitting your child. Instead, try to explain why they are being disciplined and what they can do to avoid being disciplined in the future.
  • Be your child's role model. Children learn by watching the adults in their lives. Show your child what it means to be a good person by being someone they can look up to.
  • Earn the right to be heard. Children are more likely to listen to their parents if they respect them. Earn your child's respect by being a good role model and by being fair and consistent with your discipline.
  • Be your child's teacher. Teach your child about right and wrong and encourage them to do their best. Use everyday examples to help them learn the basic lessons of life.
  • Be there for your child. Your child needs to know that you are there for them, no matter what. Be supportive and loving, and let them know that you will always be there for them.

Being a good father is one of the most important things you can do in life. By following these tips, you can help your child grow into a happy, healthy, and successful adult.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/6763.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【产业互联网周报】微软官宣把聊天机器人植入Office;任正非:4月份华为自研MetaERP将面世;...

关注ITValue&#xff0c;看企业级最新鲜、最价值报道&#xff01; ChatGPT之父&#xff1a;监管机构应参与技术测试&#xff0c;减少AI对人类的威胁&#xff1b;李开复宣布亲自组建中国版ChatGPT公司&#xff0c;资金、算力将陆续到位&#xff1b;金蝶2022年亏损扩大至3.89亿元…

关于GTP-4,这是14个被忽略的惊人细节!

来源&#xff1a;华尔街见闻&#xff08;id&#xff1a;wallstreetcn&#xff09; 3月14日&#xff0c;OpenAI发布了GPT-4。向科技界再次扔下了一枚“核弹”。 根据OpenAI的演示&#xff0c;我们知道了GPT-4拥有着比GPT-3.5更强大的力量&#xff1a;总结文章、写代码、报税、写…

“写作业神器”ChatGPT究竟有多厉害?

人工智能研究实验室OpenAI推出了新一代语言模型ChatGPT&#xff0c;它能够模拟人类的语言行为&#xff0c;与用户进行自然的交互。虽然从名字上不难看出&#xff0c;ChatGPT对外宣称是目前最先进的聊天机器人之一&#xff0c;但它能做到的事情远远超出了聊天本身。作为一个 AI …

彻底了解ChatGPT的工作原理

作者&#xff1a;史蒂芬沃尔弗拉姆&#xff0c;计算机科学家 转自&#xff1a;AI研究局 作者&#xff1a;史蒂芬沃尔弗拉姆&#xff08;Stephen Wolfram&#xff09;英、美籍 计算机科学家&#xff0c; 物理学家。他是 Mathematica 的首席设计师&#xff0c;《一种新科学》一书…

【文末送18本ChatGPT扫盲书】从一路高歌到遭多国“封杀”,ChatGPT未来将是什么样子?

您好&#xff0c;我是码农飞哥&#xff08;wei158556&#xff09;&#xff0c;感谢您阅读本文&#xff0c;欢迎一键三连哦。&#x1f4aa;&#x1f3fb; 1. Python基础专栏&#xff0c;基础知识一网打尽&#xff0c;9.9元买不了吃亏&#xff0c;买不了上当。 Python从入门到精通…

谁能真正替代你?AI辅助编码工具深度对比(chatGPT/Copilot/Cursor/New Bing)

写在开头 这几个月AI相关新闻的火爆程度大家都已经看见了&#xff0c;作为一个被裹挟在AI时代浪潮中的程序员&#xff0c;在这几个月里我也是异常兴奋和焦虑。甚至都兴奋的不想拖更了。不仅仅兴奋于AI对于我们生产力的全面提升&#xff0c;也焦虑于Copilot等AI辅助编码工具&am…

从ChatGPT看人工智能

ChatGPT是2022年出来的一个对话型人工智能&#xff0c;ChatGPT就是这样一种可以和人类用自然语言去交流的人工智能&#xff0c;一上线就引发了恐慌&#xff0c;最厉害的地方还是它能够用人类的语言来进行交流&#xff0c;不管是中文、英文、日文都可以&#xff0c;ChatGPT有可能…

ChatGPT开始凉了?数据显示确实进入了瓶颈期!

你还在用ChatGPT吗&#xff1f; 在全球掀起AI热潮的ChatGPT&#xff0c;似乎进入了瓶颈期。 首先是关于ChatGPT的使用率&#xff0c;有不利的数据出现。6月初&#xff0c;摩根士丹利发布的一项调查显示&#xff0c;只有19%的受访者表示他们之前使用过ChatGPT&#xff0c;只有…

一个用了再也回不去的插件,内置chatgpt3.5可免费使用

目录 一、插件介绍 1.主页 2.功能点 1.ChatAI 2.桌面快捷图标 ​3.小游戏 二、安装方法 一、插件介绍 1.主页 这种风格相信是很多人都喜爱的一种&#xff0c;大家还可以更换壁纸等让自己的主页看起来更炫酷&#xff01; 2.功能点 1.ChatAI 大家最关心的chatAI,可以自动生…

ChatGPT4.0绘画国内镜像版,Ai绘画国内版上线,请大家欣赏杰作!

OK&#xff0c;以上就是使用新智能Ai绘画出来的效果&#xff0c;非常真实&#xff0c;非常漂亮迷人&#xff01; 今天就教到这里&#xff0c;请大家收藏和学习吧&#xff0c;谢谢关注&#xff01;

如何获取 openai ChatGPT的key?(图文教学)

我直接对他进行询问 Q&#xff1a;获取chatptp的key A&#xff1a;对不起&#xff0c;作为ChatGPT&#xff0c;我不具有API密钥或访问凭据。我只是一个已经被训练好的自然语言处理模型&#xff0c;通过输入文本来生成回复。您可以在OpenAI的网站上了解有关他们的API和访问凭据…

ChatGPT:招聘流程中的虚拟招聘专家

在当今竞争激烈的人才市场中&#xff0c;企业需要拥有高效、智能的招聘流程来吸引和选拔最佳人才。而随着人工智能技术的飞速发展&#xff0c;ChatGPT成为了招聘流程中的一位虚拟招聘专家&#xff0c;为企业提供了前所未有的便利和效率。本文将探讨ChatGPT在招聘流程中的应用&a…

即将被ChatGPT取代的十个工作岗位,有你吗?

自ChatGPT发布之后&#xff0c;网络引起巨浪。不少留学生表示在求职、写代码、甚至做题时会用到ChatGPT。随着它版本的迭代更新&#xff0c;即将被ChatGPT取代的工作有哪些呢&#xff1f;今天我们就来谈谈这个话题&#xff01; 目录 NO.1 技术工作 &#xff08;程序员、软件工…

用ChatGPT写招聘信息 HR可以解放双手啦

每到招聘季&#xff0c;不少HR都会忙于写招聘信息&#xff0c;总会看到虎皮鸡爪与泡椒凤爪飞舞在键盘上。 今天起&#xff0c;HR可以解放双手啦&#xff01;可以用ChatGPT写招聘信息啦。 我们先进入ChatGPT聊天界面&#xff0c;然后输入&#xff1a;写一份某某岗位的招聘信息…

23个海外求职找各种工作的招聘网站

我们在找工作的时候&#xff0c;除了通过熟人介绍工作&#xff0c;更多的是要通过招聘网站来获取更多的工作机会&#xff0c;使用招聘网站来搜索所在行业的工作职位是找工作最有效的方法之一。 而在国外寻找工作也一样&#xff0c;招聘网站上会列出了很多职位空缺&#xff0c;可…

奉劝各位开发人员几句真话:在求职招聘软件上投简历就是浪费时间,找朋友内推靠谱多了!...

最近有网友给各位开发人员奉劝了几句真话&#xff1a; 如果没有扎实巩固的基础知识、丰富的开发经验和985、211的学历&#xff0c;在求职招聘软件上找工作纯属浪费时间。建议多和自己朋友联系&#xff0c;他们内推远比求职招聘软件上承诺的内推靠谱太多&#xff0c;不会浪费太多…

求职咨询Job Information

前言 加油 原文 求职咨询常用会话 ❶ I want to apply for a job which enables me to use my major. 我想要申请一个能用到我的专业知识的职业。 ❷ I have the capability of operating the computer. 我有操作电脑的能力。 ❸ My dream is to be an excellent interpret…

ChatGPT真的可以取代基础工作岗位吗?

最近关于人工智能对话工具ChatGPT的话题&#xff0c;甚嚣尘上。 前几天有报道说ChatGPT通过了谷歌L3级别的面试&#xff0c;虽然说L3是谷歌工程团队的入门级职位。舆论和一些自媒体对这个事保持着一个冷静又狂热的态度&#xff0c;普通人要么看个热闹&#xff0c;要么更加焦虑…

ChatGPT帮你写简历找工作

随着随着毕业时间的到来&#xff0c;应届生将要面临求职问题&#xff0c;根据官方的统计&#xff0c;2023届高校毕业生预计达1158万人&#xff0c;就业市场竞争激烈&#xff0c;无论是校园招聘&#xff0c;招聘会&#xff0c;线上招聘除了自身的准备和个人能力&#xff0c;都会…

35岁找工作,我求助了ChatGPT。这是ChatGPT给出的建议

最近网上很多热议中年人找工作遭遇歧视的问题。正好碰到ChatGPT热火朝天&#xff0c;帮大家问一下&#xff0c;大家看看你觉得这各答案还凑合吗 &#xff1f; chatGPT是这么回复的&#xff1a; 当您寻找新的工作时&#xff0c;以下是一些建议&#xff1a; 完善您的简历和求职信…