🚨 03. 例外処理とLLMによる知識注入

Exception Handling and Knowledge Injection with LLM


本節では、従来の制御系では困難だった 例外的状況や未知の事象への対応 について、
LLMを活用して「知識ベース制御」や「意味的補完」を行うアプローチを紹介します。
This section introduces an approach to handling exceptional or unknown situations in control systems by leveraging LLMs for knowledge-based control and semantic augmentation.


🔧 例外処理とは? / What is Exception Handling?


🧠 LLMが担う役割 / Role of LLMs

項目 / Function 内容 / Description
状況理解 / Situation Understanding 自然言語的異常記述を文脈理解
Understands abnormal conditions described in natural language
原因推定 / Cause Estimation 過去知識から原因を推測
Infers possible causes from prior knowledge
対応策提案 / Action Proposal 適切な行動を提案
Suggests appropriate actions
FSM補完 / FSM Integration 例外パスを状態遷移に追加
Adds exception paths to FSM transitions

👉 LLMは 最終判断者ではなく提案者 として扱う点が重要。
👉 It is important to treat the LLM as a proposer, not the final decision-maker.


📘 実装例(LLM利用) / Implementation Example (with LLM)

def handle_exception(observation_text):
    prompt = f"異常が発生しました:{observation_text}。原因と対応策を述べてください。"
    return llm_respond(prompt)  # API または ローカル LLM

入力例 / Input Example

「センサが全く反応しない」「温度が急上昇している」

出力例(LLM) / Output Example (LLM)

「センサ断線の可能性があります。機器を停止し、センサ接続を確認してください。」

💬 FSMへの統合イメージ / FSM Integration Concept


🔒 安全性と制約 / Safety and Constraints


🔚 まとめ / Summary


📁 次へ / Next

📄 04_goal_reasoning.md
Proceed to 04_goal_reasoning.md


⬅️ 02_scenario_control.md
Back to 02_scenario_control.md
🏠 Part 9 トップに戻る
Back to Part 9 Top