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

工信部网站验证码flash 网站

工信部网站验证码,flash 网站,wordpress 主题编辑,jsp网站开发广告位在这一章中#xff0c;我们将探讨如何结束自动生成代理之间的对话。 导入必要的库 import osfrom autogen import ConversableAgent配置智能体 我们需要配置智能体使用的语言模型#xff08;LLM#xff09;。以下是一个配置示例#xff1a; llm_config {config_…在这一章中我们将探讨如何结束自动生成代理之间的对话。 导入必要的库 import osfrom autogen import ConversableAgent配置智能体 我们需要配置智能体使用的语言模型LLM。以下是一个配置示例 llm_config {config_list: [{model: GLM-4-Plus,api_key: your api key,base_url: https://open.bigmodel.cn/api/paas/v4/,}] }创建智能体 创建两个智能体cathy和joe并设置它们的系统消息和配置 cathy ConversableAgent(cathy,system_messageYour name is Cathy and you are a part of a duo of comedians.,llm_configllm_config,human_input_modeNEVER, # Never ask for human input. )joe ConversableAgent(joe,system_messageYour name is Joe and you are a part of a duo of comedians.,llm_configllm_config,human_input_modeNEVER, # Never ask for human input. )初始化对话 使用initiate_chat方法让joe向cathy发起对话 result joe.initiate_chat(cathy, messageCathy, tell me a joke., max_turns2)输出结果如下 [33mjoe[0m (to cathy):Cathy, tell me a joke.-------------------------------------------------------------------------------- [33mcathy[0m (to joe):Oh, absolutely! Heres one for you:Why dont scientists trust atoms?Because they make up everything!But wait, it gets better! My comedy partner and I have this routine where I say the punchline, and they come back with, And thats why my bank account is always empty—because my moneys just a bunch of atoms too! Gotta love a good science pun, right? -------------------------------------------------------------------------------- [33mjoe[0m (to cathy):Haha, classic! You know, Cathy, thats the kind of humor that really resonates with the crowd. Its smart, but it also has that everyday relatability. And the callback to the bank account? Brilliant! Its like were telling the audience, Hey, were just like you—except we make jokes about it.Now, how about we flip it and I give you a setup? Here goes:So, I walked into a bar, and the bartender says, Why the long phase shift?Your turn to deliver the punchline! -------------------------------------------------------------------------------- [33mcathy[0m (to joe):Oh, I love this setup! Heres my take:Well, I just came from a quantum physics convention, and lets just say, Im still waiting for my state to collapse!Boom! Its like were serving up a cocktail of humor and science—shaken, not stirred! --------------------------------------------------------------------------------控制对话轮次 可以通过max_turns参数控制对话的轮次 result joe.initiate_chat(cathy, messageCathy, tell me a joke., max_turns1 ) # decrease the number of max turns before termination输出结果如下 [33mjoe[0m (to cathy):Cathy, tell me a joke.-------------------------------------------------------------------------------- [33mcathy[0m (to joe):Oh, absolutely! Heres one for you:Why dont scientists trust atoms?Because they make up everything!But wait, it gets better! My comedy partner and I have this routine where I say the punchline, and they come back with, And thats why my bank account is always empty—because my moneys just a bunch of atoms too! Gotta love a good science pun, right? --------------------------------------------------------------------------------限制连续自动回复 可以通过max_consecutive_auto_reply参数限制连续自动回复的次数 joe ConversableAgent(joe,system_messageYour name is Joe and you are a part of a duo of comedians.,llm_configllm_config,human_input_modeNEVER, # Never ask for human input.max_consecutive_auto_reply1, # Limit the number of consecutive auto-replies. )result joe.initiate_chat(cathy, messageCathy, tell me a joke.)输出结果与之前类似但joe在回复一次后会停止自动回复。 自定义终止条件 可以通过is_termination_msg参数设置自定义的终止条件 joe ConversableAgent(joe,system_messageYour name is Joe and you are a part of a duo of comedians.,llm_configllm_config,human_input_modeNEVER, # Never ask for human input.is_termination_msglambda msg: good bye in msg[content].lower(), )result joe.initiate_chat(cathy, messageCathy, tell me a joke and then say the words GOOD BYE.)输出结果如下 [33mjoe[0m (to cathy):Cathy, tell me a joke and then say the words GOOD BYE.-------------------------------------------------------------------------------- [33mcathy[0m (to joe):Sure thing! Heres one for you:Why dont scientists trust atoms anymore?Because they make up everything!GOOD BYE! --------------------------------------------------------------------------------总结 通过本教程我们学习了如何使用Autogen库创建可对话的智能体并通过示例代码展示了如何配置智能体、初始化对话、控制对话轮次、限制连续自动回复以及设置自定义终止条件。希望这些内容对你有所帮助 参考链接https://microsoft.github.io/autogen/0.2/docs/tutorial/chat-termination 如果有任何问题欢迎在评论区提问。
http://www.hkea.cn/news/14458626/

相关文章:

  • 中国小康建设网站办公室装修设计平面图
  • 浦东新区中国建设银行官网站网站开发怎么找客户
  • 个人企业网站怎么建设平台推广员是做什么的
  • 学术网站建设凡科网官网登录入口
  • 网站备案重要吗做网站新手流程
  • 郑州彩票网站建设软文网站平台
  • 怎么可以上传自己做的网站厦门市建设局网站首页
  • 滨州市网站建设中小型网站建设精英
  • 二手交易平台的网站怎么做做区块链网站需要注意哪些
  • 做理财网站 程序员 违法吗线上运营公司
  • 类似小红书网站开发费用东营建设网站
  • 鞍山网站广告咨询
  • 政务公开和网站建设先进个人金山区网站建设
  • 网站建设明细表厦门网站优化
  • 公司网站建设多少费用兴田德润在哪里外贸网站建站电话多少
  • 专门做试卷的网站吉林省建设安全信息网
  • 服装微信商城网站建设怎样下载网页上的视频
  • 山东省建设厅执业资格注册中心网站扬中新闻头条新闻
  • 企业网站功能模块编程入门自学软件
  • 个人网站备注模板通用网站后台管理 asp.net 源码
  • 天津市住房和城乡建设厅官方网站企业网站建设组织人员可行性分析
  • 江苏住房和建设厅网站新强生产建设兵团网站
  • 哈尔滨网站优化对策h5美食制作网站模板下载
  • 网站建设丶金手指花总11漳州建设项目公告网站
  • 服装网站的建设策划正规现货交易平台app
  • 做网站页面大小多大如何做一个网站推广自己的产品
  • 邢台移动网站建设价格株洲网站开发
  • 法学网站阵地建设2024近期新闻
  • 做徒步网站怎么样网站建设合同需要交印花税吗
  • 站内推广的方式有哪些夏天做那些网站致富