pub struct HandleChatCompletion<FR, SR, EP, RP, LU, C, IG> {
pub facts: FR,
pub sessions: SR,
pub embedder: EP,
pub reranker: RP,
pub upstream: LU,
pub clock: C,
pub id_generator: IG,
pub retrieval_cfg: Arc<RetrievalConfig>,
pub heat_cfg: Arc<HeatConfig>,
pub persons: Arc<HashMap<String, PersonEntry>>,
pub providers: Arc<Vec<ProviderEntry>>,
}Expand description
Top-level chat-completion orchestration.
Owns the ports the REQUEST-side pipeline needs (enrichment + upstream
forwarding) plus the routing maps (persons, providers) needed to
resolve a requested person into a concrete upstream route. Extraction
ports live in AppState and are wired by the adapter — see the module
docs for the layering rationale.
Fields§
§facts: FR§sessions: SR§embedder: EP§reranker: RP§upstream: LU§clock: C§id_generator: IG§retrieval_cfg: Arc<RetrievalConfig>§heat_cfg: Arc<HeatConfig>§persons: Arc<HashMap<String, PersonEntry>>§providers: Arc<Vec<ProviderEntry>>Implementations§
Source§impl<FR, SR, EP, RP, LU, C, IG> HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>where
FR: FactRepository,
SR: SessionRepository,
EP: EmbeddingProvider,
RP: RerankProvider,
LU: LlmUpstream,
C: Clock,
IG: IdGenerator,
impl<FR, SR, EP, RP, LU, C, IG> HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>where
FR: FactRepository,
SR: SessionRepository,
EP: EmbeddingProvider,
RP: RerankProvider,
LU: LlmUpstream,
C: Clock,
IG: IdGenerator,
Sourcepub async fn execute(
&self,
request: ChatRequest,
) -> Result<(ChatResponse, SessionId, MemoryKey), UseCaseError>
pub async fn execute( &self, request: ChatRequest, ) -> Result<(ChatResponse, SessionId, MemoryKey), UseCaseError>
Run the chat-completion pipeline.
Returns the upstream response, the session id (so the handler injects the marker), and the memory namespace (so the adapter spawns the extraction task against the correct project).
Auto Trait Implementations§
impl<FR, SR, EP, RP, LU, C, IG> Freeze for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>
impl<FR, SR, EP, RP, LU, C, IG> RefUnwindSafe for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>where
FR: RefUnwindSafe,
SR: RefUnwindSafe,
EP: RefUnwindSafe,
RP: RefUnwindSafe,
LU: RefUnwindSafe,
C: RefUnwindSafe,
IG: RefUnwindSafe,
impl<FR, SR, EP, RP, LU, C, IG> Send for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>
impl<FR, SR, EP, RP, LU, C, IG> Sync for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>
impl<FR, SR, EP, RP, LU, C, IG> Unpin for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>
impl<FR, SR, EP, RP, LU, C, IG> UnsafeUnpin for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>where
FR: UnsafeUnpin,
SR: UnsafeUnpin,
EP: UnsafeUnpin,
RP: UnsafeUnpin,
LU: UnsafeUnpin,
C: UnsafeUnpin,
IG: UnsafeUnpin,
impl<FR, SR, EP, RP, LU, C, IG> UnwindSafe for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>where
FR: UnwindSafe,
SR: UnwindSafe,
EP: UnwindSafe,
RP: UnwindSafe,
LU: UnwindSafe,
C: UnwindSafe,
IG: UnwindSafe,
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