Skip to main content

evaluate_answer_gating_with_energy

Function evaluate_answer_gating_with_energy 

Source
pub fn evaluate_answer_gating_with_energy(
    answer: &Answer,
    question_id: Option<&str>,
    question: Option<&Question>,
    config: &GatingConfig,
    energy: Option<f64>,
) -> GatingMetadata
Expand description

単一の Answer に対し、自由エネルギー情報を含めて確信度ゲーティング評価を実施し、メタデータを生成する。

§概要

  • 通常の確信度・マージン判定に先立ち、Energy-based OOD 安全弁 (Circuit Breaker) を評価する。
  • Choice 型において正規化自由エネルギー $E_{\text{norm}}$ が config.energy_threshold を超過した場合、 高確信度判定をショートサーキットし、強制的に DecisionRoute::Fallback へ降格する。

§引数

  • answer: 事後較正済みの判定結果。
  • question_id: 質問識別子(プロンプト構築用、任意)。
  • question: 質問定義(指示文やタイプ取得用、任意)。
  • config: ゲーティング設定。
  • energy: 算出された正規化自由エネルギー値 (任意)。

§戻り値

  • 導出された GatingMetadata。