{"id":3514,"date":"2026-10-23T08:46:36","date_gmt":"2026-10-22T23:46:36","guid":{"rendered":"https:\/\/qol-kk.com\/wp2\/?p=3514"},"modified":"2026-10-23T08:46:36","modified_gmt":"2026-10-22T23:46:36","slug":"20261011-plan077","status":"publish","type":"post","link":"https:\/\/qol-kk.com\/wp2\/blog\/2026\/10\/23\/20261011-plan077\/","title":{"rendered":"OpenAI API \u306e Function Calling \u3067\u5916\u90e8\u30c4\u30fc\u30eb\u3092\u9023\u643a\u3059\u308b"},"content":{"rendered":"<h2>\u6982\u8981<\/h2>\n<p>LLM \u306f\u5b66\u7fd2\u6e08\u307f\u306e\u77e5\u8b58\u3067\u6587\u7ae0\u3092\u751f\u6210\u3059\u308b\u306e\u306f\u5f97\u610f\u3067\u3059\u304c\u3001\u300c\u4eca\u65e5\u306e\u5929\u6c17\u300d\u300c\u793e\u5185 DB \u306e\u5728\u5eab\u6570\u300d\u300c\u5916\u90e8 API \u306e\u5b9f\u884c\u7d50\u679c\u300d\u3068\u3044\u3063\u305f\u3001<strong>\u30e2\u30c7\u30eb\u306e\u5916\u5074\u306b\u3042\u308b\u6700\u65b0\u30fb\u56fa\u6709\u306e\u60c5\u5831<\/strong>\u306f\u77e5\u308a\u307e\u305b\u3093\u3002\u3053\u306e\u9699\u9593\u3092\u57cb\u3081\u308b\u4ed5\u7d44\u307f\u304c Function Calling\uff08\u73fe\u5728\u306e OpenAI API \u3067\u306f <code>tools<\/code> \u30d1\u30e9\u30e1\u30fc\u30bf\uff09\u3067\u3059\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001OpenAI API \u306e Function Calling \u3092\u4f7f\u3044\u3001\u30e2\u30c7\u30eb\u306b\u300c\u3069\u306e\u95a2\u6570\u3092\u30fb\u3069\u3093\u306a\u5f15\u6570\u3067\u547c\u3076\u3079\u304d\u304b\u300d\u3092\u5224\u65ad\u3055\u305b\u3001\u5b9f\u969b\u306e\u51e6\u7406\u306f\u3053\u3061\u3089\u5074\u306e\u30b3\u30fc\u30c9\u3067\u5b9f\u884c\u3057\u3001\u305d\u306e\u7d50\u679c\u3092\u30e2\u30c7\u30eb\u306b\u8fd4\u3057\u3066\u6700\u7d42\u56de\u7b54\u3092\u4f5c\u308b\u4e00\u9023\u306e\u30eb\u30fc\u30d7\u3092\u3001\u30cf\u30f3\u30ba\u30aa\u30f3\u3067\u7d44\u307f\u7acb\u3066\u307e\u3059\u3002\u516c\u958b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u57fa\u3065\u304f\u4e00\u822c\u7684\u306a\u5b9f\u88c5\u30d1\u30bf\u30fc\u30f3\u306e\u307f\u3092\u6271\u3044\u307e\u3059\u3002<\/p>\n<h2>\u74b0\u5883<\/h2>\n<ul>\n<li>Python 3.11<\/li>\n<li><code>openai<\/code> \u30e9\u30a4\u30d6\u30e9\u30ea\uff08v1 \u7cfb\uff09<\/li>\n<li>\u30e2\u30c7\u30eb: <code>gpt-4o-mini<\/code>\uff08Function Calling \u5bfe\u5fdc\u30e2\u30c7\u30eb\u306a\u3089\u3069\u308c\u3067\u3082\u53ef\uff09<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">pip install openai\nexport OPENAI_API_KEY=\"\uff08\u81ea\u5206\u306e\u30ad\u30fc\u3092\u8a2d\u5b9a\uff09\"<\/pre>\n<h2>Function Calling \u306e\u4ed5\u7d44\u307f<\/h2>\n<p>\u3088\u304f\u3042\u308b\u8aa4\u89e3\u3068\u3057\u3066\u300c\u30e2\u30c7\u30eb\u304c\u95a2\u6570\u3092\u5b9f\u884c\u3057\u3066\u304f\u308c\u308b\u300d\u3068\u601d\u308f\u308c\u304c\u3061\u3067\u3059\u304c\u3001\u9055\u3044\u307e\u3059\u3002\u5b9f\u969b\u306e\u6d41\u308c\u306f\u3053\u3046\u3067\u3059\u3002<\/p>\n<ol>\n<li>\u3053\u3061\u3089\u304c\u300c\u4f7f\u3048\u308b\u95a2\u6570\u306e\u4e00\u89a7\uff08\u30b9\u30ad\u30fc\u30de\uff09\u300d\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u6dfb\u3048\u3066\u9001\u308b<\/li>\n<li>\u30e2\u30c7\u30eb\u306f\u8cea\u554f\u306b\u7b54\u3048\u308b\u305f\u3081\u306b\u95a2\u6570\u304c\u5fc5\u8981\u3068\u5224\u65ad\u3057\u305f\u3089\u3001\u300c\u3053\u306e\u95a2\u6570\u3092\u30fb\u3053\u306e\u5f15\u6570\u3067\u547c\u3093\u3067\u307b\u3057\u3044\u300d\u3068\u3044\u3046<strong>\u547c\u3073\u51fa\u3057\u6307\u793a\uff08JSON\uff09<\/strong>\u3092\u8fd4\u3059<\/li>\n<li><strong>\u5b9f\u969b\u306e\u95a2\u6570\u5b9f\u884c\u306f\u3053\u3061\u3089\u5074\u306e\u30b3\u30fc\u30c9\u304c\u884c\u3046<\/strong><\/li>\n<li>\u5b9f\u884c\u7d50\u679c\u3092\u30e1\u30c3\u30bb\u30fc\u30b8\u5c65\u6b74\u306b\u8ffd\u52a0\u3057\u3066\u3001\u3082\u3046\u4e00\u5ea6\u30e2\u30c7\u30eb\u306b\u9001\u308b<\/li>\n<li>\u30e2\u30c7\u30eb\u304c\u7d50\u679c\u3092\u8e0f\u307e\u3048\u305f\u81ea\u7136\u8a00\u8a9e\u306e\u6700\u7d42\u56de\u7b54\u3092\u8fd4\u3059<\/li>\n<\/ol>\n<p>\u3064\u307e\u308a\u30e2\u30c7\u30eb\u306f\u300c\u3069\u306e\u9053\u5177\u3092\u30fb\u3069\u3046\u4f7f\u3046\u304b\u300d\u3092\u6c7a\u3081\u308b\u3060\u3051\u3067\u3001\u5b9f\u884c\u8cac\u4efb\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5074\u306b\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u8a2d\u8a08\u4e0a\u3082\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<h2>\u30c4\u30fc\u30eb\u30b9\u30ad\u30fc\u30de\u3092\u5b9a\u7fa9\u3059\u308b<\/h2>\n<p>\u30e2\u30c7\u30eb\u306b\u6559\u3048\u308b\u300c\u95a2\u6570\u306e\u8aac\u660e\u66f8\u300d\u3092 JSON Schema \u5f62\u5f0f\u3067\u5b9a\u7fa9\u3057\u307e\u3059\u3002<code>description<\/code> \u306f\u30e2\u30c7\u30eb\u304c\u547c\u3073\u51fa\u3057\u5224\u65ad\u306b\u4f7f\u3046\u305f\u3081\u3001<strong>\u81ea\u7136\u8a00\u8a9e\u3067\u4e01\u5be7\u306b\u66f8\u304f<\/strong>\u306e\u304c\u30b3\u30c4\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">tools = [\n    {\n        \"type\": \"function\",\n        \"function\": {\n            \"name\": \"get_weather\",\n            \"description\": \"\u6307\u5b9a\u3057\u305f\u90fd\u5e02\u306e\u73fe\u5728\u306e\u5929\u6c17\u3092\u53d6\u5f97\u3059\u308b\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u5929\u6c17\u3092\u5c0b\u306d\u305f\u3068\u304d\u306b\u4f7f\u3046\u3002\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"city\": {\n                        \"type\": \"string\",\n                        \"description\": \"\u90fd\u5e02\u540d\u3002\u4f8b: Tokyo, Osaka\",\n                    },\n                    \"unit\": {\n                        \"type\": \"string\",\n                        \"enum\": [\"celsius\", \"fahrenheit\"],\n                        \"description\": \"\u6e29\u5ea6\u306e\u5358\u4f4d\u3002\u6307\u5b9a\u304c\u306a\u3051\u308c\u3070 celsius\u3002\",\n                    },\n                },\n                \"required\": [\"city\"],\n            },\n        },\n    }\n]<\/pre>\n<h2>\u5b9f\u88c5\u4f8b<\/h2>\n<h3>\u5b9f\u969b\u306b\u547c\u3070\u308c\u308b\u95a2\u6570<\/h3>\n<p>\u3053\u3053\u3067\u306f\u5916\u90e8 API \u306e\u4ee3\u308f\u308a\u306b\u30c0\u30df\u30fc\u5b9f\u88c5\u306b\u3057\u307e\u3059\u3002\u5b9f\u904b\u7528\u3067\u306f\u5929\u6c17 API \u3084\u793e\u5185\u30b5\u30fc\u30d3\u30b9\u306e\u547c\u3073\u51fa\u3057\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">import json\n\ndef get_weather(city: str, unit: str = \"celsius\") -&gt; str:\n    # \u672c\u6765\u306f\u3053\u3053\u3067\u5916\u90e8 API \u3092\u53e9\u304f\u3002\u4eca\u56de\u306f\u56fa\u5b9a\u5024\u3092\u8fd4\u3059\u3002\n    fake_db = {\n        \"Tokyo\": {\"celsius\": 18, \"fahrenheit\": 64},\n        \"Osaka\": {\"celsius\": 20, \"fahrenheit\": 68},\n    }\n    temp = fake_db.get(city, {}).get(unit, \"unknown\")\n    return json.dumps({\"city\": city, \"unit\": unit, \"temperature\": temp})\n\navailable_functions = {\n    \"get_weather\": get_weather,\n}<\/pre>\n<h3>\u547c\u3073\u51fa\u3057\u30eb\u30fc\u30d7\u5168\u4f53<\/h3>\n<pre class=\"lang:default decode:true\">from openai import OpenAI\n\nclient = OpenAI()\nMODEL = \"gpt-4o-mini\"\n\ndef run_conversation(user_input: str) -&gt; str:\n    messages = [\n        {\"role\": \"system\", \"content\": \"\u3042\u306a\u305f\u306f\u5929\u6c17\u60c5\u5831\u30a2\u30b7\u30b9\u30bf\u30f3\u30c8\u3067\u3059\u3002\"},\n        {\"role\": \"user\", \"content\": user_input},\n    ]\n\n    # [1] 1\u56de\u76ee\u306e\u30ea\u30af\u30a8\u30b9\u30c8\uff08tools \u3092\u6dfb\u3048\u308b\uff09\n    response = client.chat.completions.create(\n        model=MODEL,\n        messages=messages,\n        tools=tools,\n        tool_choice=\"auto\",  # \u30e2\u30c7\u30eb\u306b\u547c\u3076\u304b\u3069\u3046\u304b\u3092\u4efb\u305b\u308b\n    )\n\n    msg = response.choices[0].message\n\n    # [2] \u95a2\u6570\u547c\u3073\u51fa\u3057\u304c\u4e0d\u8981\u306a\u3089\u305d\u306e\u307e\u307e\u8fd4\u3059\n    if not msg.tool_calls:\n        return msg.content\n\n    # \u30a2\u30b7\u30b9\u30bf\u30f3\u30c8\u306e tool_calls \u3092\u542b\u3080\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5c65\u6b74\u306b\u8ffd\u52a0\n    messages.append(msg)\n\n    # [3] \u8981\u6c42\u3055\u308c\u305f\u95a2\u6570\u3092\u9806\u306b\u5b9f\u884c\n    for tool_call in msg.tool_calls:\n        fn_name = tool_call.function.name\n        fn_args = json.loads(tool_call.function.arguments)\n\n        fn = available_functions[fn_name]\n        result = fn(**fn_args)\n\n        # [4] \u5b9f\u884c\u7d50\u679c\u3092 role=\"tool\" \u3067\u5c65\u6b74\u306b\u8ffd\u52a0\n        messages.append({\n            \"role\": \"tool\",\n            \"tool_call_id\": tool_call.id,\n            \"content\": result,\n        })\n\n    # [5] \u7d50\u679c\u3092\u8e0f\u307e\u3048\u3066\u6700\u7d42\u56de\u7b54\u3092\u751f\u6210\n    second = client.chat.completions.create(\n        model=MODEL,\n        messages=messages,\n    )\n    return second.choices[0].message.content\n\n\nif __name__ == \"__main__\":\n    print(run_conversation(\"\u6771\u4eac\u306e\u5929\u6c17\u3092\u6559\u3048\u3066\"))<\/pre>\n<h3>\u30dd\u30a4\u30f3\u30c8\u306e\u89e3\u8aac<\/h3>\n<ul>\n<li><strong><code>tool_choice=\"auto\"<\/code><\/strong>: \u30e2\u30c7\u30eb\u306b\u300c\u95a2\u6570\u3092\u4f7f\u3046\u304b\u3069\u3046\u304b\u300d\u3092\u4efb\u305b\u307e\u3059\u3002\u5fc5\u305a\u7279\u5b9a\u306e\u95a2\u6570\u3092\u547c\u3070\u305b\u305f\u3044\u5834\u5408\u306f <code>{\"type\": \"function\", \"function\": {\"name\": \"get_weather\"}}<\/code> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li><strong><code>tool_call_id<\/code> \u306e\u5bfe\u5fdc\u4ed8\u3051<\/strong>: \u7d50\u679c\u3092\u8fd4\u3059\u3068\u304d\u306f\u3001\u547c\u3073\u51fa\u3057\u3054\u3068\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f <code>id<\/code> \u3092 <code>tool_call_id<\/code> \u306b\u5fc5\u305a\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002\u3053\u308c\u304c\u4e00\u81f4\u3057\u306a\u3044\u3068\u30e2\u30c7\u30eb\u306f\u7d50\u679c\u3092\u7d10\u3065\u3051\u3089\u308c\u307e\u305b\u3093\u3002<\/li>\n<li><strong>\u8907\u6570\u547c\u3073\u51fa\u3057\uff08parallel tool calls\uff09<\/strong>: <code>msg.tool_calls<\/code> \u306f\u914d\u5217\u3067\u3059\u3002\u30e2\u30c7\u30eb\u304c\u4e00\u5ea6\u306b\u8907\u6570\u306e\u95a2\u6570\u547c\u3073\u51fa\u3057\u3092\u8981\u6c42\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u305f\u3081\u3001<strong>\u5fc5\u305a\u30eb\u30fc\u30d7\u3067\u5168\u4ef6\u51e6\u7406<\/strong>\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<h2>\u5f15\u6570\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u5fd8\u308c\u306a\u3044<\/h2>\n<p><code>tool_call.function.arguments<\/code> \u306f<strong>\u30e2\u30c7\u30eb\u304c\u751f\u6210\u3057\u305f\u6587\u5b57\u5217<\/strong>\u3067\u3059\u3002\u30b9\u30ad\u30fc\u30de\u306b\u6cbf\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u304c\u3001100% \u4fdd\u8a3c\u3055\u308c\u307e\u305b\u3093\u3002\u5b9f\u884c\u524d\u306b\u691c\u8a3c\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true\">fn_args = json.loads(tool_call.function.arguments)\n\nif \"city\" not in fn_args:\n    result = json.dumps({\"error\": \"city is required\"})\nelse:\n    result = available_functions[fn_name](**fn_args)<\/pre>\n<p>\u30a8\u30e9\u30fc\u3082 <code>role=\"tool\"<\/code> \u3067\u7d20\u76f4\u306b\u8fd4\u3059\u3068\u3001\u30e2\u30c7\u30eb\u304c\u300c\u5f15\u6570\u304c\u8db3\u308a\u306a\u304b\u3063\u305f\u300d\u3068\u7406\u89e3\u3057\u3066\u805e\u304d\u76f4\u3057\u305f\u308a\u81ea\u5df1\u4fee\u6b63\u3057\u305f\u308a\u3057\u307e\u3059\u3002\u4f8b\u5916\u3067\u63e1\u308a\u3064\u3076\u3059\u3088\u308a\u3001<strong>\u30a8\u30e9\u30fc\u3092\u7d50\u679c\u3068\u3057\u3066\u30e2\u30c7\u30eb\u306b\u623b\u3059<\/strong>\u307b\u3046\u304c\u4f1a\u8a71\u304c\u7834\u7dbb\u3057\u307e\u305b\u3093\u3002<\/p>\n<h2>\u78ba\u8a8d\u65b9\u6cd5<\/h2>\n<ol>\n<li>\u4e0a\u8a18\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3001\u300c\u6771\u4eac\u306e\u5929\u6c17\u3092\u6559\u3048\u3066\u300d\u3067\u6700\u7d42\u56de\u7b54\u306b\u6c17\u6e29\u304c\u542b\u307e\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li><code>tool_choice=\"auto\"<\/code> \u306e\u307e\u307e\u300c\u3053\u3093\u306b\u3061\u306f\u300d\u3068\u3060\u3051\u9001\u308a\u3001<code>msg.tool_calls<\/code> \u304c <code>None<\/code> \u306b\u306a\u308a\u95a2\u6570\u3092\u547c\u3070\u305a\u306b\u901a\u5e38\u5fdc\u7b54\u3059\u308b\uff08\uff1d\u3080\u3084\u307f\u306b\u95a2\u6570\u3092\u547c\u3070\u306a\u3044\uff09\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li>\u308f\u3056\u3068\u5b58\u5728\u3057\u306a\u3044\u90fd\u5e02\u540d\u3092\u805e\u3044\u3066\u3001<code>unknown<\/code> \u3092\u53d7\u3051\u305f\u30e2\u30c7\u30eb\u304c\u300c\u30c7\u30fc\u30bf\u304c\u306a\u3044\u300d\u65e8\u3092\u81ea\u7136\u6587\u3067\u8fd4\u3059\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<\/ol>\n<p>\u30ed\u30b0\u3067 <code>tool_calls<\/code> \u306e\u4e2d\u8eab\u3092\u51fa\u529b\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\u304c\u3069\u3093\u306a\u5f15\u6570\u3092\u751f\u6210\u3057\u305f\u304b\u8ffd\u3048\u3066\u30c7\u30d0\u30c3\u30b0\u304c\u697d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u6ce8\u610f\u70b9<\/h2>\n<ul>\n<li><strong>\u5b9f\u884c\u306f\u30a2\u30d7\u30ea\u5074\u306e\u8cac\u4efb<\/strong>: \u30e2\u30c7\u30eb\u306f\u300c\u547c\u3079\u300d\u3068\u8a00\u3046\u3060\u3051\u3067\u3059\u3002\u524a\u9664\u30fb\u8ab2\u91d1\u30fb\u5916\u90e8\u9001\u4fe1\u306a\u3069\u526f\u4f5c\u7528\u306e\u3042\u308b\u95a2\u6570\u306f\u3001\u5f15\u6570\u3092\u691c\u8a3c\u3057\u3001\u5fc5\u8981\u306a\u3089\u4eba\u9593\u306e\u627f\u8a8d\u3092\u631f\u3080\u8a2d\u8a08\u306b\u3057\u307e\u3059\u3002\u30e2\u30c7\u30eb\u306e\u51fa\u529b\u3092\u305d\u306e\u307e\u307e\u5371\u967a\u306a\u64cd\u4f5c\u306b\u6d41\u3055\u306a\u3044\u3053\u3068\u3002<\/li>\n<li><strong>\u7121\u9650\u30eb\u30fc\u30d7\u9632\u6b62<\/strong>: \u7d50\u679c\u3092\u8fd4\u3057\u305f\u5f8c\u306b\u30e2\u30c7\u30eb\u304c\u3055\u3089\u306b\u95a2\u6570\u3092\u547c\u3076\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002\u30eb\u30fc\u30d7\u56de\u6570\u306b\u4e0a\u9650\u3092\u8a2d\u3051\u307e\u3057\u3087\u3046\u3002<\/li>\n<li><strong>\u30c8\u30fc\u30af\u30f3\u6d88\u8cbb<\/strong>: \u95a2\u6570\u306e\u5b9f\u884c\u7d50\u679c\u3082\u5c65\u6b74\u306b\u7a4d\u307e\u308c\u308b\u305f\u3081\u3001\u5927\u304d\u306a JSON \u3092\u4e38\u3054\u3068\u8fd4\u3059\u3068\u30c8\u30fc\u30af\u30f3\u3092\u98df\u3044\u307e\u3059\u3002\u5fc5\u8981\u306a\u9805\u76ee\u3060\u3051\u8fd4\u3059\u306e\u304c\u7121\u96e3\u3067\u3059\u3002<\/li>\n<li><strong>\u30b9\u30ad\u30fc\u30de\u306e <code>description<\/code> \u304c\u547d<\/strong>: \u95a2\u6570\u3092\u547c\u3076\/\u547c\u3070\u306a\u3044\u306e\u7cbe\u5ea6\u306f description \u306e\u8cea\u306b\u5927\u304d\u304f\u4f9d\u5b58\u3057\u307e\u3059\u3002\u66d6\u6627\u3060\u3068\u8aa4\u547c\u3073\u51fa\u3057\u3084\u547c\u3073\u5fd8\u308c\u304c\u8d77\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Function Calling \u306f\u300c\u30e2\u30c7\u30eb\u306b\u95a2\u6570\u3092\u5b9f\u884c\u3055\u305b\u308b\u6a5f\u80fd\u300d\u3067\u306f\u306a\u304f\u3001\u300c<strong>\u30e2\u30c7\u30eb\u306b\u3001\u3069\u306e\u95a2\u6570\u3092\u3069\u306e\u5f15\u6570\u3067\u547c\u3076\u3079\u304d\u304b\u3092\u5224\u65ad\u3055\u305b\u3001\u5b9f\u884c\u306f\u30a2\u30d7\u30ea\u5074\u3067\u884c\u3044\u3001\u7d50\u679c\u3092\u8fd4\u3057\u3066\u6700\u7d42\u56de\u7b54\u3092\u4f5c\u308b<\/strong>\u300d\u3068\u3044\u3046\u5354\u8abf\u30eb\u30fc\u30d7\u3067\u3059\u3002\u8981\u70b9\u306f3\u3064\u3002<\/p>\n<ol>\n<li>\u30c4\u30fc\u30eb\u306e\u30b9\u30ad\u30fc\u30de\u306f\u81ea\u7136\u8a00\u8a9e\u306e <code>description<\/code> \u3092\u4e01\u5be7\u306b\u66f8\u304f<\/li>\n<li><code>tool_calls<\/code> \u306f\u914d\u5217\u306a\u306e\u3067\u5168\u4ef6\u30eb\u30fc\u30d7\u3057\u3001<code>tool_call_id<\/code> \u3067\u7d50\u679c\u3092\u5bfe\u5fdc\u4ed8\u3051\u308b<\/li>\n<li>\u5f15\u6570\u691c\u8a3c\u3068\u526f\u4f5c\u7528\u306e\u5236\u5fa1\u306f\u30a2\u30d7\u30ea\u5074\u306e\u8cac\u4efb\u3067\u884c\u3046<\/li>\n<\/ol>\n<p>\u3053\u306e\u57fa\u672c\u30eb\u30fc\u30d7\u3092\u62bc\u3055\u3048\u308c\u3070\u3001\u5929\u6c17 API \u306b\u9650\u3089\u305a\u3001\u691c\u7d22\u30fbDB \u53c2\u7167\u30fb\u793e\u5185\u30b7\u30b9\u30c6\u30e0\u9023\u643a\u306a\u3069\u3001\u3042\u3089\u3086\u308b\u5916\u90e8\u30c4\u30fc\u30eb\u3092 LLM \u306b\u63a5\u7d9a\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LLM \u306f\u5b66\u7fd2\u6e08\u307f\u306e\u77e5\u8b58\u3067\u6587\u7ae0\u3092\u751f\u6210\u3059\u308b\u306e\u306f\u5f97\u610f\u3067\u3059\u304c\u3001\u300c\u4eca\u65e5\u306e\u5929\u6c17\u300d\u300c\u793e\u5185 DB \u306e\u5728\u5eab\u6570\u300d\u300c\u5916\u90e8 API \u306e\u5b9f\u884c\u7d50\u679c\u300d\u3068\u3044\u3063\u305f\u3001\u30e2\u30c7\u30eb\u306e\u5916\u5074\u306b\u3042\u308b\u6700\u65b0\u30fb\u56fa\u6709\u306e\u60c5\u5831\u306f\u77e5\u308a\u307e\u305b\u3093\u3002\u3053\u306e\u9699\u9593\u3092\u57cb\u3081\u308b\u4ed5\u7d44\u307f\u304c Function Calling\uff08\u2026<\/p>\n","protected":false},"author":1,"featured_media":3513,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1163],"tags":[64,742],"class_list":["post-3514","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","tag-api","tag-function"],"veu_head_title_object":{"title":"","add_site_title":""},"jetpack_publicize_connections":[],"jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/qol-kk.com\/wp2\/wp-content\/uploads\/2026\/10\/20261011-plan077-thumbnail.jpg","_links":{"self":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/comments?post=3514"}],"version-history":[{"count":1,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3514\/revisions"}],"predecessor-version":[{"id":3559,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/posts\/3514\/revisions\/3559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media\/3513"}],"wp:attachment":[{"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/media?parent=3514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/categories?post=3514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qol-kk.com\/wp2\/wp-json\/wp\/v2\/tags?post=3514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}