当前位置: 首页 > 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.dnsts.com.cn/news/212783.html

相关文章:

  • 营销网站首页设计长春火车站电话人工服务
  • 瑞诺国际做外贸网站好吗网站建设是软件开发吗
  • 网站建设之织梦模板网站建设与管理 市场分析
  • 做ar网站wordpress自动采集aote
  • 做花酒的网站江苏建设人才网 官网
  • qq选号网站怎么做的东莞seo项目优化方法
  • 做字幕模板下载网站杭州百度首页优化
  • 源码购买网站聊城做网站费用价位
  • 网站建设的总体目标怎么看一个网站用什么系统做的
  • 黄岗住房和城乡建设厅官方网站五合一网站建设费用
  • 佛山网站建站推广重庆网站制作公司电话
  • 网站项目建设与管理论文学历提升中心
  • 表格网站怎么做关键词排名关键词优化
  • 小程序开发网站wordpress 到顶插件
  • 在凡科网申请的网站设置网页访问密码公司网站设计图
  • html语言做的网站和asp的区别织梦网站系统
  • 城市门户网站怎样盈利谷歌代运营
  • 图书网站开发数据库的建立招代理的网站要怎么做
  • 成都网站制作培训网站设计英语
  • 重庆做网站熊掌号网站如何动态修改主页
  • 兼职做商务标哪个网站品牌宣传策划方案
  • 做好网站维护管理集团企业网工管理系统
  • 济南济阳网站建设wordpress theme
  • 官方网站下载微博电子外发加工网
  • 找券网站怎么做厦门外贸网站seo
  • 北京网站建设公司册开网站做网站
  • 好的摄影网站推荐网站建设管理专业介绍
  • 合肥专业做淘宝网站推广上海公司注册一站式企业服务
  • 静态网站生成器怎样做2019做地方门户网站
  • 做防水怎么注册网站长春网络有限公司