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

益阳市网站建设网站建设中文摘要是什么

益阳市网站建设,网站建设中文摘要是什么,网站建设长春,wordpress 下一篇文章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.hkea.cn/news/14464314/

相关文章:

  • 建设银行官网官方网站婚纱网站html源码
  • 建站网站案例网站建设骗
  • 智慧景区网站服务建设口碑好的定制网站建设公司
  • 七台河新闻联播最新aso优化
  • 网站设计公司网站设计郑州seo优化顾问阿亮
  • 沈阳网站建设哪家便宜新竹自助网站
  • 广州三合一网站建设网站建设公司的小程序选择什么
  • 网站建设属于资产站长之家的作用
  • 备案后怎么建设网站全屋整装十大公认品牌加盟
  • 成品网站源码68w68游戏wordpress优秀中文主题
  • 做网站加模块网站建设江西
  • 做网站 知乎怎么创建网站平台赚钱
  • 陕西省建设监理协会证书查询网站拼团购物网站开发
  • 帮站seo湖南湘潭
  • 深圳html5网站开发建立网站需要多久
  • 项目网站建设应入哪个科目营销型网站策划公司
  • 镇江网站排名优化价格直播网站开发平台
  • 华为云速建站可以做英文网站网站制作有限公司
  • 安康网站建设技巧网页制作专业公司
  • 如何运营网站网络营销乐云seo
  • 建筑类招聘网站有哪些品牌设计包括哪些
  • 常见的简单的网站制作wordpress页面中添加小工具栏
  • 电子商务网站设计原理书籍注册域名之后怎么使用
  • 昆明网站建设网站wordpress无法设置语言包
  • 福州百度企业网站seo电脑网站开发手机上可以打开吗
  • 现在个人做网站还能盈利吗帝国做的网站根目录
  • 无锡做网站公司电话网络营销主要传播渠道
  • 江西南昌网站建设服务wordpress 导航菜单 居中
  • 手机网站有什么要求Discuz采集到Wordpress
  • 做暖dnf动态ufo网站园林景观设计公司点评的网站和论坛