MCPcopy
hub / github.com/apache/caldera / update_scores

Function update_scores

app/objects/secondclass/c_link.py:311–320  ·  view source on GitHub ↗
(operation, increment, used, facts)

Source from the content-addressed store, hash-verified

309
310
311async def update_scores(operation, increment, used, facts):
312 knowledge_svc_handle = BaseService.get_service('knowledge_svc')
313 for uf in used:
314 all_facts = await operation.all_facts() if operation else facts
315 for found_fact in all_facts:
316 if found_fact.unique == uf.unique:
317 found_fact.score += increment
318 await knowledge_svc_handle.update_fact(dict(trait=found_fact.trait, value=found_fact.value,
319 source=found_fact.source), dict(score=found_fact.score))
320 break

Callers 2

learnMethod · 0.90
parseMethod · 0.85

Calls 3

get_serviceMethod · 0.80
all_factsMethod · 0.45
update_factMethod · 0.45

Tested by

no test coverage detected