{"id":302,"date":"2023-10-09T22:40:08","date_gmt":"2023-10-09T14:40:08","guid":{"rendered":"https:\/\/myhelpfulai.com\/?p=302"},"modified":"2023-10-09T22:40:08","modified_gmt":"2023-10-09T14:40:08","slug":"wei-ruan-autogen-jin-yi-bu-shi-yong-2","status":"publish","type":"post","link":"https:\/\/aitimes.link\/index.php\/2023\/10\/09\/wei-ruan-autogen-jin-yi-bu-shi-yong-2\/","title":{"rendered":"\u5fae\u8f6fautogen-\u8fdb\u4e00\u6b65\u4f7f\u75282"},"content":{"rendered":"\n<p>\u672c\u7740\u597d\u5947\u7684\u6001\u5ea6\uff0c\u8fdb\u4e00\u6b65\u770b\u4e86\u4e0b\u5b83\u7684\u4f8b\u5b50\uff0c\u53d1\u73b0\u6709\u4e9b\u60ca\u8273\uff1a <a href=\"https:\/\/github.com\/microsoft\/autogen\/blob\/main\/notebook\/agentchat_teaching.ipynb\">https:\/\/github.com\/microsoft\/autogen\/blob\/main\/notebook\/agentchat_teaching.ipynb<\/a>      \u8003\u8651\u8fd9\u6837\u4e00\u4e2a\u573a\u666f:\u9700\u8981\u627e\u5230\u67d0\u4e2a\u4e3b\u9898\u7684\u7814\u7a76\u8bba\u6587\uff0c\u5bf9\u5e94\u7528\u9886\u57df\u8fdb\u884c\u5206\u7c7b\uff0c\u5e76\u7ed8\u5236\u6bcf\u4e2a\u9886\u57df\u7684\u8bba\u6587\u6570\u91cf\u7684\u6761\u5f62\u56fe\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u89e3\u51b3\u5899\u5185\u8bbf\u95eeOpenAI\u7684\u95ee\u9898\uff0c \u7ee7\u7eed\u4f7f\u7528openai-forward \u4ee3\u7406\u5230\u81ea\u5df1\u7684\u8f6c\u53d1\u670d\u52a1\u4e0a\uff0c\u4fee\u6539\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import autogen\n\nconfig_list =&#91;\n    {\n        \"model\": \"gpt-4\",\n        \"api_key\": \"fk-xxxx\",\n        \"api_base\": \"http:\/\/47.251.x.xxx:18088\/v1\"\n    }\n]\n\nllm_config={\n    \"request_timeout\": 600,\n    \"seed\": 44,  # change the seed for different trials\n    # \"config_list\": autogen.config_list_from_json(\n    #     \"OAI_CONFIG_LIST\",\n    #     filter_dict={\"model\": &#91;\"gpt-4-32k\"]},\n    # ),\n    \"config_list\":config_list,\n    \"temperature\": 0,\n}\n\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u7136\u540e\u544a\u8bc9assistant \u4ee3\u7406\uff1a\u5230arxiv\u641c\u5bf9\u5e94\u4e3b\u9898\u7684\u6587\u7ae0\ntask1 = \"\"\"\nFind arxiv papers that show how are people studying trust calibration in AI based systems \n\"\"\"\n\nuser_proxy.initiate_chat(assistant, message=task1)\n<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u4ee3\u7406\u7ed9\u51fa\u7684\u7ed3\u8bba\u7b54\u6848\u5f88\u662f\u5389\u5bb3\uff1a<br>1.\u76f4\u63a5\u4ee3\u7801\u90fd\u7ed9\u5199\u597d\u4e86\u3002 \u5305\u62ec\u641c\u7d22arxiv\u7684\u65b9\u6cd5\u3001\u89e3\u6790\u65b9\u6cd5\uff0c\u90fd\u63d0\u4f9b\u4e86\u5b9e\u73b0\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"580\" src=\"https:\/\/myhelpfulai.com\/wp-content\/uploads\/2023\/10\/image-3-1024x580.png\" alt=\"\" class=\"wp-image-303\" srcset=\"https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-3-1024x580.png 1024w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-3-300x170.png 300w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-3-768x435.png 768w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-3-1536x870.png 1536w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-3.png 1952w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u8f93\u51fa\u4e5f\u662f\u6bd4\u8f83\u6709\u6548\uff1a \u5b8c\u6574\u7684\u6807\u9898\u3001\u4f5c\u8005\u3001\u6458\u8981<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"689\" src=\"https:\/\/myhelpfulai.com\/wp-content\/uploads\/2023\/10\/image-4-1024x689.png\" alt=\"\" class=\"wp-image-304\" srcset=\"https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-4-1024x689.png 1024w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-4-300x202.png 300w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-4-768x516.png 768w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-4-1536x1033.png 1536w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-4.png 1942w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4efb\u52a12\uff1a\u8fdb\u884c\u89e3\u8bfb\u3001\u6458\u8981\u4efb\u52a1\uff0c\u4e5f\u662f\u975e\u5e38\u987a\u5229\u7684\u5b8c\u6210\u3002 \u751a\u81f3\u8fd8\u5728\u5bf9\u8bdd\u548c\u6267\u884c\u4e2d\uff0c\u80fd\u7ea0\u6b63\u53d8\u91cf\u7f3a\u5931\u3001\u4f9d\u8d56\u5305\u7f3a\u5931\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<p>task2 <strong>=<\/strong> &#8220;analyze the above the results to list the application domains studied by these papers &#8220;<\/p>\n\n\n\n<p> user_proxy<strong>.<\/strong>initiate_chat(assistant, message<strong>=<\/strong>task2, clear_history<strong>=False<\/strong>)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"716\" src=\"https:\/\/myhelpfulai.com\/wp-content\/uploads\/2023\/10\/image-5-1024x716.png\" alt=\"\" class=\"wp-image-305\" srcset=\"https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-5-1024x716.png 1024w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-5-300x210.png 300w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-5-768x537.png 768w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-5-1536x1074.png 1536w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-5.png 1894w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4efb\u52a13\uff1a\u7528\u56fe\u6807\u5c55\u793a\u5206\u6790\u6570\u636e\uff1a<\/p>\n\n\n\n<p>task3 <strong>=<\/strong> &#8220;&#8221;&#8221;Use this data to generate a bar chart of domains and number of papers in that domain and save to a file &#8220;&#8221;&#8221; <\/p>\n\n\n\n<p>user_proxy<strong>.<\/strong>initiate_chat(assistant, message<strong>=<\/strong>task3, clear_history<strong>=False<\/strong>)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/myhelpfulai.com\/wp-content\/uploads\/2023\/10\/image-6.png\" alt=\"\" class=\"wp-image-307\" srcset=\"https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-6.png 640w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-6-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p>more\uff1aCreate Recipes  \u751a\u81f3\u53ef\u4ee5\u628a\u4e0a\u9762\u7684\u4efb\u52a1\uff0c\u5b9a\u4e49\u6210\u6a21\u677f\uff0c\u7136\u540e\u8fdb\u884c\u590d\u7528\uff01 &#8211;\u56e0\u4e3a\u6d89\u53ca\u8f93\u5165\u6bd4\u8f83\u5927\uff0c\u9700\u898132k\u4e0a\u4e0b\u6587\u6a21\u578b<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"195\" src=\"https:\/\/myhelpfulai.com\/wp-content\/uploads\/2023\/10\/image-7-1024x195.png\" alt=\"\" class=\"wp-image-308\" srcset=\"https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-7-1024x195.png 1024w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-7-300x57.png 300w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-7-768x146.png 768w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-7.png 1374w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"697\" src=\"https:\/\/myhelpfulai.com\/wp-content\/uploads\/2023\/10\/image-8-1024x697.png\" alt=\"\" class=\"wp-image-309\" srcset=\"https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-8-1024x697.png 1024w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-8-300x204.png 300w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-8-768x523.png 768w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-8-1536x1045.png 1536w, https:\/\/aitimes.link\/wp-content\/uploads\/2023\/10\/image-8.png 1684w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7740\u597d\u5947\u7684\u6001\u5ea6\uff0c\u8fdb\u4e00\u6b65\u770b\u4e86\u4e0b\u5b83\u7684\u4f8b\u5b50\uff0c\u53d1\u73b0\u6709\u4e9b\u60ca\u8273\uff1a https:\/\/github.com\/microsoft [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-302","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":2,"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":310,"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/posts\/302\/revisions\/310"}],"wp:attachment":[{"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aitimes.link\/index.php\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}