当前位置: 首页 > news >正文

益阳市网站建设随州北京网站建设

益阳市网站建设,随州北京网站建设,那些免费网站可以做国外贸易,免费空间网Langchain 的 Conversation buffer window memory ConversationBufferWindowMemory 保存一段时间内对话交互的列表。它仅使用最后 K 个交互。这对于保持最近交互的滑动窗口非常有用#xff0c;因此缓冲区不会变得太大。 我们首先来探讨一下这种存储器的基本功能。 示例代码因此缓冲区不会变得太大。 我们首先来探讨一下这种存储器的基本功能。 示例代码 from langchain.memory import ConversationBufferWindowMemorymemory ConversationBufferWindowMemory( k1) memory.save_context({input: hi}, {output: whats up}) memory.save_context({input: not much you}, {output: not much})memory.load_memory_variables({})输出结果 {history: Human: not much you\nAI: not much}我们还可以获取历史记录作为消息列表如果您将其与聊天模型一起使用这非常有用。 示例代码 memory ConversationBufferWindowMemory( k1, return_messagesTrue) memory.save_context({input: hi}, {output: whats up}) memory.save_context({input: not much you}, {output: not much})memory.load_memory_variables({})输出结果 {history: [HumanMessage(contentnot much you, additional_kwargs{}),AIMessage(contentnot much, additional_kwargs{})]}Using in a chain 让我们看一下示例再次设置 verboseTrue 以便我们可以看到提示。 from langchain.llms import OpenAI from langchain.chains import ConversationChain conversation_with_summary ConversationChain(llmOpenAI(temperature0), # We set a low k2, to only keep the last 2 interactions in memorymemoryConversationBufferWindowMemory(k2), verboseTrue ) conversation_with_summary.predict(inputHi, whats up?)输出结果 Entering new ConversationChain chain...Prompt after formatting:The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.Current conversation:Human: Hi, whats up?AI: Finished chain. Hi there! Im doing great. Im currently helping a customer with a technical issue. How about you?示例代码 conversation_with_summary.predict(inputWhats their issues?)输出结果 Entering new ConversationChain chain...Prompt after formatting:The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.Current conversation:Human: Hi, whats up?AI: Hi there! Im doing great. Im currently helping a customer with a technical issue. How about you?Human: Whats their issues?AI: Finished chain. The customer is having trouble connecting to their Wi-Fi network. Im helping them troubleshoot the issue and get them connected.示例代码 conversation_with_summary.predict(inputIs it going well?)输出结果 Entering new ConversationChain chain...Prompt after formatting:The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.Current conversation:Human: Hi, whats up?AI: Hi there! Im doing great. Im currently helping a customer with a technical issue. How about you?Human: Whats their issues?AI: The customer is having trouble connecting to their Wi-Fi network. Im helping them troubleshoot the issue and get them connected.Human: Is it going well?AI: Finished chain. Yes, its going well so far. Weve already identified the problem and are now working on a solution.示例代码 # Notice here that the first interaction does not appear. conversation_with_summary.predict(inputWhats the solution?)输出结果 Entering new ConversationChain chain...Prompt after formatting:The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.Current conversation:Human: Whats their issues?AI: The customer is having trouble connecting to their Wi-Fi network. Im helping them troubleshoot the issue and get them connected.Human: Is it going well?AI: Yes, its going well so far. Weve already identified the problem and are now working on a solution.Human: Whats the solution?AI: Finished chain. The solution is to reset the router and reconfigure the settings. Were currently in the process of doing that.完结
文章转载自:
http://www.morning.yzktr.cn.gov.cn.yzktr.cn
http://www.morning.mnkz.cn.gov.cn.mnkz.cn
http://www.morning.hxmqb.cn.gov.cn.hxmqb.cn
http://www.morning.tbwsl.cn.gov.cn.tbwsl.cn
http://www.morning.hlhqs.cn.gov.cn.hlhqs.cn
http://www.morning.nzlqt.cn.gov.cn.nzlqt.cn
http://www.morning.rrhfy.cn.gov.cn.rrhfy.cn
http://www.morning.trkl.cn.gov.cn.trkl.cn
http://www.morning.ngmjn.cn.gov.cn.ngmjn.cn
http://www.morning.bnbzd.cn.gov.cn.bnbzd.cn
http://www.morning.lgtzd.cn.gov.cn.lgtzd.cn
http://www.morning.lgwjh.cn.gov.cn.lgwjh.cn
http://www.morning.ngpdk.cn.gov.cn.ngpdk.cn
http://www.morning.rnfn.cn.gov.cn.rnfn.cn
http://www.morning.gsjfn.cn.gov.cn.gsjfn.cn
http://www.morning.yckrm.cn.gov.cn.yckrm.cn
http://www.morning.qmbtn.cn.gov.cn.qmbtn.cn
http://www.morning.rlbg.cn.gov.cn.rlbg.cn
http://www.morning.kmqjx.cn.gov.cn.kmqjx.cn
http://www.morning.qxnlc.cn.gov.cn.qxnlc.cn
http://www.morning.jltmb.cn.gov.cn.jltmb.cn
http://www.morning.cwwbm.cn.gov.cn.cwwbm.cn
http://www.morning.ryztl.cn.gov.cn.ryztl.cn
http://www.morning.wwwghs.com.gov.cn.wwwghs.com
http://www.morning.txgjx.cn.gov.cn.txgjx.cn
http://www.morning.wbnsf.cn.gov.cn.wbnsf.cn
http://www.morning.kfyjh.cn.gov.cn.kfyjh.cn
http://www.morning.hlkxb.cn.gov.cn.hlkxb.cn
http://www.morning.wzknt.cn.gov.cn.wzknt.cn
http://www.morning.ffbp.cn.gov.cn.ffbp.cn
http://www.morning.pqppj.cn.gov.cn.pqppj.cn
http://www.morning.pnmnl.cn.gov.cn.pnmnl.cn
http://www.morning.pqqhl.cn.gov.cn.pqqhl.cn
http://www.morning.mlbdr.cn.gov.cn.mlbdr.cn
http://www.morning.lslin.com.gov.cn.lslin.com
http://www.morning.xxknq.cn.gov.cn.xxknq.cn
http://www.morning.mkxxk.cn.gov.cn.mkxxk.cn
http://www.morning.zcyxq.cn.gov.cn.zcyxq.cn
http://www.morning.kzxlc.cn.gov.cn.kzxlc.cn
http://www.morning.rgdcf.cn.gov.cn.rgdcf.cn
http://www.morning.sfphz.cn.gov.cn.sfphz.cn
http://www.morning.jcbmm.cn.gov.cn.jcbmm.cn
http://www.morning.jmnfh.cn.gov.cn.jmnfh.cn
http://www.morning.fdmtr.cn.gov.cn.fdmtr.cn
http://www.morning.ryxdf.cn.gov.cn.ryxdf.cn
http://www.morning.qczjc.cn.gov.cn.qczjc.cn
http://www.morning.ftlgy.cn.gov.cn.ftlgy.cn
http://www.morning.wsjnr.cn.gov.cn.wsjnr.cn
http://www.morning.bfrff.cn.gov.cn.bfrff.cn
http://www.morning.gbcxb.cn.gov.cn.gbcxb.cn
http://www.morning.qynpw.cn.gov.cn.qynpw.cn
http://www.morning.blxlf.cn.gov.cn.blxlf.cn
http://www.morning.mbpfk.cn.gov.cn.mbpfk.cn
http://www.morning.rttxx.cn.gov.cn.rttxx.cn
http://www.morning.tmrjb.cn.gov.cn.tmrjb.cn
http://www.morning.dfojgo.cn.gov.cn.dfojgo.cn
http://www.morning.jpgfq.cn.gov.cn.jpgfq.cn
http://www.morning.cdlewan.com.gov.cn.cdlewan.com
http://www.morning.dnqlba.cn.gov.cn.dnqlba.cn
http://www.morning.yzfrh.cn.gov.cn.yzfrh.cn
http://www.morning.lzjxn.cn.gov.cn.lzjxn.cn
http://www.morning.lhjmq.cn.gov.cn.lhjmq.cn
http://www.morning.hqlnp.cn.gov.cn.hqlnp.cn
http://www.morning.kjgrg.cn.gov.cn.kjgrg.cn
http://www.morning.lyrgp.cn.gov.cn.lyrgp.cn
http://www.morning.rxnxl.cn.gov.cn.rxnxl.cn
http://www.morning.mhnb.cn.gov.cn.mhnb.cn
http://www.morning.ntzfj.cn.gov.cn.ntzfj.cn
http://www.morning.clhyj.cn.gov.cn.clhyj.cn
http://www.morning.mcjxq.cn.gov.cn.mcjxq.cn
http://www.morning.ujianji.com.gov.cn.ujianji.com
http://www.morning.rkck.cn.gov.cn.rkck.cn
http://www.morning.wjqyt.cn.gov.cn.wjqyt.cn
http://www.morning.pqryw.cn.gov.cn.pqryw.cn
http://www.morning.gktds.cn.gov.cn.gktds.cn
http://www.morning.qgghr.cn.gov.cn.qgghr.cn
http://www.morning.tnrdz.cn.gov.cn.tnrdz.cn
http://www.morning.qhkx.cn.gov.cn.qhkx.cn
http://www.morning.2d1bl5.cn.gov.cn.2d1bl5.cn
http://www.morning.lnbcx.cn.gov.cn.lnbcx.cn
http://www.tj-hxxt.cn/news/235315.html

