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

快速网站推广鹤壁网站建设

快速网站推广,鹤壁网站建设,现在网站建站的主流语言是什么,青岛建设银行网站接着前两节的Langchain#xff0c;继续实现Langchain中的Agent LangChain 实现给动物取名字#xff0c;LangChain 2模块化prompt template并用streamlit生成网站 实现给动物取名字 代码实现 # 从langchain库中导入模块 from langchain.llms import OpenAI # 从langchain.l…接着前两节的Langchain继续实现Langchain中的Agent LangChain 实现给动物取名字LangChain 2模块化prompt template并用streamlit生成网站 实现给动物取名字 代码实现 # 从langchain库中导入模块 from langchain.llms import OpenAI # 从langchain.llms导入OpenAI模块 from langchain.prompts import PromptTemplate # 从langchain.prompts导入PromptTemplate模块 from langchain.chains import LLMChain # 从langchain.chains导入LLMChain模块 from dotenv import load_dotenv # 从dotenv导入load_dotenv用于加载环境变量 from langchain.agents import load_tools # 从langchain.agents导入load_tools函数 from langchain.agents import initialize_agent # 从langchain.agents导入initialize_agent函数 from langchain.agents import AgentType # 从langchain.agents导入AgentType枚举类 from langchain.tools import WikipediaQueryRun # 从langchain.tools导入WikipediaQueryRun from langchain.utilities import WikipediaAPIWrapper # 从langchain.utilities导入WikipediaAPIWrapperload_dotenv() # 加载.env文件中的环境变量def langchain_agent():llm OpenAI(temperature0.5) # 创建OpenAI模型实例设置temperature参数为0.5以调整响应的多样性tools load_tools([wikipedia, llm-math], llmllm) # 加载wikipedia和llm-math工具与OpenAI模型实例一起使用agent initialize_agent(tools, llm, agentAgentType.ZERO_SHOT_REACT_DESCRIPTION, verboseTrue # 使用指定的工具、模型、agent类型和详细模式初始化agent)result agent.run(What is the average age of a dog? Multiply the age by 3 # 使用一个提示语来运行agent进行处理)print(result) # 打印agent的输出# 主执行检查 if __name__ __main__:langchain_agent() # 如果脚本是主程序则运行langchain_agent函数 安装lib pip install wikipedia 运行代码 python langchain_helper.py Entering new AgentExecutor chain...I need to find out the average age of a dog first. Action: Wikipedia Action Input: Average age of a dog Observation: Page: Aging in dogs Summary: Aging in dogs varies from breed to breed, and affects the dogs health and physical ability. As with humans, advanced years often bring changes in a dogs ability to hear, see, and move about easily. Skin condition, appetite, and energy levels often degrade with geriatric age. Medical conditions such as cancer, kidney failure, arthritis, dementia, and joint conditions, and other signs of old age may appear. The aging profile of dogs varies according to their adult size (often determined by their breed): smaller dogs often live over 15–16 years (sometimes longer than 20 years), medium and large size dogs typically 10 to 20 years, and some giant dog breeds such as mastiffs, often only 7 to 8 years. The latter reach maturity at a slightly older age than smaller breeds—giant breeds becoming adult around two years old compared to the norm of around 13–15 months for other breeds.Page: Dog Summary: The dog (Canis familiaris or Canis lupus familiaris) is a domesticated descendant of the wolf. Also called the domestic dog, it is derived from extinct Pleistocene wolves, and the modern wolf is the dogs nearest living relative. The dog was the first species to be domesticated by humans. Hunter-gatherers did this, over 15,000 years ago in Germany, which was before the development of agriculture. Due to their long association with humans, dogs have expanded to a large number of domestic individuals and gained the ability to thrive on a starch-rich diet that would be inadequate for other canids.The dog has been selectively bred over millennia for various behaviors, sensory capabilities, and physical attributes. Dog breeds vary widely in shape, size, and color. They perform many roles for humans, such as hunting, herding, pulling loads, protection, assisting police and the military, companionship, therapy, and aiding disabled people. Over the millennia, dogs became uniquely adapted to human behavior, and the human–canine bond has been a topic of frequent study. This influence on human society has given them the sobriquet of mans best friend.Page: Bluey (dog) Summary: Bluey (7 June 1910 – 14 November 1939) was a female Australian Cattle Dog owned by Les and Rosalie Hall of Rochester, Victoria. She previously held the Guinness World Records as the oldest dog to ever live, until being surpassed by Bobi from Portugal in 2023. Thought: I now know the average age of a dog. Action: Calculator Action Input: Multiply the average age of a dog by 3 Observation: Answer: 45.0 Thought: I now know the final answer. Final Answer: The average age of a dog multiplied by 3 is 45.0 years. Finished chain. The average age of a dog multiplied by 3 is 45.0 years.如果运行发生如下两种错误 错误一 resp self.send(File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/sessions.py, line 645, in sendr adapter.send(request, **kwargs)File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/adapters.py, line 517, in sendraise SSLError(e, requestrequest)requests.exceptions.SSLError: HTTPSConnectionPool(hosten.wikipedia.org, port443): Max retries exceeded with url: /w/api.php?propinfo%7CpagepropsinpropurlpppropdisambiguationredirectstitlesAgingindogsformatjsonactionquery (Caused by SSLError(SSLEOFError(8, EOF occurred in violation of protocol (_ssl.c:997))))错误二 Action Input: Average age of a dogTraceback (most recent call last):File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/models.py, line 910, in jsonreturn complexjson.loads(self.text, **kwargs)File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/__init__.py, line 346, in loadsreturn _default_decoder.decode(s)File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py, line 337, in decodeobj, end self.raw_decode(s, idx_w(s, 0).end())File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/json/decoder.py, line 355, in raw_decoderaise JSONDecodeError(Expecting value, s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)莫慌笔者尝试问GPT4和google得到的答案都不正确。解决方案是切换梯子到不同的国家试试。笔者试了目前德国是好的。美国、香港、日本、新加坡是有问题的。 参考 https://github.com/zgpeace/pets-name-langchain/tree/feature/agenthttps://youtu.be/lG7Uxts9SXs?siH1CISGkoYiKRSF5V
http://www.hkea.cn/news/14290073/

