{"id":33,"date":"2026-03-05T16:52:28","date_gmt":"2026-03-05T16:52:28","guid":{"rendered":"https:\/\/blog.rebalai.com\/ja\/2026\/03\/05\/ai-pipeline-lessons-2\/"},"modified":"2026-03-07T01:08:51","modified_gmt":"2026-03-07T01:08:51","slug":"ai-pipeline-lessons-2","status":"publish","type":"post","link":"https:\/\/blog.rebalai.com\/ja\/2026\/03\/05\/ai-pipeline-lessons-2\/","title":{"rendered":"\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3AI\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u69cb\u7bc9: 1\u4e07\u56de\u4ee5\u4e0a\u306e\u5b9f\u884c\u304b\u3089\u5b66\u3093\u3060\u6559\u8a13"},"content":{"rendered":"<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"BlogPosting\",\n  \"headline\": \"\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3AI\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u69cb\u7bc9: 1\u4e07\u56de\u4ee5\u4e0a\u306e\u5b9f\u884c\u304b\u3089\u5b66\u3093\u3060\u6559\u8a13\",\n  \"description\": \"\u53bb\u5e74\u306e11\u6708\u3001Slack\u306b\u901a\u77e5\u304c\u98db\u3093\u3067\u304d\u305f\u3002\u300c\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u8981\u7d04\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u304c2\u6642\u9593\u6b62\u307e\u3063\u3066\u308b\u300d\u3002\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3001\u30ed\u30b0\u306f\u307b\u307c\u7a7a\u3002\u30a8\u30e9\u30fc\u3082\u51fa\u3066\u3044\u306a\u3044\u3002\u305f\u3060\u9759\u304b\u306b\u3001\u4f55\u3082\u51e6\u7406\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u3002 \u539f\u56e0\u3092\u8ffd\u3046\u306e\u306b3\u6642\u9593\u304b\u304b\u3063\u305f\u3002OpenAI\u306e\u30ec\u30fc\u30c8\u5236\u9650\u306b\u9759\u304b\u306b\u5f15\u3063\u304b\u304b\u3063\u3066\u3044\u3066\u3001\u30ea\u30c8\u30e9\u30a4\u30ed\u30b8\u30c3\u30af\u304c\u4e8b\u5b9f\u4e0a\u306e\u7121\u9650\u30eb\u30fc\u30d7\u306b\u8fd1\u3044\u72b6\",\n  \"url\": \"https:\/\/blog.rebalai.com\/ja\/2026\/03\/05\/ai-pipeline-lessons-2\/\",\n  \"datePublished\": \"2026-03-05T16:52:28\",\n  \"dateModified\": \"2026-03-05T17:39:37\",\n  \"inLanguage\": \"ja_JP\",\n  \"author\": {\n    \"@type\": \"Organization\",\n    \"name\": \"RebalAI\",\n    \"url\": \"https:\/\/blog.rebalai.com\/ja\/\"\n  },\n  \"publisher\": {\n    \"@type\": \"Organization\",\n    \"name\": \"RebalAI\",\n    \"logo\": {\n      \"@type\": \"ImageObject\",\n      \"url\": \"https:\/\/blog.rebalai.com\/wp-content\/uploads\/logo.png\"\n    }\n  },\n  \"mainEntityOfPage\": {\n    \"@type\": \"WebPage\",\n    \"@id\": \"https:\/\/blog.rebalai.com\/ja\/2026\/03\/05\/ai-pipeline-lessons-2\/\"\n  }\n}\n<\/script><\/p>\n<p>\u53bb\u5e74\u306e11\u6708\u3001Slack\u306b\u901a\u77e5\u304c\u98db\u3093\u3067\u304d\u305f\u3002\u300c\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u8981\u7d04\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u304c2\u6642\u9593\u6b62\u307e\u3063\u3066\u308b\u300d\u3002\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3001\u30ed\u30b0\u306f\u307b\u307c\u7a7a\u3002\u30a8\u30e9\u30fc\u3082\u51fa\u3066\u3044\u306a\u3044\u3002\u305f\u3060\u9759\u304b\u306b\u3001\u4f55\u3082\u51e6\u7406\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u3002<\/p>\n<p>\u539f\u56e0\u3092\u8ffd\u3046\u306e\u306b3\u6642\u9593\u304b\u304b\u3063\u305f\u3002OpenAI\u306e\u30ec\u30fc\u30c8\u5236\u9650\u306b\u9759\u304b\u306b\u5f15\u3063\u304b\u304b\u3063\u3066\u3044\u3066\u3001\u30ea\u30c8\u30e9\u30a4\u30ed\u30b8\u30c3\u30af\u304c\u4e8b\u5b9f\u4e0a\u306e\u7121\u9650\u30eb\u30fc\u30d7\u306b\u8fd1\u3044\u72b6\u614b\u306b\u306a\u3063\u3066\u3044\u305f\u3002\u30b3\u30b9\u30c8\u3082\u305d\u306e\u9593\u305a\u3063\u3068\u7a4d\u307f\u4e0a\u304c\u3063\u3066\u3044\u305f\u3002<\/p>\n<p>\u3042\u306e\u65e5\u4ee5\u6765\u3001\u79c1\u306fAI\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306e\u300c\u306a\u3093\u3068\u306a\u304f\u52d5\u3044\u3066\u308b\u300d\u3068\u3044\u3046\u611f\u899a\u3092\u4e00\u5207\u4fe1\u7528\u3057\u306a\u304f\u306a\u3063\u305f\u3002<\/p>\n<h2>\u30ed\u30b0\u3092\u5165\u308c\u308b\u307e\u3067\u3001\u4f55\u3082\u898b\u3048\u3066\u3044\u306a\u304b\u3063\u305f<\/h2>\n<p>\u6700\u521d\u306e3\u30f6\u6708\u3001\u79c1\u305f\u3061\u306e\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306f\u307b\u307c\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3060\u3063\u305f\u3002\u5165\u529b\u3092\u6295\u3052\u3066\u3001\u51fa\u529b\u304c\u8fd4\u3063\u3066\u304f\u308b\u3002\u305d\u308c\u3060\u3051\u3002\u3067\u30821\u65e5\u3042\u305f\u308a\u6570\u767e\u56de\u306e\u5b9f\u884c\u304c\u6570\u5343\u56de\u306b\u306a\u3063\u305f\u3068\u304d\u3001\u300c\u306a\u3093\u304b\u9045\u3044\u300d\u300c\u305f\u307e\u306b\u5909\u306a\u51fa\u529b\u304c\u51fa\u308b\u300d\u3068\u3044\u3046\u5831\u544a\u304c\u5897\u3048\u59cb\u3081\u305f\u3002<\/p>\n<p>\u518d\u73fe\u3067\u304d\u306a\u3044\u3002\u30ed\u30b0\u304c\u306a\u3044\u304b\u3089\u3002<\/p>\n<p>LangSmith\uff080.1\u7cfb\u304c\u51fa\u305f\u9803\uff09\u3092\u5165\u308c\u3066\u307f\u3066\u3001\u521d\u3081\u3066\u5b9f\u969b\u306e\u6319\u52d5\u304c\u898b\u3048\u305f\u3002\u7279\u5b9a\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30bf\u30a4\u30d7\u3067\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u30c8\u30fc\u30af\u30f3\u6570\u304c\u8df3\u306d\u4e0a\u304c\u3063\u3066\u3044\u308b\u3053\u3068\u3001\u30ea\u30c8\u30e9\u30a4\u304c\u767a\u751f\u3057\u3066\u3044\u308b\u306e\u306b\u6210\u529f\u6271\u3044\u306b\u306a\u3063\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3053\u3068\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306e\u5206\u5e03\u304c\u601d\u3063\u3066\u3044\u305f\u3088\u308a\u4e8c\u5cf0\u6027\u3060\u3063\u305f\u3053\u3068\u2014\u2014\u5168\u90e8\u3001\u3061\u3083\u3093\u3068\u3057\u305f\u30c8\u30ec\u30fc\u30b7\u30f3\u30b0\u3092\u5165\u308c\u3066\u521d\u3081\u3066\u308f\u304b\u3063\u305f\u3002<\/p>\n<p>\u6b63\u76f4\u3001LangSmith\u306f\u79c1\u306e\u74b0\u5883\uff08\u5c0f\u3055\u306a\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3001\u30a8\u30f3\u30b8\u30cb\u30a25\u4eba\uff09\u3067\u306f\u30b3\u30b9\u30c8\u304c\u30cd\u30c3\u30af\u306b\u306a\u3063\u3066\u304d\u305f\u306e\u3067\u3001\u4eca\u306f<a href=\"https:\/\/langfuse.com\">Langfuse<\/a>\u3092\u30bb\u30eb\u30d5\u30db\u30b9\u30c8\u3057\u3066\u3044\u308b\u3002\u6a5f\u80fd\u7684\u306b\u306fLangSmith\u3068\u307b\u307c\u540c\u7b49\u3067\u3001\u30c7\u30fc\u30bf\u304c\u624b\u5143\u306b\u7f6e\u3051\u308b\u306e\u3082\u5b89\u5fc3\u611f\u304c\u3042\u308b\u3002\u305f\u3060\u30bb\u30eb\u30d5\u30db\u30b9\u30c8\u306e\u30e1\u30f3\u30c6\u30b3\u30b9\u30c8\u306f\u7121\u8996\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u30c1\u30fc\u30e0\u306e\u72b6\u6cc1\u6b21\u7b2c\u3060\u3068\u601d\u3046\u3002<\/p>\n<p>\u3053\u3053\u304c\u91cd\u8981\u306a\u3093\u3060\u304c: LLM\u306e\u547c\u3073\u51fa\u3057\u3092\u5358\u306a\u308bAPI\u30b3\u30fc\u30eb\u3068\u3057\u3066\u6271\u308f\u306a\u3044\u3053\u3068\u3002\u5165\u529b\u30c8\u30fc\u30af\u30f3\u6570\u3001\u51fa\u529b\u30c8\u30fc\u30af\u30f3\u6570\u3001\u30ec\u30a4\u30c6\u30f3\u30b7\u3001\u30e2\u30c7\u30eb\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3001<code>finish_reason<\/code>\u2014\u2014\u3053\u308c\u3092\u5168\u90e8\u8a18\u9332\u3059\u308b\u3002\u300c\u5f8c\u3067\u3044\u3044\u3084\u300d\u3068\u601d\u3046\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u30c7\u30d0\u30c3\u30b0\u3067\u7d76\u5bfe\u5f8c\u6094\u3059\u308b\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u79c1\u304c\u5165\u308c\u3066\u3044\u308b\u306e\u306f\u3053\u3046\u3044\u3046\u30e9\u30c3\u30d1\u30fc\u3060:<\/p>\n<pre><code class=\"language-python\">import time\nimport logging\nfrom openai import OpenAI, RateLimitError, APITimeoutError, BadRequestError\nfrom dataclasses import dataclass\nfrom typing import Optional\n\nlogger = logging.getLogger(__name__)\nclient = OpenAI()\n\n@dataclass\nclass LLMResult:\n    content: str\n    input_tokens: int\n    output_tokens: int\n    latency_ms: float\n    finish_reason: str\n    model: str  # \u5b9f\u969b\u306b\u4f7f\u308f\u308c\u305f\u30e2\u30c7\u30eb\u3092\u8a18\u9332\uff08\u81ea\u52d5\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af\u304c\u3042\u308b\u5834\u5408\u306b\u91cd\u8981\uff09\n\ndef call_with_observability(\n    messages: list,\n    model: str = &quot;gpt-4o&quot;,\n    max_retries: int = 3,\n    request_id: Optional[str] = None,\n) -&gt; LLMResult:\n    &quot;&quot;&quot;\n    \u30a8\u30e9\u30fc\u30bf\u30a4\u30d7\u3092\u533a\u5225\u3057\u306a\u304c\u3089\u30ea\u30c8\u30e9\u30a4\u3002\n    RateLimit\u3068Timeout\u306f\u518d\u8a66\u884c\u3001BadRequest\uff08\u30b3\u30f3\u30c6\u30f3\u30c4\u30dd\u30ea\u30b7\u30fc\u7b49\uff09\u306f\u5373\u5ea7\u306b\u5931\u6557\u3055\u305b\u308b\u3002\n    &quot;&quot;&quot;\n    attempt = 0\n    while attempt &lt; max_retries:\n        start = time.monotonic()\n        try:\n            response = client.chat.completions.create(model=model, messages=messages)\n            latency_ms = (time.monotonic() - start) * 1000\n\n            result = LLMResult(\n                content=response.choices[0].message.content,\n                input_tokens=response.usage.prompt_tokens,\n                output_tokens=response.usage.completion_tokens,\n                latency_ms=latency_ms,\n                finish_reason=response.choices[0].finish_reason,\n                model=response.model,\n            )\n            _log_to_trace(request_id, result, messages)  # \u81ea\u524d\u306e\u30c8\u30ec\u30fc\u30b7\u30f3\u30b0\u306b\u9001\u308b\n            return result\n\n        except RateLimitError as e:\n            wait = 2 ** attempt  # \u6307\u6570\u30d0\u30c3\u30af\u30aa\u30d5\n            logger.warning(f&quot;RateLimit hit (attempt {attempt+1}), waiting {wait}s&quot;)\n            time.sleep(wait)\n            attempt += 1\n\n        except APITimeoutError:\n            logger.warning(f&quot;Timeout (attempt {attempt+1})&quot;)\n            attempt += 1\n\n        except BadRequestError as e:\n            # \u30b3\u30f3\u30c6\u30f3\u30c4\u30dd\u30ea\u30b7\u30fc\u9055\u53cd\u306a\u3069\u306f\u30ea\u30c8\u30e9\u30a4\u3057\u3066\u3082\u7121\u99c4\u2014\u2014\u5373\u5ea7\u306b\u4e0a\u4f4d\u306b\u6295\u3052\u308b\n            logger.error(f&quot;BadRequest \u2014 \u30ea\u30c8\u30e9\u30a4\u4e0d\u53ef: {e}&quot;, extra={&quot;request_id&quot;: request_id})\n            raise\n\n    raise RuntimeError(f&quot;LLM call failed after {max_retries} attempts&quot;)\n<\/code><\/pre>\n<p>\u30dd\u30a4\u30f3\u30c8\u306f<code>finish_reason<\/code>\u3092\u898b\u308b\u3053\u3068\u3002<code>length<\/code>\u3067\u7d42\u308f\u3063\u3066\u3044\u305f\u3089\u51fa\u529b\u304c\u5207\u308a\u6368\u3066\u3089\u308c\u3066\u3044\u308b\u2014\u2014\u3053\u308c\u306b\u6c17\u3065\u304b\u305a\u300cAI\u306e\u51fa\u529b\u304c\u304a\u304b\u3057\u3044\u300d\u3068\u534a\u65e5\u60a9\u3093\u3060\u3053\u3068\u304c\u3042\u308b\u3002<code>stop<\/code>\u4ee5\u5916\u304c\u8fd4\u3063\u3066\u304d\u305f\u3089\u3001\u305d\u308c\u306f\u6b63\u5e38\u3067\u306f\u306a\u3044\u3002<\/p>\n<h2>LLM\u7279\u6709\u306e\u5931\u6557\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u666e\u901a\u306eAPI\u3068\u5168\u7136\u9055\u3046<\/h2>\n<p>Web\u30a2\u30d7\u30ea\u30928\u5e74\u4f5c\u3063\u3066\u304d\u3066\u3001API\u969c\u5bb3\u3078\u306e\u5bfe\u51e6\u306b\u306f\u6163\u308c\u3066\u3044\u305f\u3064\u3082\u308a\u3060\u3063\u305f\u3002\u3067\u3082LLM\u306f\u5225\u7269\u3060\u3068\u75db\u611f\u3057\u305f\u3002<\/p>\n<p>\u666e\u901a\u306eAPI\u306a\u3089\u300c500\u304c\u8fd4\u3063\u305f\u3089\u30ea\u30c8\u30e9\u30a4\u300d\u3067\u3060\u3044\u305f\u3044\u6e08\u3080\u3002LLM\u306e\u5834\u5408\u3001\u30a8\u30e9\u30fc\u306e\u7a2e\u985e\u306b\u3088\u3063\u3066\u5bfe\u51e6\u304c\u6839\u672c\u7684\u306b\u9055\u3046:<\/p>\n<ul>\n<li><strong>\u30ec\u30fc\u30c8\u5236\u9650<\/strong>: \u5f85\u3066\u3070\u6cbb\u308b\u3002\u6307\u6570\u30d0\u30c3\u30af\u30aa\u30d5\u3067\u5341\u5206\u3002<\/li>\n<li><strong>\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8<\/strong>: \u9577\u3044\u30d7\u30ed\u30f3\u30d7\u30c8\u3084<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean \u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d0\u30fc\" rel=\"nofollow sponsored\" target=\"_blank\">\u30b5\u30fc\u30d0\u30fc<\/a>\u6df7\u96d1\u304c\u539f\u56e0\u3002\u30ea\u30c8\u30e9\u30a4\u3057\u3066\u3044\u3044\u304c\u56de\u6570\u306b\u4e0a\u9650\u3092\u3002<\/li>\n<li><strong>\u30b3\u30f3\u30c6\u30f3\u30c4\u30dd\u30ea\u30b7\u30fc\u9055\u53cd<\/strong>: \u5165\u529b\u306b\u554f\u984c\u304c\u3042\u308b\u3002\u4f55\u5ea6\u30ea\u30c8\u30e9\u30a4\u3057\u3066\u3082\u540c\u3058\u3002\u5373\u5ea7\u306b\u5931\u6557\u3055\u305b\u3066\u30ed\u30b0\u306b\u6b8b\u3059\u3002<\/li>\n<li><strong>\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u9577\u8d85\u904e<\/strong>: \u30d7\u30ed\u30f3\u30d7\u30c8\u304c\u9577\u3059\u304e\u308b\u3002\u547c\u3073\u51fa\u3059\u524d\u306b\u30c8\u30fc\u30af\u30f3\u6570\u3092<code>tiktoken<\/code>\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u3002<\/li>\n<\/ul>\n<p>\u3067\u3001\u3053\u308c\u3092\u533a\u5225\u3057\u306a\u3044\u3068\u4f55\u304c\u8d77\u304d\u308b\u304b\u3002\u30b3\u30f3\u30c6\u30f3\u30c4\u30dd\u30ea\u30b7\u30fc\u9055\u53cd\u3067\u30ea\u30c8\u30e9\u30a4\u30923\u56de\u7e70\u308a\u8fd4\u3057\u30013\u56de\u5206\u306e\u30b3\u30b9\u30c8\u3092\u7121\u99c4\u306b\u6255\u3046\u3002\u5b9f\u969b\u306b\u3084\u3063\u305f\uff08\u5f8c\u8ff0\u3059\u308b\uff09\u3002<\/p>\n<p>\u3082\u3046\u4e00\u3064\u5384\u4ecb\u306a\u306e\u304c\u3001\u30a8\u30e9\u30fc\u3067\u306f\u306a\u304f\u300c\u58ca\u308c\u305f\u6210\u529f\u300d\u3060\u3002<code>finish_reason: \"content_filter\"<\/code>\u304c\u8fd4\u3063\u3066\u304d\u3066\u3044\u308b\u306e\u306b\u3001<code>choices[0].message.content<\/code>\u304c<code>None<\/code>\u306b\u306a\u3063\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3002\u3053\u308c\u3092\u6b63\u5e38\u30ec\u30b9\u30dd\u30f3\u30b9\u3068\u3057\u3066\u51e6\u7406\u3057\u3066\u3057\u307e\u3046\u3068\u3001<code>None<\/code>\u304c\u3072\u3063\u305d\u308a\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u7a4d\u307f\u4e0a\u304c\u3063\u3066\u3044\u304f\u3002\u660e\u793a\u7684\u306a\u30c1\u30a7\u30c3\u30af\u3092\u5fc5\u305a\u5165\u308c\u308b\u3053\u3068\u3002<\/p>\n<h2>\u30ec\u30fc\u30c8\u5236\u9650\u3068\u30b3\u30b9\u30c8\u3067\u58c1\u306b\u5f53\u305f\u3063\u305f\u8a71<\/h2>\n<p>\u53bb\u5e74\u306e\u590f\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u5897\u3048\u3066\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306e\u5b9f\u884c\u56de\u6570\u304c1\u65e53000\u56de\u3092\u8d85\u3048\u305f\u3042\u305f\u308a\u304b\u3089\u3001OpenAI\u306eTPM\uff08tokens-per-minute\uff09\u5236\u9650\u306b\u5b9a\u671f\u7684\u306b\u5f15\u3063\u304b\u304b\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<p>\u6700\u521d\u306e\u5bfe\u7b56\u306f\u5358\u7d14\u306a\u30ea\u30c8\u30e9\u30a4\u3067\u3001\u3053\u308c\u3067\u3042\u308b\u7a0b\u5ea6\u306f\u89e3\u6d88\u3057\u305f\u3002\u3067\u3082\u6839\u672c\u7684\u306a\u554f\u984c\u306f\u6b8b\u3063\u3066\u3044\u305f\u2014\u2014\u540c\u6642\u5b9f\u884c\u6570\u3092\u5236\u5fa1\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u3002<\/p>\n<p>asyncio\u3067\u4e26\u5217\u5b9f\u884c\u3057\u3066\u3044\u308b\u3068\u304d\u3001\u540c\u6642\u306b50\u30ea\u30af\u30a8\u30b9\u30c8\u6295\u3052\u308c\u3070\u5f53\u7136\u30ec\u30fc\u30c8\u5236\u9650\u306b\u5f15\u3063\u304b\u304b\u308b\u3002<code>asyncio.Semaphore<\/code>\u3067\u540c\u6642\u5b9f\u884c\u6570\u30928\u306b\u7d5e\u3063\u305f\u3089\u3001\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u306f\u307b\u307c\u5909\u308f\u3089\u305a\u306b\u30a8\u30e9\u30fc\u304c\u6fc0\u6e1b\u3057\u305f\u3002\u3053\u306e\u6570\u5b57\u306f\u74b0\u5883\u306b\u3088\u308b\u306e\u3067\u3001\u81ea\u5206\u306eTier\u306e\u5236\u9650\u5024\u3068\u7167\u3089\u3057\u5408\u308f\u305b\u3066\u8abf\u6574\u3057\u3066\u307b\u3057\u3044\u3002<\/p>\n<p>\u30b3\u30b9\u30c8\u9762\u3067\u52b9\u3044\u305f\u306e\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u3060\u3063\u305f\u3002\u79c1\u305f\u3061\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3067\u306f\u3001\u540c\u4e00\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u7570\u306a\u308b\u30e6\u30fc\u30b6\u30fc\u304c\u8981\u6c42\u3059\u308b\u3053\u3068\u304c\u5c11\u306a\u304f\u306a\u304b\u3063\u305f\u3002\u5165\u529b\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u30ad\u30fc\u306b\u3057\u3066Redis\u306b\u7d50\u679c\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u305f\u3068\u3053\u308d\u3001\u6708\u306eAPI\u30b3\u30b9\u30c8\u304c\u7d0430%\u4e0b\u304c\u3063\u305f\u3002<\/p>\n<p>\u305f\u3060\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u306f\u843d\u3068\u3057\u7a74\u304c\u3042\u308b\u3002\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5909\u308f\u3063\u305f\u3068\u304d\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u7121\u52b9\u5316\u3057\u306a\u3044\u3068\u3001\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u51fa\u529b\u3092\u8fd4\u3057\u7d9a\u3051\u308b\u3002\u30ad\u30e3\u30c3\u30b7\u30e5\u30ad\u30fc\u306b\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30cf\u30c3\u30b7\u30e5\u3092\u542b\u3081\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3057\u305f\u304c\u3001\u3053\u308c\u306b\u6c17\u3065\u304f\u307e\u3067\u300c\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u76f4\u3057\u305f\u306f\u305a\u306a\u306e\u306b\u6319\u52d5\u304c\u5909\u308f\u3089\u306a\u3044\u300d\u30681\u9031\u9593\u8fd1\u304f\u60a9\u3093\u3060\u3002<\/p>\n<h2>\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u30b3\u30fc\u30c9\u3068\u3057\u3066\u6271\u3046\u3001\u3068\u3044\u3046\u5f53\u305f\u308a\u524d\u306e\u8a71<\/h2>\n<p><strong>\u3084\u3089\u304b\u3057\u305f\u8a71\u3092\u3059\u308b\u3002<\/strong><\/p>\n<p>\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u306b\u3079\u305f\u66f8\u304d\u3057\u3066\u3044\u305f\u6642\u671f\u3001\u3042\u308b\u300c\u5c0f\u3055\u306a\u6539\u5584\u300d\u3092<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean \u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u74b0\u5883\" rel=\"nofollow sponsored\" target=\"_blank\">\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3<\/a>\u306b\u76f4\u63a5<a href=\"https:\/\/m.do.co\/c\/06956e5e2802\" title=\"DigitalOcean\u3067\u30c7\u30d7\u30ed\u30a4\" rel=\"nofollow sponsored\" target=\"_blank\">\u30c7\u30d7\u30ed\u30a4<\/a>\u3057\u305f\u3002\u51fa\u529b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30e9\u30af\u30b7\u30e7\u30f3\u3092\u5c11\u3057\u5909\u3048\u305f\u3060\u3051\u306e\u3064\u3082\u308a\u304c\u3001\u4e0b\u6d41\u30d1\u30fc\u30b5\u30fc\u304c\u671f\u5f85\u3059\u308bJSON\u306e\u69cb\u9020\u304c\u5fae\u5999\u306b\u5909\u308f\u3063\u3066\u3057\u307e\u3044\u3001\u6570\u767e\u4ef6\u306e\u30ec\u30b3\u30fc\u30c9\u304c\u58ca\u308c\u305f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u4fdd\u5b58\u3055\u308c\u305f\u3002<\/p>\n<p>\u30d0\u30c3\u30af\u30d5\u30a3\u30eb\u306b2\u65e5\u304b\u304b\u3063\u305f\u3002\u30b3\u30f3\u30c6\u30f3\u30c4\u30dd\u30ea\u30b7\u30fc\u9055\u53cd\u3067\u30ea\u30c8\u30e9\u30a4\u3092\u7e70\u308a\u8fd4\u3057\u3066\u3044\u305f\u306e\u3082\u3053\u306e\u6642\u671f\u3067\u3001\u306a\u304b\u306a\u304b\u3057\u3093\u3069\u3044\u9031\u3060\u3063\u305f\u3002<\/p>\n<p>\u305d\u308c\u4ee5\u6765\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u7ba1\u7406\u65b9\u91dd\u3092\u5b8c\u5168\u306b\u5909\u3048\u305f:<\/p>\n<pre><code class=\"language-python\"># prompts\/v2\/document_summary.py\n\nPROMPT_VERSION = &quot;v2.1.0&quot;\n\nSYSTEM_PROMPT = &quot;&quot;&quot;\u3042\u306a\u305f\u306f\u6280\u8853\u6587\u66f8\u306e\u8981\u7d04\u5c02\u9580\u5bb6\u3067\u3059\u3002\n\u4ee5\u4e0b\u306e\u30eb\u30fc\u30eb\u306b\u5f93\u3063\u3066\u8981\u7d04\u3057\u3066\u304f\u3060\u3055\u3044:\n- \u5fc5\u305aJSON\u5f62\u5f0f\u3067\u8fd4\u3059\n- &quot;summary&quot;\u30ad\u30fc\u306b\u65e5\u672c\u8a9e\u306e\u8981\u7d04\uff08200\u5b57\u4ee5\u5185\uff09\n- &quot;key_points&quot;\u30ad\u30fc\u306b\u30ea\u30b9\u30c8\u5f62\u5f0f\u306e\u8981\u70b9\uff083\u301c5\u500b\uff09\n- &quot;confidence&quot;\u30ad\u30fc\u306b\u8981\u7d04\u306e\u78ba\u4fe1\u5ea6\uff080.0\u301c1.0\uff09\n&quot;&quot;&quot;\n\ndef build_prompt(document: str) -&gt; list[dict]:\n    return [\n        {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: SYSTEM_PROMPT},\n        {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: f&quot;\u4ee5\u4e0b\u306e\u6587\u66f8\u3092\u8981\u7d04\u3057\u3066\u304f\u3060\u3055\u3044:\\n\\n{document}&quot;},\n    ]\n\n# \u30ad\u30e3\u30c3\u30b7\u30e5\u30ad\u30fc\u3084\u30c8\u30ec\u30fc\u30b7\u30f3\u30b0\u306b\u4f7f\u3046\nMETADATA = {\n    &quot;version&quot;: PROMPT_VERSION,\n    &quot;model&quot;: &quot;gpt-4o&quot;,\n    &quot;created&quot;: &quot;2026-02-10&quot;,\n    &quot;changelog&quot;: &quot;confidence field\u3092\u8ffd\u52a0\u3001key_points\u306e\u6570\u30923\u301c5\u306b\u5909\u66f4&quot;,\n}\n<\/code><\/pre>\n<p>\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u7ba1\u7406\u3057\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30bb\u30de\u30f3\u30c6\u30a3\u30c3\u30af\u30d0\u30fc\u30b8\u30e7\u30cb\u30f3\u30b0\u3067\u8ffd\u3046\u3002\u5909\u66f4\u306fPR\u3067\u884c\u3044\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u30ad\u30fc\u306b\u3082\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u542b\u3081\u308b\u3002\u300c\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u5909\u3048\u305f\u300d\u3068\u3044\u3046\u4e8b\u5b9f\u304cgit log\u306b\u6b8b\u308b\u306e\u3067\u3001\u4f55\u304b\u58ca\u308c\u305f\u3068\u304d\u306b\u300c\u3042\u306e\u5909\u66f4\u4ee5\u964d\u3060\u306a\u300d\u3068\u3059\u3050\u7279\u5b9a\u3067\u304d\u308b\u3002<\/p>\n<p>Langfuse\u3084PromptLayer\u306e\u3088\u3046\u306a\u30d7\u30ed\u30f3\u30d7\u30c8\u7ba1\u7406\u30c4\u30fc\u30eb\u3082\u8a66\u3057\u305f\u304c\u3001\u79c1\u306e\u30c1\u30fc\u30e0\u306b\u306f\u5c11\u3057\u30aa\u30fc\u30d0\u30fc\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u3060\u3063\u305f\u3002\u30b7\u30f3\u30d7\u30eb\u306b\u30d5\u30a1\u30a4\u30eb\u7ba1\u7406 + git\u3067\u3001\u4eca\u306e\u3068\u3053\u308d\u5341\u5206\u306b\u6a5f\u80fd\u3057\u3066\u3044\u308b\u3002\u30c1\u30fc\u30e0\u304c\u5927\u304d\u304f\u306a\u3063\u305f\u3089\u518d\u691c\u8a0e\u3059\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<p>\u3044\u3044\u304b\u3001A\/B\u30c6\u30b9\u30c8\u3092\u3069\u3046\u3059\u308b\u304b\u3068\u3044\u3046\u554f\u984c\u3082\u3042\u308b\u3002\u4eca\u306e\u3068\u3053\u308d\u3001\u30e6\u30fc\u30b6\u30fcID\u306e\u30cf\u30c3\u30b7\u30e5\u3067\u632f\u308a\u5206\u3051\u3066\u3001\u4e0b\u6d41\u30bf\u30b9\u30af\u306e\u6210\u529f\u7387\u3067\u8a55\u4fa1\u3057\u3066\u3044\u308b\u3002\u81ea\u52d5\u8a55\u4fa1\u306f\u307e\u3060\u3046\u307e\u304f\u6a5f\u80fd\u3057\u3066\u304a\u3089\u305a\u3001\u6700\u7d42\u7684\u306b\u306f\u4eba\u9593\u306e\u30ec\u30d3\u30e5\u30fc\u304c\u5fc5\u8981\u306a\u30b1\u30fc\u30b9\u304c\u591a\u3044\u2014\u2014\u3053\u3053\u306f\u6b63\u76f4\u3001100%\u89e3\u6c7a\u3067\u304d\u3066\u3044\u308b\u3068\u306f\u8a00\u3048\u306a\u3044\u3002<\/p>\n<h2>\u7d50\u5c40\u3001\u79c1\u304c\u5b9f\u969b\u306b\u4f7f\u3063\u3066\u3044\u308b\u69cb\u6210<\/h2>\n<p>1\u4e07\u56de\u4ee5\u4e0a\u306e\u5b9f\u884c\u3092\u7d4c\u305f\u4eca\u306e\u30b9\u30bf\u30c3\u30af\u306f\u3053\u3046\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p><strong>\u30aa\u30fc\u30b1\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong>: LangChain\u306f\u6700\u521d\u5165\u308c\u305f\u304c\u3001\u30d0\u30fc\u30b8\u30e7\u30f3\u9593\u306e\u7834\u58ca\u7684\u5909\u66f4\u306b\u4f55\u5ea6\u3082\u8e0f\u307e\u3055\u308c\u3066\uff080.1\u304b\u30890.2\u306e\u79fb\u884c\u304c\u7279\u306b\u3064\u3089\u304b\u3063\u305f\uff09\u3001\u4eca\u306f\u8584\u3044\u30e9\u30c3\u30d1\u30fc\u3092\u81ea\u4f5c\u3057\u3066\u3044\u308b\u3002\u30c1\u30a7\u30fc\u30f3\u304c\u8907\u96d1\u306b\u306a\u308b\u3068\u30c7\u30d0\u30c3\u30b0\u3082\u96e3\u3057\u304f\u306a\u308b\u3002\u305f\u3060\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u306f\u4eca\u3067\u3082\u60aa\u304f\u306a\u3044\u3068\u601d\u3046\u3002<\/p>\n<p><strong>\u53ef\u89b3\u6e2c\u6027<\/strong>: Langfuse\u3092\u30bb\u30eb\u30d5\u30db\u30b9\u30c8\uff08Docker Compose\uff09\u3002\u30b3\u30b9\u30c8\u7684\u306bLangSmith\u3088\u308a\u73fe\u5b9f\u7684\u3060\u3063\u305f\u3002<\/p>\n<p><strong>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/strong>: \u30a8\u30e9\u30fc\u30bf\u30a4\u30d7\u3054\u3068\u306b\u660e\u793a\u7684\u306b\u5206\u5c90\u3002\u30ea\u30c8\u30e9\u30a4\u306f<code>tenacity<\/code>\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u4fbf\u5229\u2014\u2014\u81ea\u524d\u3067\u66f8\u304f\u3068\u7d30\u304b\u3044\u30d0\u30b0\u304c\u51fa\u308b\u3002<\/p>\n<p><strong>\u30b3\u30b9\u30c8\u7ba1\u7406<\/strong>: \u6708\u6b21\u3067\u30e2\u30c7\u30eb\u5225\u30fb\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u5225\u306e\u30b3\u30b9\u30c8\u3092\u96c6\u8a08\u3057\u3001\u4e88\u7b97\u8d85\u904e\u30a2\u30e9\u30fc\u30c8\u3092Slack\u306b\u6d41\u3057\u3066\u3044\u308b\u3002\u6bce\u6708\u898b\u308b\u3068\u3001\u601d\u308f\u306c\u7b87\u6240\u3067\u30c8\u30fc\u30af\u30f3\u3092\u98df\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u3088\u304f\u3042\u308b\u3002<\/p>\n<p><strong>\u30d7\u30ed\u30f3\u30d7\u30c8\u7ba1\u7406<\/strong>: Git\u3067\u7ba1\u7406\u3001\u30bb\u30de\u30f3\u30c6\u30a3\u30c3\u30af\u30d0\u30fc\u30b8\u30e7\u30cb\u30f3\u30b0\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u30ad\u30fc\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30cf\u30c3\u30b7\u30e5\u3092\u542b\u3081\u308b\u3002<\/p>\n<p>\u3053\u308c\u304c\u5168\u54e1\u306b\u5408\u3046\u69cb\u6210\u3060\u3068\u306f\u601d\u308f\u306a\u3044\u3002\u3067\u3082\u300c\u306a\u3093\u3068\u306a\u304f\u52d5\u3044\u3066\u308b\u6c17\u304c\u3059\u308b\u300d\u304b\u3089\u300c\u3061\u3083\u3093\u3068\u52d5\u3044\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u308b\u300d\u72b6\u614b\u306b\u79fb\u884c\u3057\u305f\u3053\u3068\u3067\u3001\u591c\u4e2d\u306b\u53e9\u304d\u8d77\u3053\u3055\u308c\u308b\u56de\u6570\u306f\u660e\u3089\u304b\u306b\u6e1b\u3063\u305f\u3002<\/p>\n<p>\u4e00\u3064\u3060\u3051\u8a00\u3048\u308b\u3053\u3068: \u53ef\u89b3\u6e2c\u6027\u306f\u5f8c\u56de\u3057\u306b\u3057\u306a\u3044\u3002\u6700\u521d\u306e100\u56de\u306e\u5b9f\u884c\u304b\u3089\u30ed\u30b0\u3092\u53d6\u308c\u3002\u305d\u3046\u3057\u306a\u3044\u3068\u30011\u4e07\u56de\u76ee\u306b\u3084\u3063\u3068\u554f\u984c\u306b\u6c17\u3065\u304f\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53bb\u5e74\u306e11\u6708\u3001Slack\u306b\u901a\u77e5\u304c\u98db\u3093\u3067\u304d\u305f\u3002\u300c\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u8981\u7d04\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u304c2\u6642\u9593\u6b62\u307e\u3063\u3066\u308b\u300d\u3002\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u3001\u30ed\u30b0\u306f\u307b\u307c\u7a7a\u3002\u30a8\u30e9\u30fc\u3082\u51fa\u3066\u3044\u306a\u3044\u3002\u305f\u3060\u9759\u304b\u306b\u3001\u4f55\u3082\u51e6\u7406\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u3002 \u539f\u56e0\u3092\u8ffd\u3046\u306e\u306b3\u6642\u9593\u304b\u304b\u3063\u305f\u3002OpenAI\u306e\u30ec\u30fc\u30c8\u5236\u9650\u306b\u9759\u304b\u306b\u5f15\u3063\u304b\u304b\u3063\u3066\u3044\u3066\u3001\u30ea\u30c8\u30e9\u30a4\u30ed\u30b8\u30c3\u30af\u304c\u4e8b\u5b9f\u4e0a\u306e\u7121\u9650\u30eb\u30fc\u30d7\u306b\u8fd1\u3044\u72b6<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":3,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":86,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/posts\/33\/revisions\/86"}],"wp:attachment":[{"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.rebalai.com\/ja\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}