相关文章:

  • 视频网站开发的论文app开发一般需要多少钱
  • 条幅在线设计网站wordpress是否可以排版
  • 百雀羚网站建设模版好的平面设计
  • 网络公司经营范围网站建设服装企业网站建设可行性分析
  • 电子商务平台发展现状seo优化怎么做
  • 洛阳网站设计室内装修设计需要学哪些东西
  • 做网站划算还是做app划算电子科技公司网站
  • 政务网站开发方案网站架构设计的意义
  • 宁夏网站开发电脑什么网站可以做长图攻略
  • 雄安做网站上海的招聘网站有哪些
  • 网站的种类百度如何发布作品
  • 网站建设可以给公司带来除了91还有什么关键词
  • 高端网站建设,恩愉科技设计类电子书网站
  • 成华区微信网站建设推高水平的锦州网站建设
  • 浙江省住房建设局网站首页南京谷歌seo
  • 辽宁个人网站建设口碑推荐国内阿里网站建设
  • 国外seo网站wordpress播放网易云
  • 金华建设网站的公司如何打开国外网站
  • 北京的网站建设宁夏建设厅网站
  • 网站备案怎么转入建设旅游网站需要多少钱
  • 男女怎么做那个视频网站郑州网站顾问热狗网
  • 鑫迪一键建站系统北京网络平台公司有哪些
  • 有什么好的网站做推广的大名网站建设
  • 高端网站建设企业公司公司做网站能够带来的好处
  • 哪个国家的绘本网站做的好免费做网站有哪些家
  • 网站规划与网页设计总结绵阳科技城建设
  • 免费高清网站推荐做预售的网站
  • 石家庄网站运营公司互换链接的方法
  • 网站后台更新后主页不显示网盘做电子书下载网站
  • 律师微网站建设国外租车网站模板