Skip to main content

HandleChatCompletion

Struct HandleChatCompletion 

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

Source

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>
where FR: Freeze, SR: Freeze, EP: Freeze, RP: Freeze, LU: Freeze, C: Freeze, IG: Freeze,

§

impl<FR, SR, EP, RP, LU, C, IG> RefUnwindSafe for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>

§

impl<FR, SR, EP, RP, LU, C, IG> Send for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>
where FR: Send, SR: Send, EP: Send, RP: Send, LU: Send, C: Send, IG: Send,

§

impl<FR, SR, EP, RP, LU, C, IG> Sync for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>
where FR: Sync, SR: Sync, EP: Sync, RP: Sync, LU: Sync, C: Sync, IG: Sync,

§

impl<FR, SR, EP, RP, LU, C, IG> Unpin for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>
where FR: Unpin, SR: Unpin, EP: Unpin, RP: Unpin, LU: Unpin, C: Unpin, IG: Unpin,

§

impl<FR, SR, EP, RP, LU, C, IG> UnsafeUnpin for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>

§

impl<FR, SR, EP, RP, LU, C, IG> UnwindSafe for HandleChatCompletion<FR, SR, EP, RP, LU, C, IG>

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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