{"id":4288,"date":"2026-01-09T18:45:49","date_gmt":"2026-01-09T15:45:49","guid":{"rendered":"https:\/\/demensdeum.com\/blog\/2026\/01\/09\/ollama-call\/"},"modified":"2026-01-09T18:58:33","modified_gmt":"2026-01-09T15:58:33","slug":"ollama-call","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/ja\/2026\/01\/09\/ollama-call\/","title":{"rendered":"\u30aa\u30e9\u30de\u30b3\u30fc\u30eb"},"content":{"rendered":"<p><strong>Ollama<\/strong> \u3092\u4f7f\u7528\u3057\u3066\u3044\u3066\u3001\u6bce\u56de\u72ec\u81ea\u306e API \u30e9\u30c3\u30d1\u30fc\u3092\u4f5c\u6210\u3057\u305f\u304f\u306a\u3044\u5834\u5408\u306f\u3001<br \/>\n<strong>ollama_call<\/strong> \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3088\u308a\u3001\u4f5c\u696d\u304c\u5927\u5e45\u306b\u7c21\u7d20\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u30011 \u3064\u306e\u95a2\u6570\u3067\u30ed\u30fc\u30ab\u30eb LLM \u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3067\u304d\u308b\u5c0f\u3055\u306a Python \u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<br \/>\nJSON \u5f62\u5f0f\u306a\u3069\u306e\u5fdc\u7b54\u3092\u3059\u3050\u306b\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>pip install ollama-call\n<\/code><\/pre>\n<\/div>\n<h3>\u306a\u305c\u5fc5\u8981\u306a\u306e\u304b<\/h3>\n<ul>\n<li>\u30e2\u30c7\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u6700\u5c0f\u9650\u306e\u30b3\u30fc\u30c9;<\/li>\n<li>\u3055\u3089\u306a\u308b\u51e6\u7406\u306e\u305f\u3081\u306e\u69cb\u9020\u5316\u3055\u308c\u305f JSON \u30ec\u30b9\u30dd\u30f3\u30b9;<\/li>\n<li>\u30e9\u30d4\u30c3\u30c9\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u3084 MVP \u306b\u4fbf\u5229\u3067\u3059\u3002<\/li>\n<li>\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u51fa\u529b\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<h3>\u4f7f\u7528\u4f8b<\/h3>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-unknown\" data-lang=\"unknown\"><code>from ollama_call import ollama_call\n\nresponse = ollama_call(\n    user_prompt=\"Hello, how are you?\",\n    format=\"json\",\n    model=\"gemma3:12b\"\n)\n\nprint(response)\n<\/code><\/pre>\n<\/div>\n<h3>\u7279\u306b\u5f79\u7acb\u3064\u5834\u5408<\/h3>\n<ul>\n<li>Ollama \u4e0a\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u307e\u305f\u306f\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n<li>\u4e88\u6e2c\u53ef\u80fd\u306a\u5fdc\u7b54\u5f62\u5f0f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n<li>\u91cd\u3044\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u63a5\u7d9a\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n<\/ul>\n<h3>\u5408\u8a08<\/h3>\n<p>ollama_call \u306f\u3001Python \u304b\u3089 Ollama \u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u8efd\u91cf\u3067\u660e\u78ba\u306a\u30e9\u30c3\u30d1\u30fc\u3067\u3059\u3002<br \/>\n\u30b7\u30f3\u30d7\u30eb\u3055\u3068\u8fc5\u901f\u306a\u7d50\u679c\u304c\u91cd\u8981\u306a\u5834\u5408\u306b\u9069\u3057\u305f\u9078\u629e\u3067\u3059\u3002<\/p>\n<p>GitHub<br \/>\n<a href=\"https:\/\/github.com\/demensdeum\/ollama_call\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/demensdeum\/ollama_call<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ollama \u3092\u4f7f\u7528\u3057\u3066\u3044\u3066\u3001\u6bce\u56de\u72ec\u81ea\u306e API \u30e9\u30c3\u30d1\u30fc\u3092\u4f5c\u6210\u3057\u305f\u304f\u306a\u3044\u5834\u5408\u306f\u3001 ollama_call \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u3088\u308a\u3001\u4f5c\u696d\u304c\u5927\u5e45\u306b\u7c21\u7d20\u5316\u3055\u308c\u307e\u3059\u3002 \u3053\u308c\u306f\u30011 \u3064\u306e\u95a2\u6570\u3067\u30ed\u30fc\u30ab\u30eb LLM \u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3067\u304d\u308b\u5c0f\u3055\u306a Python \u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002 JSON \u5f62\u5f0f\u306a\u3069\u306e\u5fdc\u7b54\u3092\u3059\u3050\u306b\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb pip install ollama-call \u306a\u305c\u5fc5\u8981\u306a\u306e\u304b \u30e2\u30c7\u30eb\u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u6700\u5c0f\u9650\u306e\u30b3\u30fc\u30c9; \u3055\u3089\u306a\u308b\u51e6\u7406\u306e\u305f\u3081\u306e\u69cb\u9020\u5316\u3055\u308c\u305f JSON \u30ec\u30b9\u30dd\u30f3\u30b9; \u30e9\u30d4\u30c3\u30c9\u30d7\u30ed\u30c8\u30bf\u30a4\u30d7\u3084 MVP \u306b\u4fbf\u5229\u3067\u3059\u3002 \u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u51fa\u529b\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002 \u4f7f\u7528\u4f8b from ollama_call import ollama_call response = ollama_call( user_prompt=&#8221;Hello, how are you?&#8221;, format=&#8221;json&#8221;, model=&#8221;gemma3:12b&#8221; ) print(response) \u7279\u306b\u5f79\u7acb\u3064\u5834\u5408 Ollama \u4e0a\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u307e\u305f\u306f\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u4e88\u6e2c\u53ef\u80fd\u306a\u5fdc\u7b54\u5f62\u5f0f\u304c\u5fc5\u8981\u3067\u3059\u3002 \u91cd\u3044\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u63a5\u7d9a\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u5408\u8a08 ollama_call \u306f\u3001Python \u304b\u3089 Ollama \u3092\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u8efd\u91cf\u3067\u660e\u78ba\u306a\u30e9\u30c3\u30d1\u30fc\u3067\u3059\u3002 \u30b7\u30f3\u30d7\u30eb\u3055\u3068\u8fc5\u901f\u306a\u7d50\u679c\u304c\u91cd\u8981\u306a\u5834\u5408\u306b\u9069\u3057\u305f\u9078\u629e\u3067\u3059\u3002<a class=\"more-link\" href=\"https:\/\/demensdeum.com\/blog\/ja\/2026\/01\/09\/ollama-call\/\">Continue reading <span class=\"screen-reader-text\">&#8220;\u30aa\u30e9\u30de\u30b3\u30fc\u30eb&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[61],"tags":[],"class_list":["post-4288","post","type-post","status-publish","format-standard","hentry","category-techie","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"ja","enabled_languages":["en","ru","zh","de","fr","ja","pt"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"ru":{"title":true,"content":true,"excerpt":false},"zh":{"title":true,"content":true,"excerpt":false},"de":{"title":true,"content":true,"excerpt":false},"fr":{"title":true,"content":true,"excerpt":false},"ja":{"title":true,"content":true,"excerpt":false},"pt":{"title":true,"content":true,"excerpt":false}}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/4288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/comments?post=4288"}],"version-history":[{"count":1,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/4288\/revisions"}],"predecessor-version":[{"id":4289,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/posts\/4288\/revisions\/4289"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/media?parent=4288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/categories?post=4288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/ja\/wp-json\/wp\/v2\/tags?post=4288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}