Skip to main content

AppState

Struct AppState 

Source
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: usize

1 リクエストで許容される最大質問数。

§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

Source

pub fn new( engine: Arc<InferenceEngine>, tokenizer: Arc<JevTokenizer>, calib_config: Arc<CalibrationConfig>, ) -> Self

新規 AppState を構築する。

§引数
  • engine: 推論エンジン。
  • tokenizer: 高速トークナイザー。
  • calib_config: 較正設定。
Source

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 を構築する。

Source

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 を構築する。

Source

pub fn with_dual_engine( self, dual_engine: Arc<DualSessionEngine>, cache_manager: Arc<StateCacheManager>, ) -> Self

デュアルセッション推論エンジンおよびキャッシュマネージャーを設定する。

Source

pub fn with_gating_config(self, gating_config: GatingConfig) -> Self

ゲーティング設定をカスタマイズして設定する。

Source

pub fn with_hierarchical_mapping( self, mapping: Arc<HierarchicalMapping>, ) -> Self

階層オントロジーマッピングを設定する。

Source

pub fn with_hierarchical_config(self, config: HierarchicalRouterConfig) -> Self

粗密階層ルーティング設定をカスタマイズして設定する。

Source

pub fn with_auto_hierarchical(self, enabled: bool) -> Self

透過的粗密ルーティングモードの有効化を設定する。

Source

pub fn with_dag_executor(self, executor: Arc<InProcessDagExecutor>) -> Self

カスタム DAG 実行器を設定する。

Source

pub fn load_hierarchical_mapping_from_dir<P: AsRef<Path>>(self, dir: P) -> Self

指定ディレクトリ内の hierarchical_mapping.json を読み込み、存在すれば登録する。

Source

pub fn is_ready(&self) -> bool

サーバーがリクエストを安全に処理可能(Readiness)であるかを検査する。

Trait Implementations§

Source§

impl Clone for AppState

Source§

fn clone(&self) -> AppState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more