provenance for successful LLM-assisted candidate generation
This commit is contained in:
parent
cdaeefd4b2
commit
2403accd06
3 changed files with 21 additions and 3 deletions
|
|
@ -128,7 +128,11 @@ class RegistryService:
|
|||
)
|
||||
stored_chunks = self.store.list_content_chunks(repository_id, completed_run.id)
|
||||
try:
|
||||
candidates = self._generate_candidates(repository, facts, stored_chunks)
|
||||
candidates, candidate_source = self._generate_candidates(
|
||||
repository,
|
||||
facts,
|
||||
stored_chunks,
|
||||
)
|
||||
except Exception as exc:
|
||||
self.store.create_review_decision(
|
||||
repository_id,
|
||||
|
|
@ -141,7 +145,15 @@ class RegistryService:
|
|||
facts,
|
||||
stored_chunks,
|
||||
)
|
||||
candidate_source = "deterministic"
|
||||
self.store.replace_candidate_graph(repository_id, completed_run.id, candidates)
|
||||
if candidate_source == "llm":
|
||||
self.store.create_review_decision(
|
||||
repository_id,
|
||||
completed_run.id,
|
||||
action="llm_extraction_used",
|
||||
notes=f"Generated {len(candidates)} candidate ability draft(s).",
|
||||
)
|
||||
return ScanSummary(
|
||||
analysis_run=completed_run,
|
||||
snapshot=snapshot,
|
||||
|
|
@ -157,8 +169,8 @@ class RegistryService:
|
|||
if self.llm_extractor is not None:
|
||||
extracted = self.llm_extractor.extract(repository, chunks)
|
||||
if extracted:
|
||||
return self.llm_mapper.map(extracted, facts, chunks)
|
||||
return self.candidate_generator.generate(repository, facts, chunks)
|
||||
return self.llm_mapper.map(extracted, facts, chunks), "llm"
|
||||
return self.candidate_generator.generate(repository, facts, chunks), "deterministic"
|
||||
|
||||
def list_analysis_runs(self, repository_id: int) -> list[AnalysisRun]:
|
||||
return self.store.list_analysis_runs(repository_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue