qfa.services.sensitivity#

Sensitivity-detection use case.

One LLM call per feedback record, classifying it against the SensitivityType vocabulary. This is the smallest of the use cases extracted from Orchestrator by epic #112: no embedder, no judge connection, no chunking — which is why its constructor names exactly one dependency.

Per ADR-017 this class has no base class: the LLM-call scaffolding it shares with the other use cases (anonymise, deadline→timeout, the call itself, deanonymise) is the injected LLMCallExecutor it delegates to, not a superclass it inherits from.

Classes

SensitivityService(executor)

Detect sensitive content in a single feedback record.

class qfa.services.sensitivity.SensitivityService(executor: LLMCallExecutor)[source]#

Bases: object

Detect sensitive content in a single feedback record.

Parameters:

executor (LLMCallExecutor) – The shared LLM-call scaffolding this use case delegates to: anonymisation of the outgoing message, the deadline-bounded call itself, and restoration of the redacted values in the response. The composition root (qfa.api.composition.build_services()) hands over the same instance the other services use.

async detect_sensitive_content(request: SensitivityAnalysisRequestModel, deadline: datetime) SensitivityAnalysisResultModel[source]#

Detect sensitive content in a single feedback record.

Parameters:
  • request (SensitivityAnalysisRequestModel) – The sensitivity analysis request containing a single feedback record.

  • deadline (datetime) – The wall-clock deadline for the whole request; the LLM call is timed out against whatever remains of it.

Returns:

The sensitivity analysis result for the feedback record.

Return type:

SensitivityAnalysisResultModel