MCPcopy
hub / github.com/llmware-ai/llmware / evidence_check_sources

Method evidence_check_sources

llmware/prompts.py:1141–1160  ·  view source on GitHub ↗

Post Inference Processing - runs analysis of the llm_response and uses statistical token-matching with the source materials to try to identify a smaller 'snippet' that is the most likely source with metadata of file and page number. Returns an updated list of response dicti

(self, response)

Source from the content-addressed store, hash-verified

1139 return response_out
1140
1141 def evidence_check_sources(self, response):
1142
1143 """ Post Inference Processing - runs analysis of the llm_response and uses statistical token-matching
1144 with the source materials to try to identify a smaller 'snippet' that is the most likely source with
1145 metadata of file and page number.
1146
1147 Returns an updated list of response dictionaries, enriched with 'source_review' key. """
1148
1149 # expect that response is a list of response dictionaries
1150 if isinstance(response, dict):
1151 response = [response]
1152
1153 response_out = []
1154 for i, response_dict in enumerate(response):
1155 qc = QualityCheck(self).source_reviewer(response_dict)
1156
1157 response_dict.update({"source_review": qc})
1158 response_out.append(response_dict)
1159
1160 return response_out
1161
1162 def evidence_comparison_stats(self, response):
1163

Callers 11

simple_analyzerFunction · 0.95
msa_processingFunction · 0.80
get_rag_responseFunction · 0.80
msa_processingFunction · 0.80
run_testFunction · 0.80
run_testFunction · 0.80
__Function · 0.80

Calls 2

QualityCheckClass · 0.85
source_reviewerMethod · 0.80

Tested by 3

run_testFunction · 0.64
run_testFunction · 0.64