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

网页制作公司列举自己的优势常州seo排名外包

网页制作公司列举自己的优势,常州seo排名外包,怎样修改网站关键词,360网站seo优化怎么做一、如何开发prompts实现个性化的对话方式 通过设置“system”和“user”等roles#xff0c;可以实现个性化的对话方式#xff0c;并且可以结合参数“temperature”的设定来差异化LLM的输出内容。在此基础上#xff0c;通过构建一个餐馆订餐对话机器人来具体演示对话过程。… 一、如何开发prompts实现个性化的对话方式 通过设置“system”和“user”等roles可以实现个性化的对话方式并且可以结合参数“temperature”的设定来差异化LLM的输出内容。在此基础上通过构建一个餐馆订餐对话机器人来具体演示对话过程。 接下来会给出具体示例通过调用模型“gpt-3.5-turbo”来演示并解析如何针对上述需求来编写相应的prompts。 二、结合案例演示解析如何开发prompt实现个性化的对话方式 首先在messages中设定各个role的内容即prompts然后通过API调用模型输出内容。 prompt示例如下 messages   [  {role:system, content:You are an assistant that speaks like Shakespeare.},    {role:user, content:tell me a joke},   {role:assistant, content:Why did the chicken cross the road},   {role:user, content:I don\t know}  ] response get_completion_from_messages(messages, temperature1) print(response) 打印输出结果如下 Verily, forsooth, the chicken didst cross the road to evade the humorless peasants who didst question its motives with incessant queries. 接下来修改prompts的内容在调用API时增加参数temperature的设定。 prompt示例如下 messages   [  {role:system, content:You are friendly chatbot.},    {role:user, content:Hi, my name is Isa}  ] response get_completion_from_messages(messages, temperature1) print(response) 打印输出结果如下 Hello Isa! How can I assist you today? 继续修改prompts的内容 prompt示例如下 messages   [  {role:system, content:You are friendly chatbot.},    {role:user, content:Yes,  can you remind me, What is my name?}  ] response get_completion_from_messages(messages, temperature1) print(response) 打印输出结果如下 Im sorry, but as a chatbot, I dont have access to personal information. Could you please remind me of your name? 从上面输出结果看由于在”user”这个role对应的prompt中没有给出关于用户名字的信息导致聊天机器人给不出用户提出的问题的答案这时可以继续修改prompt。 prompt示例如下 messages   [  {role:system, content:You are friendly chatbot.}, {role:user, content:Hi, my name is Isa}, {role:assistant, content: Hi Isa! Its nice to meet you. \ Is there anything I can help you with today?}, {role:user, content:Yes, you can remind me, What is my name?}  ] response get_completion_from_messages(messages, temperature1) print(response) 打印输出结果如下 Your name is Isa! 接下来构建一个餐馆订餐对话机器人首先定义一个收集用户订餐需求的方法 构建一个用户与对话机器人的交互界面GUI import panel as pn  # GUI pn.extension() panels [] # collect display context [ {role:system, content: You are OrderBot, an automated service to collect orders for a pizza restaurant. \ You first greet the customer, then collects the order, \ and then asks if its a pickup or delivery. \ You wait to collect the entire order, then summarize it and check for a final \ time if the customer wants to add anything else. \ If its a delivery, you ask for an address. \ Finally you collect the payment.\ Make sure to clarify all options, extras and sizes to uniquely \ identify the item from the menu.\ You respond in a short, very conversational friendly style. \ The menu includes \ pepperoni pizza  12.95, 10.00, 7.00 \ cheese pizza   10.95, 9.25, 6.50 \ eggplant pizza   11.95, 9.75, 6.75 \ fries 4.50, 3.50 \ greek salad 7.25 \ Toppings: \ extra cheese 2.00, \ mushrooms 1.50 \ sausage 3.00 \ canadian bacon 3.50 \ AI sauce 1.50 \ peppers 1.00 \ Drinks: \ coke 3.00, 2.00, 1.00 \ sprite 3.00, 2.00, 1.00 \ bottled water 5.00 \ } ]  # accumulate messages inp pn.widgets.TextInput(valueHi, placeholderEnter text here…) button_conversation pn.widgets.Button(nameChat!) interactive_conversation pn.bind(collect_messages, button_conversation) dashboard pn.Column( inp, pn.Row(button_conversation), pn.panel(interactive_conversation, loading_indicatorTrue, height300), ) dashboard 用户界面显示如下 编写prompt根据之前的订餐情况输出订餐数据列表显示给用户。 prompt示例如下 messages   context.copy() messages.append( {role:system, content:create a json summary of the previous food order. Itemize the price for each item\ The fields should be 1) pizza, include size 2) list of toppings 3) list of drinks, include size   4) list of sides include size  5)total price },    ) #The fields should be 1) pizza, price 2) list of toppings 3) list of drinks, include size include price  4) list of sides include size include price, 5)total price },    response get_completion_from_messages(messages, temperature0) print(response) 打印输出结果如下 Sure! Heres a JSON summary of your food order: { pizza: { type: pepperoni, size: large }, toppings: [ extra cheese, mushrooms ], drinks: [ { type: coke, size: medium }, { type: sprite, size: small } ], sides: [ { type: fries, size: regular } ], total_price: 29.45 } Please let me know if theres anything else youd like to add to your order!
http://www.pierceye.com/news/901203/

相关文章:

  • 陕西省建设工会网站漳州做网站最便宜
  • asp网站怎么做301定向辽宁网络优化方法
  • 足球网站建设无锡企业网站的建设
  • 网站建设 国风网络学校网站建设新闻
  • 网站集成微信登录ai logo设计网站
  • 给客户做网站kesioncms企业网站蓝色模板
  • 哪个网站可以做视频播放器建筑工程网络计划方法
  • 长沙做网站的有哪些wordpress投稿页面路径怎么写
  • 京东第一次做网站如何做像淘宝一样的网站
  • 南湖网站建设公司怎么用iapp做网站软件
  • 永康网站建设专业公司六安网约车收入怎么样
  • 长沙品质企业建站服务电话随州公司做网站
  • 怎么做期货网站永久免费linux服务器
  • 怎么访问被禁止的网站微信商城网站方案
  • 建设网站需要会什么简单网页代码html
  • 南通网站怎么推广淘客选品网站开发
  • 网站开发的风险与风险管理网站名字
  • 朝阳网站视频拍摄脚本
  • 嘉兴建站模板源码郑州网站开发的公司电话
  • 新乡网站开发的公司电话百度热搜风云榜
  • 福永网站的建设福州
  • 抚州市临川区建设局网站eaccelerator wordpress
  • 如何让网站自适应屏幕门户网站主要特点和功能
  • 网站维护费用怎么收网站下载的软件怎么安装
  • 做电子相册的网站省住房和城乡建设厅官方网站
  • 什么是自助网站网页设计与制作课件和素材
  • 如何为网站建设内容wordpress去水印插件
  • 办公家具网站模版制作手机软件网站
  • 诚信网站认证必需做吗网站建设mfdos
  • 廊坊网站建设哪家权威网址导航大全排名