相关文章:

  • 树莓派做的网站大学网站建设排名
  • 佛山外贸网站建设特色手机商城官方网站
  • 商城网站设计制作中小企业网站建设 网络营销
  • 做网站运用的软件asp网站上哪做
  • 免费素材网站哪个最好企业网站建设协议范本
  • 韩城市住房和城乡建设局网站WordPress增加文章来源插件
  • 建设一个网站的基本成本开发微信小程序步骤
  • 单仁网站建设为某企业策划一次网络营销活动
  • 关于建设网站的报告书微信网站如何制作软件
  • 泉州住房城乡建设局网站猎聘网招聘官网app
  • 网站运营专员做什么wordpress 函数 文件大小
  • 网站管理系统开发的i深圳谁开发的
  • 电子商务网站模块室内装修图片效果图
  • 西安网站制作维护网站开发策划个人简历
  • 乐清网站只做西安网页设计设计培训
  • wdlinux 默认网站海南房产网站建设
  • 如何做电商网站视频公路投资建设有限公司网站
  • 网站伪静态是什么意思一键建站网站
  • 河北网站制作报价广告设计与制作专升本考试科目
  • 百度做网站和推广效果怎么样创意响应式网站建设
  • html5网站素材开发平台开发工具
  • 杭州的网站设计软件开发平台 devcloud
  • 用电脑做网站服务器龙口网站建设
  • 网站建设需要用到什么软件有哪些网站建设技术人员要会什么
  • 做网站销售的话术手机网站可以做商城吗
  • 做网站的公司如何推广wordpress 文章底部
  • 金华免费模板建站个人创业做网站
  • php可视化网站开发工具赣州网络营销
  • 网站建设需要什么呢创建学校网站
  • 彩票交易网站开发教你做美食的网站