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

Function generate_answer

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

Source from the content-addressed store, hash-verified

217
218
219def generate_answer(question, cluster_chain_of_entities, args):
220 prompt = answer_prompt + question + '\n'
221 chain_prompt = '\n'.join([', '.join([str(x) for x in chain]) for sublist in cluster_chain_of_entities for chain in sublist])
222 prompt += "\nKnowledge Triplets: " + chain_prompt + 'A: '
223 result = run_llm(prompt, args.temperature_reasoning, args.max_length, args.opeani_api_keys, args.LLM_type)
224 return result
225
226
227def entity_prune(total_entities_id, total_relations, total_candidates, total_topic_entities, total_head, total_scores, args):

Callers 1

half_stopFunction · 0.70

Calls 1

run_llmFunction · 0.70

Tested by

no test coverage detected