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

做商城网站系统网络营销课程培训机构

做商城网站系统,网络营销课程培训机构,修改网站主目录的位置,用wordpress安全吗前言 今天带来的仍然是AutoGen基于AssistantAgent和UserProxyAgent的例子#xff0c;以帮助大家一起消化目前最前卫的AI应用框架。这是一个AIGC最擅长#xff0c;因为生成新闻稿嘛#xff0c;同时又需要利用Agent的一个常规Demo。了解LangChain的同学#xff0c;会通过对比…前言 今天带来的仍然是AutoGen基于AssistantAgent和UserProxyAgent的例子以帮助大家一起消化目前最前卫的AI应用框架。这是一个AIGC最擅长因为生成新闻稿嘛同时又需要利用Agent的一个常规Demo。了解LangChain的同学会通过对比发现AutoGen做法的高级并解锁新的AutoGen高级技能Agent函数调用。 话说笔者当年读大学的时候突然蹦出了一个要跨考新闻学的大胆想法。随即立马冲向书店买来全套人大新闻学考研书籍报了各种考研辅导班… 还记得当年政治辅导班的老教授听说我一个双非的筒子想跨考人大的新闻学的时候一脸的尴尬… 今天就让我们基于AutoGen,来一起写生成一篇新闻稿弥补当年的遗憾… 主题 谁是最勇敢的人当然是最可爱的人身边的战地记者当年我突发奇想想跨考新闻学也是因为这个。我们今天要写的新闻主题是关于最近最揪心的中东问题写一篇新闻搞报道哈马斯。 开发思路 AIGC 有了大模型写新闻这种事交给它就可以了这是AIGC类大模型最擅长的。 Agent 大模型不擅长的是新闻时事比如chatgpt 3.5训练的数据截止两年前。怎么办呢我们可以使用一个网络请求Agent,先去访问Google得到“哈马斯”相关的新闻再交给LLm来生成新闻。 使用serpapi来获取Google接口数据 上图我们使用了serpapi的playgound, 搜索框输入了“哈马斯”下半部分左边是google页面显示截图右边是serpapi返回的接口数据。 notebook代码 我这边AutoGen是跑在Colab上的一个Google的线上NLP开放平台巴适的很一起薅羊毛啊大家也可以点开[autogen_news.ipynb - Colaboratory (google.com)]边看文章边点击运行代码。 安装依赖 %pip install pyautogen~0.1.0 google-search-results -q -U pyautogen即AutoGen,目前还在早期版本0.1.0, 有些同学觉得API换的好勤这很正常非常早期。 google-search-results 即serpapi 提供的google api sdk。 定义接口函数 AutoGen中UserProxyAgent具有强大功能除了可以做我们的代理外还可以执行我们定义好的函数。在这里我们定义好google search 的函数 到时由UserProxyAgent 自动调用。赞啊今天的能力增长点Get!!! from serpapi import GoogleSearch # 引入 GoogleSearch模块 def search_google_news(keyword): # 定义搜索函数交给proxy agent调用print(fKeyword:{keyword})search GoogleSearch({ #向GoogleSearch传递配置参数q:keyword, # 关键字tbm: nws, # 表示搜索的是新闻api_key: # https://serpapi.com/manage-api-key 处获得})result search.get_dict()print(result)return [item[link] for item in result[news_results]] #只需要返回的每条记录中的link超链接 上图是api_key {position: 4, link: https://news.online.sh.cn/news/gb/content/2023-11/14/content_10141630.htm, title: 内塔尼亚胡说“可能”与哈马斯达成放人协议, source: 上海热线, date: 16 hours ago, snippet: 新华社北京11月13日电以色列总理本雅明·内塔尼亚胡12日接受美国媒体采访时说“可能”与巴勒斯坦伊斯兰抵抗运动哈马斯就释放遭扣押人员达成协议..., thumbnail: https://serpapi.com/searches/655439e095bf92860deeae63/images/706261574d4453726e8c40185f13181cccd5b3544a7ebe85168ea4acb6679a89.jpeg} 上面是接口返回的一条数据的格式在search_google_news函数中 最后我们通过**[item[‘link’] for item in result[‘news_results’]]** 代码只返回链接部分 函数返回的结果是 [https://www.voachinese.com/a/us-britain-impose-sanctions-on-hamas-20231114/7354871.html, https://www.rfi.fr/cn/%E5%9B%BD%E9%99%85/20231114-%E8%A7%86%E9%A2%91-%E5%93%88%E9%A9%AC%E6%96%AF%E5%8A%A0%E6%B2%99%E5%A4%9A%E6%9C%BA%E6%9E%84%E5%A4%B1%E5%AE%88-%E4%BB%8D%E7%BB%AD%E5%8F%91%E7%81%AB%E7%AE%AD%E5%BC%B9%E7%82%B8%E4%BB%A5%E8%89%B2%E5%88%97,https://chinese.aljazeera.net/palestine-israel-conflict/liveblog/2023/11/15/%E4%BB%A5%E8%89%B2%E5%88%97%E5%AF%B9%E5%8A%A0%E6%B2%99%E6%88%98%E4%BA%89%E7%9A%84%E4%BB%8A%E6%97%A5%E5%8F%91%E5%B1%95%E4%BB%A5%E8%89%B2%E5%88%97%E8%A2%AD%E5%87%BB%E5%B8%8C%E6%B3%95%E5%8C%BB%E9%99%A2....] 接下来引入AutoGen完成配置和前几篇文章一样,不懂的看前面文章的介绍 import autogenconfig_list [{model: gpt-3.5-turbo,api_key: } ] llm_config{timeout: 600,seed: 42,config_list: config_list,temperature: 0,functions: [{name: search_google_news,description: Search google news by keyword,parameters: {type: object,properties: {keyword: {type: string,description: The keyword thats used to search google news,}},required: [keyword],},}], } 上面的llm_config 配置代码中比上篇文章多了 functions 部分即大模型可以使用的函数name为search_google_news, agent就可以调用上面定义的函数了。并使用description 声明了agent调用哪个函数的自然语义LLM可以根据用户的输入来对description做embedding的。required 是必须传的参数。 创建Agent assistant autogen.AssistantAgent( nameassistant, llm_configllm_config ) #create a proxyAgent named user_proxyuser_proxy autogen.UserProxyAgent( nameuser_proxy,human_input_modeNEVER, #用户输入模式是从命令行 max_consecutive_auto_reply10, # 代理Agent会代替用户做执行这里配置最大的连续自动proxy次数是 10 # lambda关键字在Python中用于创建匿名函数也就是没有名字的函数。这个函数接受一个参数x然后返回一个布尔值。检查x的content字段的值是否以TERMINATE结束code_execution_config{work_dir:.}, # 这个有点意思感觉是我们在向代理agent授权。 system_messageWhen a link is provided, you should ask the assistant for fetching the content.Reply TERMINATE if the task has been solved at full satisfaction.Otherwise, reply CONTINUE, or the reason why the task is not solved yet. )function_map{search_google_news:search_google_news} 开始agents对话 user_proxy.initiate_chat( assistant, messageSearch Google news in topic of 哈马斯,and write a news base on them.You should be avoid bullet points.Instead, use more expressive words to form a news thats like one written by a well recognized journalist.Start the keywords now ) 研究输出了解 agent chat 工作流。 1. user_proxy接收到我们的指令跟assistant聊天下达任务。 user_proxy (to assistant): Search Google news in topic of 哈马斯,and write a news base on them. You should be avoid bullet points. Instead, use more expressive words to form a news thats like one written by a well recognized journalist. Start the keywords now 借助之前对Prompt 的理解assistant应用借助了大模型从user_proxy的命令语义中提取出了任务和关键字哈马斯。 assistant (to user_proxy): ***** Suggested function Call: search_google_news ***** Arguments: { keyword: 哈马斯 } ******************************************************* 2. assistant 结合llm_config配置的functionschat 告诉user_proxy 执行search_google_news函数并提供了相应的参数keyword。 实在太nb了。我个人理解AutoGen提供的这种Agent with funciton calls 能力必然成为超越LangChain等框架的优势有点像agent的agent… 3. 执行函数拿到google API 返回并获取link 列表 4.assistant 在拿到这些response后 向user_proxy汇报将去分析这些链接里的文章assistant做为agent, 有远程请求网页并parse的能力这是我们之前在langChai中的agent能力。 5.assistant基于拿到的内容开始aigc, 按之前用户的需求写一篇新闻稿written by a well recognized journalist这里是prompt的情景设定。 In the midst of escalating tensions in the Gaza Strip, the militant group 哈马斯 is facing significant challenges as it continues to engage in conflict with Israel. Recent developments have highlighted the complex dynamics at play in the region, with both military and political implications. According to reports, 哈马斯 has lost control over several key institutions in Gaza, raising concerns about its ability to maintain its stronghold in the area. The Israeli military has claimed that 哈马斯 grip on power has weakened, citing the loss of control over strategic locations. This has led to speculation about the groups future and its ability to effectively govern in the face of mounting pressure. In response to the situation, 哈马斯 has continued to launch rocket attacks against Israel, further fueling the conflict. Despite the setbacks, the group remains defiant, vowing to retaliate against what it perceives as Israeli aggression. The ongoing violence has resulted in civilian casualties and widespread destruction, exacerbating an already dire humanitarian situation in the region. The international community has also weighed in on the situation, with the United States and Britain imposing sanctions on 哈马斯. This move is seen as a significant step in isolating the group and holding it accountable for its actions. However, opinions on the effectiveness of such measures remain divided, with some arguing that they may further escalate tensions and hinder efforts towards a peaceful resolution. Meanwhile, the controversy surrounding 哈马斯 has extended beyond the conflict zone. In France, the use of the term terrorist to describe the group has sparked a heated debate. French news agency Agence France-Presse (AFP) has decided to refrain from using the term, citing concerns about its potential impact on public perception and the need for impartial reporting. This decision has drawn both support and criticism, highlighting the complexities of addressing the issue from a journalistic standpoint. As the situation in Gaza continues to evolve, the future of 哈马斯 remains uncertain. The groups ability to navigate the challenges it faces, both internally and externally, will undoubtedly shape the course of the conflict and its impact on the region. The international community, meanwhile, faces the daunting task of finding a sustainable and peaceful resolution to the long-standing Israeli-Palestinian conflict. Note: This news article is a fictional representation based on the provided keywords and search results. It does not reflect real events or news reporting. 好的任务完成太酷了。 总结 本篇主要介绍了AutoGen的agent with function calls的Demo。作者有以下几个感受 LLM带来的Prompt Enginner, 让更多非软件专业的同学能够加入到LLM的“掘金”中来。笔者正在力求与其它专业的同学沟通AutoGen这种自动聊天的运行方式让Prompt Enginner 更自然更接地气。agent with function calls 强大了agent 的工程化能力agent照章办事又为prompt 提供了程序能力。 如何学习AI大模型 我在一线互联网企业工作十余年里指导过不少同行后辈。帮助很多人得到了学习和成长。 我意识到有很多经验和知识值得分享给大家也可以通过我们的能力和经验解答大家在人工智能学习中的很多困惑所以在工作繁忙的情况下还是坚持各种整理和分享。但苦于知识传播途径有限很多互联网行业朋友无法获得正确的资料得到学习提升故此将并将重要的AI大模型资料包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来。 第一阶段 从大模型系统设计入手讲解大模型的主要方法 第二阶段 在通过大模型提示词工程从Prompts角度入手更好发挥模型的作用 第三阶段 大模型平台应用开发借助阿里云PAI平台构建电商领域虚拟试衣系统 第四阶段 大模型知识库应用开发以LangChain框架为例构建物流行业咨询智能问答系统 第五阶段 大模型微调开发借助以大健康、新零售、新媒体领域构建适合当前领域大模型 第六阶段 以SD多模态大模型为主搭建了文生图小程序案例 第七阶段 以大模型平台应用与开发为主通过星火大模型文心大模型等成熟大模型构建大模型行业应用。 学会后的收获 • 基于大模型全栈工程实现前端、后端、产品经理、设计、数据分析等通过这门课可获得不同能力 • 能够利用大模型解决相关实际项目需求 大数据时代越来越多的企业和机构需要处理海量数据利用大模型技术可以更好地处理这些数据提高数据分析和决策的准确性。因此掌握大模型应用开发技能可以让程序员更好地应对实际项目需求 • 基于大模型和企业数据AI应用开发实现大模型理论、掌握GPU算力、硬件、LangChain开发框架和项目实战技能 学会Fine-tuning垂直训练大模型数据准备、数据蒸馏、大模型部署一站式掌握 • 能够完成时下热门大模型垂直领域模型训练能力提高程序员的编码能力 大模型应用开发需要掌握机器学习算法、深度学习框架等技术这些技术的掌握可以提高程序员的编码能力和分析能力让程序员更加熟练地编写高质量的代码。 1.AI大模型学习路线图 2.100套AI大模型商业化落地方案 3.100集大模型视频教程 4.200本大模型PDF书籍 5.LLM面试题合集 6.AI产品经理资源合集 获取方式 有需要的小伙伴可以保存图片到wx扫描二v码免费领取【保证100%免费】
http://www.hkea.cn/news/14309590/

