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

展览网站制作简单网页设计模板素材

展览网站制作,简单网页设计模板素材,建设银行镇海支行网站,门户网站重要性背景 楼主决定提升与LLM交互的质量#xff0c;之前是直接prompt-answer的范式#xff0c;现在我希望能用上ReAct策略和能够检索StackOverflow#xff0c;让同一款LLM发挥出更大的作用。 难点 1. 怎样调用StackOverflow step1 pip install stackspi step 2 from la… 背景 楼主决定提升与LLM交互的质量之前是直接prompt-answer的范式现在我希望能用上ReAct策略和能够检索StackOverflow让同一款LLM发挥出更大的作用。 难点 1. 怎样调用StackOverflow step1 pip install stackspi step 2 from langchain.agents import load_toolstools load_tools([stackexchange],llmllm ) 注stackoverflow是stackexchange的子网站  2. 交互次数太多token输入超出了llm限制 approach 1 使用ConversationSummaryBufferMemory 这种记忆方式会把之前的对话内容总结一下限制在设定的token个数内 from langchain.memory import ConversationSummaryBufferMemorymemory ConversationSummaryBufferMemory(llm llm, # 这里的llm的作用是总结max_token_limit4097,memory_keychat_history ) approach 2 设置参数max_iterations agent ZeroShotAgent(llm_chainllm_chain, toolstools, max_iterations4, # 限制最大交互次数防止token超过上限verboseTrue ) 3. llm总是回复无法回答 很多教程把温度设置成0说是为了得到最准确的答案但是我发现这样设置agent会变得特别谨慎直接说它不知道温度调高以后问题解决了。 测试问题 What parts does a JUnit4 unit test case consist of? 代码 from constants import PROXY_URL,KEYimport warnings warnings.filterwarnings(ignore)import langchain langchain.debug Truefrom langchain.agents import load_tools from langchain.chat_models import ChatOpenAIfrom langchain.agents import AgentExecutor, ZeroShotAgent from langchain.chains import LLMChain from langchain.memory import ConversationSummaryBufferMemoryllm ChatOpenAI(temperature0.7, # 如果参数调得很低会导致LLM特别谨慎最后不给答案model_namegpt-3.5-turbo-0613, openai_api_keyKEY,openai_api_basePROXY_URL )memory ConversationSummaryBufferMemory(llm llm, # 这里的llm的作用是总结max_token_limit4097,memory_keychat_history )prefix You should be a proficient and helpful assistant in java unit testing with JUnit4 framework. You have access to the following tools: suffix Begin!{chat_history} Question: {input} {agent_scratchpad}tools load_tools([stackexchange],llmllm )prompt ZeroShotAgent.create_prompt(tools,prefixprefix,suffixsuffix,input_variables[input, chat_history, agent_scratchpad], ) # 这里集成了ReActllm_chain LLMChain(llmllm, promptprompt)agent ZeroShotAgent(llm_chainllm_chain, toolstools, max_iterations4, # 限制最大交互次数防止token超过上限verboseTrue )agent_chain AgentExecutor.from_agent_and_tools(agentagent, toolstools, verboseTrue, memorymemory )def ask_agent(question):answer agent_chain.run(inputquestion)return answerdef main():test_question What parts does a JUnit4 unit test case consist of?test_answer ask_agent(test_question)return test_answerif __name__ __main__:main()最后输出 [chain/end] [1:chain:AgentExecutor] [75.12s] Exiting Chain run with output: {   output: A JUnit4 unit test case consists of the following parts:\n1.  Test class: This is a class that contains the test methods.\n2. Test methods: These are the methods that contain the actual test code. They are annotated with the Test annotation.\n3. Assertions: These are used to verify  the expected behavior of the code being tested. JUnit provides various assertion methods for this purpose.\n4. Annotations: JUnit provides several annotations that can be used to configure the test case, such as Before, After, BeforeClass, and AfterClass.\n\nOverall, a JUnit4 unit test case  is a class that contains test methods with assertions, and can be configured using annotations. }
http://www.dnsts.com.cn/news/193293.html

相关文章:

  • 广州关于进一步免费发布网站seo外链
  • 肥西县建设局资询网站网站优化都是怎么做的
  • 网站首页标题字数一家专门做原型的网站
  • 网站建设get你科技小巨人申报条件
  • 承德做网站设计的中介网站建设
  • 武夷山建设局网站django和WordPress哪个好
  • 青岛建设公司网站怎么查看网站的pv uv
  • 四川住房城乡建设部网站可以做哪些网站有哪些内容吗
  • 网站做等保是什么意思wordpress只显示首页
  • cms 网站后台网站建设公司哪个好呀
  • 营销型网站重要特点是?360免费wifi怎么使用
  • 网站建设对数据库有何要求免费的网站域名申请
  • 网站建设选青岛的公司好不好苏州网站建设学费
  • 手机网站制作织梦网站模板广告关键词
  • 旅游 网站开发的项目描述网站建设淮安
  • 微信建设小网站链接国外网站问题
  • 常州网站建设要多少钱短链
  • 传媒网站建设价格深圳凡科网站建设
  • h5手机网站发展趋势网站服务内容怎样选
  • 教人做衣服的网站电商公司做网站
  • 网站开发与管理实训项目长沙seo袁飞
  • 做网站怎么买服务器网页传奇大全
  • 城阳做网站怎样创造自己的网站
  • 网站建设推荐信息桂林企业建站
  • dw建设的网站上传flash 网站 收费
  • 中国免费网站建设加盟全屋定制
  • 如何购买网站服务器物流公司介绍模板
  • 网站开发前后端语言做网站买空间多少钱
  • 揭阳新站seo方案网站模板库软件
  • 昆明猫咪科技网站建设wordpress插件开发