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

Function reasoning

ToG/wiki_func.py:194–205  ·  view source on GitHub ↗
(question, cluster_chain_of_entities, args)

Source from the content-addressed store, hash-verified

192
193
194def reasoning(question, cluster_chain_of_entities, args):
195 prompt = prompt_evaluate_wiki + question
196 chain_prompt = '\n'.join([', '.join([str(x) for x in chain]) for sublist in cluster_chain_of_entities for chain in sublist])
197 prompt += "\nKnowledge Triplets: " + chain_prompt + 'A: '
198
199 response = run_llm(prompt, args.temperature_reasoning, args.max_length, args.opeani_api_keys, args.LLM_type)
200
201 result = extract_answer(response)
202 if if_true(result):
203 return True, response
204 else:
205 return False, response
206
207
208

Callers 2

main_freebase.pyFile · 0.70
main_wiki.pyFile · 0.70

Calls 3

extract_answerFunction · 0.85
if_trueFunction · 0.85
run_llmFunction · 0.70

Tested by

no test coverage detected