MCPcopy Create free account
hub / github.com/Enfoirer/Text2GraphRAG / continue_processing

Function continue_processing

agent/batch_manager.py:124–148  ·  view source on GitHub ↗

继续处理中断的任务

(recipe_dir: str, output_dir: str)

Source from the content-addressed store, hash-verified

122 print(f"❌ 合并失败: {str(e)}")
123
124def continue_processing(recipe_dir: str, output_dir: str):
125 """继续处理中断的任务"""
126 config = load_config()
127 api_key = config["openai"].get("api_key")
128
129 if not api_key:
130 print("❌ 未找到API密钥配置")
131 return
132
133 try:
134 ai_agent = LLMRecipeAgent(api_key)
135 batch_size = config.get("processing", {}).get("batch_size", 20)
136 builder = RecipeKnowledgeGraphBuilder(ai_agent, output_dir, batch_size)
137
138 print("继续处理中断的任务...")
139 processed, failed = builder.batch_process_recipes(recipe_dir, resume=True)
140
141 print(f"处理完成: 总数 {processed}, 失败 {failed}")
142
143 # 自动合并数据
144 print("自动合并批次数据...")
145 merge_batches(output_dir)
146
147 except Exception as e:
148 print(f"❌ 处理失败: {str(e)}")
149
150def show_batch_details(output_dir: str, batch_num: int = None):
151 """显示批次详细信息"""

Callers 1

mainFunction · 0.85

Calls 5

batch_process_recipesMethod · 0.95
LLMRecipeAgentClass · 0.90
merge_batchesFunction · 0.85
load_configFunction · 0.70

Tested by

no test coverage detected