当前位置: 首页 > 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.pierceye.com/news/219166/

相关文章:

  • 陕西整站关键词自然排名优化外贸获客渠道有哪些
  • 网站策划需要具备什么福州高端建站
  • 域名注册没有网站美食网页设计素材图片
  • wordpress网站在哪里修改密码ps做网站要求高吗
  • 企业网站带商城源码Audiology wordpress
  • 星月教你做网站东营城乡建设局官网
  • 镇江网站建设开发旺店通erp系统
  • 体育直播网站建设深圳制作小程序
  • 手机微信管理系统搜索引擎优化的流程是什么
  • 壁纸公司网站源码做网站价格表
  • 潜江网站设计商务科技网站建设
  • 合肥企业网站制作网站开发公司简介
  • 德州市建设小学网站文员工作内容
  • 网站域名买卖营销技巧第三季在线观看
  • 西宁市公司网站建设比较网站建设
  • 深圳网站设计公司建设部人才网站
  • 广水住房和城乡建设部网站巅峰网站建设
  • 建设智能家居网站SWOT分析商业网站有哪些
  • 相亲网站男人拉我做外汇h5特效网站欣赏
  • 网站一个多少钱有什么做同城的网站
  • 网站 改版 方案wordpress谷歌字体 4.9
  • 全网引流推广 价格网站百度关键词seo排名优化
  • 信用门户网站建设规范win7 iis 发布asp.net网站
  • 织梦网站添加视频教程如何套用wordpress的源码
  • 网站服务器模式wordpress安装后只有英文版
  • 企业网站建设晋升wordpress 自助建站
  • 网站建设案例建站资源
  • 四大商业网站镇江制作网站的
  • 做网站系统学校宠物交易网站模板
  • 佛山市官网网站建设哪家好瑶海合肥网站建设