\uff1a\u901a\u8fc7\u5728\u51fd\u6570\u5b9a\u4e49\u4e2d\u8bbe\u7f6estrict:true\u6765\u8c03\u7528\u7ed3\u6784\u5316\u8f93\u51fa\u3002<\/span><\/p>\n\u6b64\u529f\u80fd\u9002\u7528\u4e8e\u6240\u6709\u6a21\u578b\u578b\u53f7\uff0c\u5305\u62ecgpt-4-0613\u548cgpt-3.5-turbo-0613\u7b49\u3002\u5f53\u7ed3\u6784\u5316\u8f93\u51fa\u88ab\u542f\u7528\u65f6\uff0c\u6a21\u578b\u8f93\u51fa\u5c06\u5339\u914d\u63d0\u4f9b\u7684\u5de5\u5177\u5b9a\u4e49\u3002<\/p>\n
2\u3001response_format\u53c2\u6570\u65b0\u9009\u9879\u3002<\/p>\n
\u5f00\u53d1\u8005\u53ef\u4ee5\u901a\u8fc7json_schema (response_format\u53c2\u6570\u7684\u65b0\u9009\u9879)\u63d0\u4f9bJSON\u6a21\u5f0f\u3002<\/p>\n
\u5f53\u6a21\u578b\u4e0d\u662f\u8c03\u7528\u5de5\u5177\uff0c\u800c\u662f\u4ee5\u7ed3\u6784\u5316\u7684\u65b9\u5f0f\u54cd\u5e94\u7528\u6237\u65f6\uff0c\u8fd9\u662f\u6709\u7528\u7684\u3002\u8be5\u529f\u80fd\u9002\u7528\u4e8egpt-4o-2024-08-06\u548cgpt- 4o-mini-2024-07-18\u3002\u5f53response_format\u4f7f\u7528strict: true\u63d0\u4f9b\u65f6\uff0c\u6a21\u578b\u8f93\u51fa\u5c06\u4e0e\u63d0\u4f9b\u7684\u6a21\u5f0f\u5339\u914d\u3002<\/p>\n
OpenAI\u66f4\u65b0\u4e86Python\u548cNode SDK\uff0c\u652f\u6301\u672c\u5730\u7684\u7ed3\u6784\u5316\u8f93\u51fa\u529f\u80fd\u3002<\/p>\n
\u6b64\u5916\uff0c\u8fd8\u5f3a\u8c03\u4e86\u5b89\u5168\u8f93\u51fa\u3002\u65b0\u6a21\u5f0f\u5c06\u9075\u5faa\u73b0\u6709\u7684\u5b89\u5168\u89c4\u5219\uff0c\u5e76\u5f15\u5165\u4e86refusal\u5b57\u7b26\u4e32\u503c\u6765\u5e2e\u52a9\u5f00\u53d1\u8005\u8bc6\u522b\u6a21\u578b\u62d2\u7edd unsafe \u8bf7\u6c42\u7684\u60c5\u51b5\u3002<\/p>\n
\u7ed3\u6784\u5316\u8f93\u51fa\u8fd8\u53ef\u4ee5\u7528\u4e8e\u52a8\u6001\u751f\u6210\u7528\u6237\u754c\u9762\u3001\u5206\u79bb\u6700\u7ec8\u7b54\u6848\u4e0e\u63a8\u7406\u8fc7\u7a0b\u3001\u4ece\u975e\u7ed3\u6784\u5316\u6570\u636e\u4e2d\u63d0\u53d6\u7ed3\u6784\u5316\u6570\u636e\u7b49\u591a\u79cd\u7528\u4f8b\u3002<\/p>\n
<\/p>\n
\u6700\u540e\u5728\u4ef7\u683c\u65b9\u9762\uff0c\u8f93\u5165\u4ef7\u683c\u4e3a2.5\u7f8e\u5143\/100\u4e07token\uff0c\u8f93\u51fa\u4ef7\u683c\u4e3a10\u7f8e\u5143\/100\u4e07token\u3002<\/p>\n
\u7531\u4e8e\u65b0\u6a21\u578b\u5728\u8f93\u5165\u548c\u8f93\u51fa\u4e0a\u80fd\u66f4\u8282\u7701\uff0c\u56db\u820d\u4e94\u5165\u4e5f\u662f\u964d\u4ef7\u4e86\u3002<\/p>\n
<\/p>\n
\u6709\u4eba\u53d1\u73b0\uff0c\u8fd9\u4e2a\u65b0\u6a21\u578b\u7684\u8f93\u51fa\u6ca1\u6709\u4e0a\u4e00\u7248\u672c\u90a3\u4e48\u5197\u957f\uff0c\u6210\u672c\u4e0a\u66f4\u53ef\u63a7\u3002<\/p>\n
<\/p>\n
\u53c2\u8003\u94fe\u63a5\uff1a
<\/span>https:\/\/openai.com\/index\/introducing-structured-outputs-in-the-api\/<\/span><\/p>\n\n\n\u7279\u522b\u8bf4\u660e\uff1a\u672c\u6587\u4ec5\u7528\u4e8e\u5b66\u672f\u4ea4\u6d41\uff0c\u5982\u6709\u4fb5\u6743\u8bf7\u540e\u53f0\u8054\u7cfb\u5c0f\u7f16\u5220\u9664\u3002<\/span><\/span><\/section>\n<\/section>\n<\/blockquote>\n<\/section>\n\u00a0<\/section>\n","protected":false},"excerpt":{"rendered":"\u884c\u4e1a\u52a8\u6001 | GPT-4o\u65b0\u7248\u672c\u7a81\u7136\u4e0a\u7ebf\uff1a\u4e1d\u6ed1\u89e3\u51b39.11\u548c9.9\u8c01\u5927\uff0c\u66f4\u5f3a\u4e5f\u66f4\u4fbf\u5b9c\u4e86 \u91cf\u5b50\u4f4d\u00a0\u7ffb\u8bd1\u6280\u672f\u6559\u80b2\u4e0e […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90],"tags":[],"class_list":["post-32019","post","type-post","status-publish","format-standard","hentry","category-90"],"_links":{"self":[{"href":"https:\/\/linguaresources.com\/index.php?rest_route=\/wp\/v2\/posts\/32019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linguaresources.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linguaresources.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linguaresources.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linguaresources.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=32019"}],"version-history":[{"count":2,"href":"https:\/\/linguaresources.com\/index.php?rest_route=\/wp\/v2\/posts\/32019\/revisions"}],"predecessor-version":[{"id":32041,"href":"https:\/\/linguaresources.com\/index.php?rest_route=\/wp\/v2\/posts\/32019\/revisions\/32041"}],"wp:attachment":[{"href":"https:\/\/linguaresources.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=32019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linguaresources.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=32019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linguaresources.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=32019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}