{"id":398,"date":"2023-06-15T14:37:19","date_gmt":"2023-06-15T21:37:19","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/?p=398"},"modified":"2023-06-15T14:37:19","modified_gmt":"2023-06-15T21:37:19","slug":"%e4%bd%bf%e7%94%a8-net-%e5%bc%80%e5%a7%8b-openai-completions","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/%e4%bd%bf%e7%94%a8-net-%e5%bc%80%e5%a7%8b-openai-completions\/","title":{"rendered":"\u4f7f\u7528 .NET \u5f00\u59cb OpenAI Completions"},"content":{"rendered":"<p><em>\u4f5c\u8005\uff1aLuis Quintanilla<\/em><\/p>\n<p><em>\u7ffb\u8bd1\uff1aAlan Wang<\/em><\/p>\n<p>\u6b22\u8fce\u6765\u5230\u6709\u5173 OpenAI \u548c .NET \u7684\u535a\u5ba2\u7cfb\u5217\uff01<\/p>\n<p>\u5982\u679c\u60a8\u662f\u65b0\u6765\u7684\uff0c\u8bf7\u67e5\u770b\u6211\u4eec\u7684<a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/getting-started-azure-openai-dotnet\/\">\u7b2c\u4e00\u7bc7\u6587\u7ae0<\/a>\uff0c\u6211\u4eec\u5728\u5176\u4e2d\u4ecb\u7ecd\u4e86\u7cfb\u5217\u5185\u5bb9\uff0c\u5e76\u5411\u60a8\u5c55\u793a\u5982\u4f55\u5728 .NET \u4e2d\u5f00\u59cb\u4f7f\u7528 OpenAI\u3002<\/p>\n<p>\u672c\u6587\u7684\u91cd\u70b9\u662f Completions\u3002\u8ba9\u6211\u4eec\u5f00\u59cb\u5427\uff01<\/p>\n<h3><strong>\u4ec0\u4e48\u662f Completions\uff1f<\/strong><\/h3>\n<p>Completions \u662f\u7531\u50cf GPT \u8fd9\u6837\u7684\u6a21\u578b\u751f\u6210\u7684\u54cd\u5e94\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u751f\u6210\u7684\u54cd\u5e94\u7c7b\u578b\u5305\u62ec\uff1a<\/p>\n<p><span style=\"font-size: 14pt;\"><strong>\u6587\u672c<\/strong><\/span><\/p>\n<p><strong>\u8f93\u5165<\/strong><\/p>\n<p>\u5c06\u201cHello\u201d\u7ffb\u8bd1\u6210\u897f\u73ed\u7259\u8bed\u3002<\/p>\n<p><strong>\u8f93\u51fa<\/strong><\/p>\n<p>\u201cHola\u201d<\/p>\n<p><strong><span style=\"font-size: 14pt;\">\u4ee3\u7801<\/span><\/strong><\/p>\n<p><strong>\u8f93\u5165<\/strong><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a C# \u51fd\u6570\uff0c\u5c06\u4e24\u4e2a\u6574\u6570\u76f8\u52a0<\/p>\n<p><strong>\u8f93\u51fa<\/strong><\/p>\n<pre class=\"prettyprint language-cs language-csharp\"><code class=\"language-cs language-csharp\">int Add(int x, int y)\r\n{\r\n\u00a0\u00a0\u00a0 return x + y\r\n}<\/code><\/pre>\n<p><strong><span style=\"font-size: 14pt;\">\u56fe\u50cf<\/span><\/strong><\/p>\n<p><strong>\u8f93\u5165<\/strong><\/p>\n<p>\u4e00\u53ea\u88f9\u5728\u6bef\u5b50\u91cc\u7684\u8212\u9002\u7684\u54c8\u5df4\u72d7<\/p>\n<p><strong>\u8f93\u51fa<\/strong><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug.jpg\"><img decoding=\"async\" class=\"alignnone wp-image-400\" src=\"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug.jpg\" alt=\"Image pug\" width=\"363\" height=\"363\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug.jpg 512w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug-300x300.jpg 300w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug-150x150.jpg 150w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug-24x24.jpg 24w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug-48x48.jpg 48w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/pug-96x96.jpg 96w\" sizes=\"(max-width: 363px) 100vw, 363px\" \/><\/a><\/p>\n<p>\u672c\u6587\u91cd\u70b9\u5173\u6ce8\u6587\u672c\u548c\u4ee3\u7801\u7684 completion\u3002<\/p>\n<h3>Completion \u662f\u5982\u4f55\u751f\u6210\u7684\uff1f<\/h3>\n<p>\u751f\u6210 completion \u9700\u8981\u51e0\u90e8\u5206\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li>\u6a21\u578b<\/li>\n<li>\u7528\u6237\u8f93\u5165\uff08prompt\uff09<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-399\" src=\"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model.png\" alt=\"Image ai model\" width=\"2500\" height=\"424\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model.png 2500w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model-300x51.png 300w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model-1024x174.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model-768x130.png 768w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model-1536x260.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-content\/uploads\/sites\/75\/2023\/06\/ai-model-2048x347.png 2048w\" sizes=\"(max-width: 2500px) 100vw, 2500px\" \/><\/a><\/p>\n<p>\u4f60\u53ef\u4ee5\u628a\u6a21\u578b\u60f3\u8c61\u6210\u4e00\u4e2a\u6709\u72b6\u6001\u7684\u51fd\u6570\u3002\u6a21\u578b\u662f\u4e00\u4e2a\u7cfb\u7edf\uff0c\u7528\u4e8e\u901a\u8fc7\u7b97\u6cd5\u6765\u8bc6\u522b\u6570\u636e\u4e2d\u7684\u6a21\u5f0f\u3002\u6a21\u578b\u7684\u80fd\u529b\u53d6\u51b3\u4e8e\u7528\u6765\u6784\u5efa\u6a21\u578b\u7684\u6570\u636e\u548c\u7b97\u6cd5\u3002\u6709\u5173\u4e0d\u540c\u7c7b\u578b\u6a21\u578b\u53ca\u5176\u529f\u80fd\u7684\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 <a href=\"https:\/\/learn.microsoft.com\/azure\/cognitive-services\/openai\/concepts\/models\">Azure OpenAI \u670d\u52a1\u6a21\u578b\u6587\u6863<\/a>\u3002<\/p>\n<p>OpenAI \u6a21\u578b\uff08\u5982 GPT\uff09\u6240\u4f7f\u7528\u7684\u7b97\u6cd5\u662f\u88ab\u79f0\u4e3a\u8f6c\u6362\u5668\u7684\u795e\u7ecf\u7f51\u7edc\u3002\u66f4\u5177\u4f53\u5730\u8bf4\uff0c\u50cf GPT \u8fd9\u6837\u7684\u6a21\u578b\u901a\u5e38\u88ab\u79f0\u4e3a\u5927\u8bed\u8a00\u6a21\u578b\uff08LLM\uff09\uff0c\u8fd9\u662f\u56e0\u4e3a\u5b83\u4eec\u7684\u5927\u5c0f\uff08\u5927\uff09\u548c\u5b83\u4eec\u88ab\u8bbe\u8ba1\u51fa\u6765\u6240\u8981\u89e3\u51b3\u7684\u95ee\u9898\u7c7b\u578b\uff08\u8bed\u8a00\uff09\u3002<\/p>\n<p>\u672c\u6587\u7684\u8303\u56f4\u4e0d\u5305\u542b\u5927\u8bed\u8a00\u6a21\u578b\u7684\u6280\u672f\u7ec6\u8282\u7136\u800c\uff0c\u5982\u679c\u4f60\u60f3\u4e86\u89e3\u66f4\u591a\uff0c\u8bf7\u67e5\u770b\u6587\u7ae0\u300a<a href=\"https:\/\/writings.stephenwolfram.com\/2023\/02\/what-is-chatgpt-doing-and-why-does-it-work\/\">ChatGPT \u5728\u505a\u4ec0\u4e48&#8230;\u4ee5\u53ca\u5b83\u4e3a\u4ec0\u4e48\u6709\u6548<\/a>\u300b\u4ee5\u53ca\u8bba\u6587\u300a<a href=\"https:\/\/openai.com\/research\/language-models-are-few-shot-learners\">\u8bed\u8a00\u6a21\u578b\u662f\u5c11\u91cf\u5b9e\u4f8b\u5b66\u4e60\u8005<\/a>\u300b\u3002<\/p>\n<p>\u7528\u6237\u8f93\u5165\uff08\u4e5f\u79f0\u4e3a prompt\uff09\u662f\u6307\u5bfc\u6a21\u578b\u5e76\u63d0\u4f9b\u60a8\u5e0c\u671b\u6a21\u578b\u8f93\u51fa\u7684\u8bf4\u660e\u3002\u4e3a\u4e86\u83b7\u5f97\u66f4\u7cbe\u786e\u7684\u7ed3\u679c\uff0c\u63d0\u793a\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li>\u80cc\u666f<\/li>\n<li>\u4efb\u52a1\/\u63d0\u95ee<\/li>\n<\/ul>\n<p>\u7ed9\u5b9a\u4ee5\u4e0b prompt\uff1a<\/p>\n<p style=\"padding-left: 80px;\">\u4e3a\u4e8c\u5e74\u7ea7\u5b66\u751f\u603b\u7ed3\uff1a<\/p>\n<p style=\"padding-left: 80px;\">\u6728\u661f\u662f\u8ddd\u79bb\u592a\u9633\u7b2c\u4e94\u8fd1\u7684\u884c\u661f\uff0c\u4e5f\u662f\u592a\u9633\u7cfb\u4e2d\u6700\u5927\u7684\u884c\u661f\u3002\u5b83\u662f\u4e00\u4e2a\u6c14\u6001\u5de8\u5927\u884c\u661f\uff0c\u5176\u8d28\u91cf\u662f\u592a\u9633\u7684\u5343\u5206\u4e4b\u4e00\uff0c\u5374\u662f\u592a\u9633\u7cfb\u5176\u4ed6\u6240\u6709\u884c\u661f\u8d28\u91cf\u603b\u548c\u76842.5\u500d\u3002\u5728\u591c\u7a7a\u4e2d\uff0c\u8089\u773c\u53ef\u89c1\u7684\u6700\u4eae\u7269\u4f53\u4e4b\u4e00\u5c31\u662f\u6728\u661f\uff0c\u65e9\u5728\u6709\u8bb0\u8f7d\u7684\u5386\u53f2\u4ee5\u524d\u5c31\u5df2\u88ab\u53e4\u4ee3\u6587\u660e\u6240\u77e5\u6653\u3002\u6728\u661f\u5f97\u540d\u4e8e\u7f57\u9a6c\u795e\u8bdd\u4e2d\u7684\u4e3b\u795e\u6731\u5e87\u7279[19]\u3002\u4ece\u5730\u7403\u4e0a\u89c2\u5bdf\uff0c\u6728\u661f\u8db3\u591f\u660e\u4eae\uff0c\u4ee5\u81f3\u4e8e\u5b83\u53cd\u5c04\u7684\u5149\u53ef\u4ee5\u6295\u5c04\u51fa\u53ef\u89c1\u7684\u9634\u5f71[20]\uff0c\u901a\u5e38\u662f\u591c\u7a7a\u4e2d\u7ee7\u6708\u4eae\u548c\u91d1\u661f\u4e4b\u540e\u7b2c\u4e09\u4eae\u7684\u81ea\u7136\u5929\u4f53\u3002<\/p>\n<p>\u5b83\u53ef\u4ee5\u62c6\u5206\u4e3a\uff1a<\/p>\n<ul>\n<li><strong>\u80cc\u666f<\/strong>\uff1a\u6728\u661f\u662f\u8ddd\u79bb\u592a\u9633\u7b2c\u4e94\u8fd1\u7684\u884c\u661f\uff0c\u4e5f\u662f\u592a\u9633\u7cfb\u4e2d\u6700\u5927\u7684\u884c\u661f\u3002\u5b83\u662f\u4e00\u4e2a\u6c14\u6001\u5de8\u5927\u884c\u661f\uff0c\u5176\u8d28\u91cf\u662f\u592a\u9633\u7684\u5343\u5206\u4e4b\u4e00\uff0c\u5374\u662f\u592a\u9633\u7cfb\u5176\u4ed6\u6240\u6709\u884c\u661f\u8d28\u91cf\u603b\u548c\u76845\u500d\u3002\u5728\u591c\u7a7a\u4e2d\uff0c\u8089\u773c\u53ef\u89c1\u7684\u6700\u4eae\u7269\u4f53\u4e4b\u4e00\u5c31\u662f\u6728\u661f\uff0c\u65e9\u5728\u6709\u8bb0\u8f7d\u7684\u5386\u53f2\u4ee5\u524d\u5c31\u5df2\u88ab\u53e4\u4ee3\u6587\u660e\u6240\u77e5\u6653\u3002\u6728\u661f\u5f97\u540d\u4e8e\u7f57\u9a6c\u795e\u8bdd\u4e2d\u7684\u4e3b\u795e\u6731\u5e87\u7279[19]\u3002\u4ece\u5730\u7403\u4e0a\u89c2\u5bdf\uff0c\u6728\u661f\u8db3\u591f\u660e\u4eae\uff0c\u4ee5\u81f3\u4e8e\u5b83\u53cd\u5c04\u7684\u5149\u53ef\u4ee5\u6295\u5c04\u51fa\u53ef\u89c1\u7684\u9634\u5f71[20]\uff0c\u901a\u5e38\u662f\u591c\u7a7a\u4e2d\u7ee7\u6708\u4eae\u548c\u91d1\u661f\u4e4b\u540e\u7b2c\u4e09\u4eae\u7684\u81ea\u7136\u5929\u4f53\u3002<\/li>\n<li><strong>\u4efb\u52a1\/\u63d0\u95ee<\/strong>\uff1a\u4e3a\u4e8c\u5e74\u7ea7\u5b66\u751f\u603b\u7ed3\u8fd9\u4e00\u5185\u5bb9\uff1a<\/li>\n<\/ul>\n<p>\u6700\u7ec8\u7684 completion \u7ed3\u679c\u5e94\u8be5\u7c7b\u4f3c\u4e8e\uff1a<\/p>\n<p style=\"padding-left: 40px;\">\u6728\u661f\u662f\u8ddd\u79bb\u592a\u9633\u7b2c\u4e94\u8fd1\u7684\u884c\u661f\uff0c\u4e5f\u662f\u6211\u4eec\u592a\u9633\u7cfb\u4e2d\u6700\u5927\u7684\u884c\u661f\u3002\u5b83\u5728\u591c\u7a7a\u4e2d\u975e\u5e38\u660e\u4eae\uff0c\u81ea\u53e4\u4ee5\u6765\u5c31\u4e3a\u4eba\u6240\u77e5\u3002\u5b83\u662f\u4ee5\u7f57\u9a6c\u795e\u8bdd\u4e2d\u7684\u4e3b\u795e\u6731\u5e87\u7279\u547d\u540d\u7684\u3002\u901a\u5e38\u5b83\u662f\u591c\u7a7a\u4e2d\u6708\u4eae\u548c\u91d1\u661f\u4e4b\u540e\u7684\u7b2c\u4e09\u4eae\u7269\u4f53\u3002<\/p>\n<p>\u8fd9\u91cc\u91cd\u8981\u7684\u90e8\u5206\u662f\u4efb\u52a1\/\u63d0\u95ee\uff0c\u56e0\u4e3a\u8fd9\u6b63\u662f\u5f15\u5bfc\u6a21\u578b\u4ea7\u751f\u7279\u5b9a\u7c7b\u578b\u8f93\u51fa\u7684\u5185\u5bb9\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6211\u5c06\u4efb\u52a1\/\u63d0\u95ee\u66f4\u6539\u4e3a\u201c\u6728\u661f\u7684\u8d28\u91cf\u4e0e\u592a\u9633\u76f8\u6bd4\u5982\u4f55\uff1f\u201d\uff0c\u6211\u53ef\u4ee5\u9884\u671f\u4ea7\u751f\u7c7b\u4f3c\u201c\u6728\u661f\u7684\u8d28\u91cf\u662f\u592a\u9633\u7684\u5343\u5206\u4e4b\u4e00\uff0c\u62160.001\u4e2a\u592a\u9633\u8d28\u91cf\u3002\u201d\u7684 completion \u5185\u5bb9\u3002<\/p>\n<p>\u6b63\u5982\u60a8\u6240\u770b\u5230\u7684\uff0c\u5f53\u60a8\u5c06 GPT \u7b49\u6a21\u578b\u4e0e\u4e00\u4e2a\u683c\u5f0f\u826f\u597d\u7684\u63d0\u793a\u7ed3\u5408\u4f7f\u7528\u65f6\uff0c\u5b83\u4eec\u4e3a\u6784\u5efa\u4f7f\u7528 AI \u7684\u5404\u79cd\u7c7b\u578b\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u6709\u6548\u7684\u57fa\u7840\u3002<\/p>\n<h3>\u5728\u6211\u7684 prompt \u4e2d\u6211\u53ef\u4ee5\u63d0\u4f9b\u591a\u5c11\u6587\u5b57\uff1f<\/h3>\n<p>\u60a8\u7684 prompt \u5927\u5c0f\u662f\u7528\u201ctoken\u201d\u6765\u8861\u91cf\u7684\u3002\u901a\u5e38\uff0cGPT \u6a21\u578b\u4f1a\u5c06\u5355\u8bcd\u62c6\u5206\u4e3a\u201ctoken\u201d\u3002\u5e38\u89c1\u7684\u591a\u97f3\u8282\u8bcd\u901a\u5e38\u662f\u4e00\u4e2a token\uff0c\u800c\u4e0d\u592a\u5e38\u89c1\u7684\u8bcd\u5219\u4f1a\u6309\u97f3\u8282\u62c6\u5206\u3002\u6bcf\u4e2a\u6a21\u578b\u90fd\u6709\u4e00\u4e2a token \u9650\u5236\u3002\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u67e5\u770b <a href=\"https:\/\/learn.microsoft.com\/azure\/cognitive-services\/openai\/concepts\/models\">Azure OpenAI \u670d\u52a1\u6a21\u578b\u6587\u6863<\/a>\u3002<\/p>\n<p>\u8981\u8ba1\u7b97\u60a8 prompt \u4e2d\u7684 token \u6570\u91cf\uff0c\u8bf7\u4f7f\u7528 <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.ML.Tokenizers\/\">Microsoft.ML.Tokenizers<\/a> NuGet \u5305\u3002<\/p>\n<p>\u67e5\u770b <a href=\"https:\/\/aka.ms\/openai-dotnet-tokenization\">token \u5316\u793a\u4f8b<\/a>\u83b7\u53d6\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<h3>\u5982\u4f55\u5f00\u59cb\u751f\u6210\u6211\u7684 completion\uff1f<\/h3>\n<p>\u73b0\u5728\u60a8\u77e5\u9053\u4e86 completion \u662f\u4ec0\u4e48\u4ee5\u53ca\u5b83\u4eec\u662f\u5982\u4f55\u751f\u6210\u7684\uff0c\u73b0\u5728\u662f\u65f6\u5019\u5f00\u59cb\u751f\u6210\u60a8\u81ea\u5df1\u7684 completion \u4e86\u3002\u5f00\u59cb\u7684\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u6ce8\u518c\u6216\u8bf7\u6c42\u8bbf\u95ee <a href=\"https:\/\/platform.openai.com\/signup\/\">OpenAI<\/a> \u6216 <a href=\"https:\/\/learn.microsoft.com\/azure\/cognitive-services\/openai\/overview#how-do-i-get-access-to-azure-openai\">Azure OpenAI \u670d\u52a1<\/a>\u3002<\/li>\n<li>\u4f7f\u7528\u60a8\u7684\u51ed\u636e\u5f00\u59cb\u5c1d\u8bd5 <a href=\"https:\/\/aka.ms\/openai-dotnet-samples\">OpenAI .NET \u793a\u4f8b<\/a>\u3002<\/li>\n<\/ol>\n<h3>\u4e0b\u4e00\u6b65<\/h3>\n<p>\u5728\u4e0b\u4e00\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u66f4\u8be6\u7ec6\u5730\u8ba8\u8bba\u5173\u4e8e prompt \u5de5\u7a0b\u7684\u8bdd\u9898\uff0c\u8fd9\u662f\u4f18\u5316 prompt \u4ee5\u4ea7\u751f\u66f4\u7cbe\u786e\u7b54\u6848\u7684\u8fc7\u7a0b\u3002<\/p>\n<h3>\u6211\u4eec\u60f3\u542c\u5230\u60a8\u7684\u58f0\u97f3<\/h3>\n<p>\u5e2e\u52a9\u6211\u4eec\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u60a8\u5982\u4f55\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4f7f\u7528 AI \u7684\u4fe1\u606f\u3002\u8bf7\u82b1\u51e0\u5206\u949f\u65f6\u95f4\u5b8c\u6210\u8fd9\u4e2a<a href=\"https:\/\/aka.ms\/dotnet-oai-survey-2\">\u8c03\u67e5<\/a>\u3002<\/p>\n<p>\u8fd8\u6709\u54ea\u4e9b\u60a8\u60f3\u8981\u8fdb\u4e00\u6b65\u4e86\u89e3\u7684\u8bdd\u9898\uff1f\u8bf7\u5728\u8bc4\u8bba\u533a\u544a\u8bc9\u6211\u4eec\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1aLuis Quintanilla \u7ffb\u8bd1\uff1aAlan Wang \u6b22\u8fce\u6765\u5230\u6709\u5173 OpenAI \u548c .NET \u7684\u535a\u5ba2\u7cfb\u5217\uff01 \u5982\u679c\u60a8\u662f\u65b0\u6765\u7684\uff0c\u8bf7\u67e5\u770b\u6211\u4eec\u7684\u7b2c\u4e00\u7bc7\u6587\u7ae0\uff0c\u6211\u4eec\u5728\u5176\u4e2d\u4ecb\u7ecd\u4e86\u7cfb\u5217\u5185\u5bb9\uff0c\u5e76\u5411\u60a8\u5c55\u793a\u5982\u4f55\u5728 .NET \u4e2d\u5f00\u59cb\u4f7f\u7528 OpenAI\u3002 \u672c\u6587\u7684\u91cd\u70b9\u662f Completions\u3002\u8ba9\u6211\u4eec\u5f00\u59cb\u5427\uff01 \u4ec0\u4e48\u662f Completions\uff1f Completions \u662f\u7531\u50cf GPT \u8fd9\u6837\u7684\u6a21\u578b\u751f\u6210\u7684\u54cd\u5e94\u3002 \u4f60\u53ef\u4ee5\u751f\u6210\u7684\u54cd\u5e94\u7c7b\u578b\u5305\u62ec\uff1a \u6587\u672c \u8f93\u5165 \u5c06\u201cHello\u201d\u7ffb\u8bd1\u6210\u897f\u73ed\u7259\u8bed\u3002 \u8f93\u51fa \u201cHola\u201d \u4ee3\u7801 \u8f93\u5165 \u521b\u5efa\u4e00\u4e2a C# \u51fd\u6570\uff0c\u5c06\u4e24\u4e2a\u6574\u6570\u76f8\u52a0 \u8f93\u51fa int Add(int x, int y) { \u00a0\u00a0\u00a0 return x + y } \u56fe\u50cf \u8f93\u5165 \u4e00\u53ea\u88f9\u5728\u6bef\u5b50\u91cc\u7684\u8212\u9002\u7684\u54c8\u5df4\u72d7 \u8f93\u51fa \u672c\u6587\u91cd\u70b9\u5173\u6ce8\u6587\u672c\u548c\u4ee3\u7801\u7684 completion\u3002 Completion \u662f\u5982\u4f55\u751f\u6210\u7684\uff1f \u751f\u6210 completion [&hellip;]<\/p>\n","protected":false},"author":99474,"featured_media":401,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-398","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet-ch"],"acf":[],"blog_post_summary":"<p>\u4f5c\u8005\uff1aLuis Quintanilla \u7ffb\u8bd1\uff1aAlan Wang \u6b22\u8fce\u6765\u5230\u6709\u5173 OpenAI \u548c .NET \u7684\u535a\u5ba2\u7cfb\u5217\uff01 \u5982\u679c\u60a8\u662f\u65b0\u6765\u7684\uff0c\u8bf7\u67e5\u770b\u6211\u4eec\u7684\u7b2c\u4e00\u7bc7\u6587\u7ae0\uff0c\u6211\u4eec\u5728\u5176\u4e2d\u4ecb\u7ecd\u4e86\u7cfb\u5217\u5185\u5bb9\uff0c\u5e76\u5411\u60a8\u5c55\u793a\u5982\u4f55\u5728 .NET \u4e2d\u5f00\u59cb\u4f7f\u7528 OpenAI\u3002 \u672c\u6587\u7684\u91cd\u70b9\u662f Completions\u3002\u8ba9\u6211\u4eec\u5f00\u59cb\u5427\uff01 \u4ec0\u4e48\u662f Completions\uff1f Completions \u662f\u7531\u50cf GPT \u8fd9\u6837\u7684\u6a21\u578b\u751f\u6210\u7684\u54cd\u5e94\u3002 \u4f60\u53ef\u4ee5\u751f\u6210\u7684\u54cd\u5e94\u7c7b\u578b\u5305\u62ec\uff1a \u6587\u672c \u8f93\u5165 \u5c06\u201cHello\u201d\u7ffb\u8bd1\u6210\u897f\u73ed\u7259\u8bed\u3002 \u8f93\u51fa \u201cHola\u201d \u4ee3\u7801 \u8f93\u5165 \u521b\u5efa\u4e00\u4e2a C# \u51fd\u6570\uff0c\u5c06\u4e24\u4e2a\u6574\u6570\u76f8\u52a0 \u8f93\u51fa int Add(int x, int y) { \u00a0\u00a0\u00a0 return x + y } \u56fe\u50cf \u8f93\u5165 \u4e00\u53ea\u88f9\u5728\u6bef\u5b50\u91cc\u7684\u8212\u9002\u7684\u54c8\u5df4\u72d7 \u8f93\u51fa \u672c\u6587\u91cd\u70b9\u5173\u6ce8\u6587\u672c\u548c\u4ee3\u7801\u7684 completion\u3002 Completion \u662f\u5982\u4f55\u751f\u6210\u7684\uff1f \u751f\u6210 completion [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/posts\/398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/users\/99474"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/comments?post=398"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/posts\/398\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/media\/401"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/media?parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/categories?post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet-ch\/wp-json\/wp\/v2\/tags?post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}