pub struct AppState {Show 14 fields
pub engine: Arc<InferenceEngine>,
pub tokenizer: Arc<JevTokenizer>,
pub calib_config: Arc<CalibrationConfig>,
pub coarse_config: CoarseToFineConfig,
pub max_questions_per_request: usize,
pub chunk_size: usize,
pub guardrail_pipeline: GuardrailPipeline,
pub gating_config: GatingConfig,
pub dag_executor: Arc<InProcessDagExecutor>,
pub hierarchical_mapping: Option<Arc<HierarchicalMapping>>,
pub hierarchical_config: HierarchicalRouterConfig,
pub auto_hierarchical: bool,
pub dual_engine: Option<Arc<DualSessionEngine>>,
pub cache_manager: Option<Arc<StateCacheManager>>,
}Expand description
サーバー全体で共有されるアプリケーション状態。
Fields§
§engine: Arc<InferenceEngine>ONNX Runtime 推論エンジン(内部でセッションプールと同期制御を保持)。
tokenizer: Arc<JevTokenizer>Jev 高速トークナイザー。
calib_config: Arc<CalibrationConfig>事後較正温度設定。
coarse_config: CoarseToFineConfig大規模候補数向けの粗密 2 段階探索設定。
max_questions_per_request: usize1 リクエストで許容される最大質問数。
chunk_size: usizeマイクロバッチ分割時のチャンクサイズ。
guardrail_pipeline: GuardrailPipeline前処理ガードレールパイプライン。
gating_config: GatingConfig確信度ゲーティング処理設定。
dag_executor: Arc<InProcessDagExecutor>インプロセス DAG 実行器(反事実・マイクロ決定グラフ向け)。
hierarchical_mapping: Option<Arc<HierarchicalMapping>>大分類・細分類オントロジー定義(存在する場合)。
hierarchical_config: HierarchicalRouterConfig粗密二段階階層ルーティング設定。
auto_hierarchical: bool透過的粗密ルーティングモードの有効フラグ。
dual_engine: Option<Arc<DualSessionEngine>>2 セッション分割型長文推論エンジン (存在する場合)。
cache_manager: Option<Arc<StateCacheManager>>State 中間特徴量キャッシュマネージャー (存在する場合)。
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(
engine: Arc<InferenceEngine>,
tokenizer: Arc<JevTokenizer>,
calib_config: Arc<CalibrationConfig>,
) -> Self
pub fn new( engine: Arc<InferenceEngine>, tokenizer: Arc<JevTokenizer>, calib_config: Arc<CalibrationConfig>, ) -> Self
Sourcepub fn with_options(
engine: Arc<InferenceEngine>,
tokenizer: Arc<JevTokenizer>,
calib_config: Arc<CalibrationConfig>,
coarse_config: CoarseToFineConfig,
max_questions_per_request: usize,
chunk_size: usize,
) -> Self
pub fn with_options( engine: Arc<InferenceEngine>, tokenizer: Arc<JevTokenizer>, calib_config: Arc<CalibrationConfig>, coarse_config: CoarseToFineConfig, max_questions_per_request: usize, chunk_size: usize, ) -> Self
設定値をカスタマイズして AppState を構築する。
Sourcepub fn with_guardrails(
engine: Arc<InferenceEngine>,
tokenizer: Arc<JevTokenizer>,
calib_config: Arc<CalibrationConfig>,
coarse_config: CoarseToFineConfig,
max_questions_per_request: usize,
chunk_size: usize,
guardrail_config: GuardrailConfig,
) -> Self
pub fn with_guardrails( engine: Arc<InferenceEngine>, tokenizer: Arc<JevTokenizer>, calib_config: Arc<CalibrationConfig>, coarse_config: CoarseToFineConfig, max_questions_per_request: usize, chunk_size: usize, guardrail_config: GuardrailConfig, ) -> Self
ガードレール設定も含めてフルカスタマイズした AppState を構築する。
Sourcepub fn with_dual_engine(
self,
dual_engine: Arc<DualSessionEngine>,
cache_manager: Arc<StateCacheManager>,
) -> Self
pub fn with_dual_engine( self, dual_engine: Arc<DualSessionEngine>, cache_manager: Arc<StateCacheManager>, ) -> Self
デュアルセッション推論エンジンおよびキャッシュマネージャーを設定する。
Sourcepub fn with_gating_config(self, gating_config: GatingConfig) -> Self
pub fn with_gating_config(self, gating_config: GatingConfig) -> Self
ゲーティング設定をカスタマイズして設定する。
Sourcepub fn with_hierarchical_mapping(
self,
mapping: Arc<HierarchicalMapping>,
) -> Self
pub fn with_hierarchical_mapping( self, mapping: Arc<HierarchicalMapping>, ) -> Self
階層オントロジーマッピングを設定する。
Sourcepub fn with_hierarchical_config(self, config: HierarchicalRouterConfig) -> Self
pub fn with_hierarchical_config(self, config: HierarchicalRouterConfig) -> Self
粗密階層ルーティング設定をカスタマイズして設定する。
Sourcepub fn with_auto_hierarchical(self, enabled: bool) -> Self
pub fn with_auto_hierarchical(self, enabled: bool) -> Self
透過的粗密ルーティングモードの有効化を設定する。
Sourcepub fn with_dag_executor(self, executor: Arc<InProcessDagExecutor>) -> Self
pub fn with_dag_executor(self, executor: Arc<InProcessDagExecutor>) -> Self
カスタム DAG 実行器を設定する。
Sourcepub fn load_hierarchical_mapping_from_dir<P: AsRef<Path>>(self, dir: P) -> Self
pub fn load_hierarchical_mapping_from_dir<P: AsRef<Path>>(self, dir: P) -> Self
指定ディレクトリ内の hierarchical_mapping.json を読み込み、存在すれば登録する。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Freeze for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more