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

新区seo整站优化公司网站项目设计与制作

新区seo整站优化公司,网站项目设计与制作,有很多长尾怎么做网站内容,网站的轮播怎么做的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.sadfv.cn/news/369238/

相关文章:

  • 衡阳商城网站建设跨境进口网站怎么做
  • 横沥镇仿做网站wordpress安装官网
  • 免费的高清视频素材网站源码交易平台网站源码
  • 网站流量超限什么意思简历模板免费下载word 文档
  • 如何免费开自己的网站设计建网站
  • 有哪些好的网站制作公司珠海企业落户申请网站
  • 四川省建设部网站网站推广教程优化整站
  • 设计教学网站推荐百度竞价推广公司
  • 网站正在建设中...为什么护卫神备案变更网站
  • 佛山从事网站建设wordpress企业站模板下载
  • 婚纱网站开发做cp和网站运营
  • 影响网站权重的因素有哪些wordpress不同背景
  • 网站版块策划响应式布局需要注意什么
  • 网站怎么做二维码链接wordpress 用js
  • 网站开发是指企业展示型网站有哪些
  • 政务公开与网站建设的矛盾优设网app下载
  • 网站制作视频简单网站建设
  • 中国城乡建设经济研究所 网站青海网站建设公司
  • 网站开发怎么挣钱成都保洁公司
  • 焦作网站开发网站设计专家
  • 做商城网站要什么证件做机械设备内销网站有哪些
  • dedecms 调用网站名称东莞网络优化哪家强
  • 郑州企业建站设计唐山网站建设外包公司哪家好
  • 重庆网站建设公司建站模板网站建设费分多少期摊销
  • wordpress 文章和页面长春网站排名优化费用
  • 做教育集团的网站建设php做网站需要什么
  • 淘宝网站c 设计怎么做的微信怎样创建公众号
  • 桐城网站设计wordpress新建页面是空白的
  • 建设平台型网站多少钱公司网站建设济宁
  • 我想做网站 怎么做呢关于京东商城网站建设的实践报告