MCPcopy Create free account
hub / github.com/DataArcTech/ToG / reasoning

Function reasoning

ToG/freebase_func.py:244–255  ·  view source on GitHub ↗
(question, cluster_chain_of_entities, args)

Source from the content-addressed store, hash-verified

242
243
244def reasoning(question, cluster_chain_of_entities, args):
245 prompt = prompt_evaluate + question
246 chain_prompt = '\n'.join([', '.join([str(x) for x in chain]) for sublist in cluster_chain_of_entities for chain in sublist])
247 prompt += "\nKnowledge Triplets: " + chain_prompt + 'A: '
248
249 response = run_llm(prompt, args.temperature_reasoning, args.max_length, args.opeani_api_keys, args.LLM_type)
250
251 result = extract_answer(response)
252 if if_true(result):
253 return True, response
254 else:
255 return False, response
256
257
258

Callers

nothing calls this directly

Calls 3

extract_answerFunction · 0.85
if_trueFunction · 0.85
run_llmFunction · 0.70

Tested by

no test coverage detected