相关文章:

  • 厦门做网站最好的公司做网站开发要学多久
  • 网站推广策划思路html个人简历代码
  • 虚拟主机建多个网站做网站一共需要多少钱
  • 网站首页下拉广告关于网络营销的论文
  • 旭辉网站建设建站公司新闻资讯
  • 地产行业网站建设图片上海短期网站建设培训
  • 西安风险等级最新网站排名在哪里优化
  • 个人网站不能有盈利性质网站更换服务器要重新备案吗
  • 好的室内设计网站企业文化墙内容设计
  • 企业网站的基本类型包括成都建模培训
  • 网站内容建设需要注意哪些问题百度seo收费
  • 上传网站步骤wordpress订阅支付
  • 网站运营与维护的方法网站seo视频教程
  • 买了个区域名怎么做网站苏州网络推广专员
  • 株洲网站建设开发设计网络服务器有哪些
  • 网站建设算固定资产吗韶关市建设局网站
  • 搜索引擎营销是目前最主要的网站推广营销个人网上公司注册流程图
  • 合肥建网站手机网站的特效
  • 柳州网站虚拟主机销售价格导购网站建设
  • 做网站维护价格校园网站开发
  • 怎样更新网站合肥网站建设cnfg
  • 域名没备案如何建设网站如何做好网站管理工作
  • 哪个省份做网站的多遵义市建设厅网站
  • 怎么用asp.net做网站嘉兴专业的嘉兴专业网站建设项目
  • 线上做交互的网站梅州免费建站找哪家
  • 世界杯直播观看网站动态域名申请
  • 社交网站平台怎么做推荐6个免费国外自媒体平台
  • 网站上做树状框架图用什么软件区块链开发工程师要求
  • 服装网站建设公司哪家好做网站为什么很复杂
  • 集团网站建设特点 互联网课堂网页源代码在线查看