MCPcopy Index your code
hub / github.com/showlab/Code2Video / process_knowledge_point

Function process_knowledge_point

src/agent.py:722–738  ·  view source on GitHub ↗
(idx, kp, folder_path: Path, cfg: RunConfig)

Source from the content-addressed store, hash-verified

720
721
722def process_knowledge_point(idx, kp, folder_path: Path, cfg: RunConfig):
723 print(f"\n🚀 Processing knowledge topic: {kp}")
724 start_time = time.time()
725
726 agent = TeachingVideoAgent(
727 idx=idx,
728 knowledge_point=kp,
729 folder=folder_path,
730 cfg=cfg,
731 )
732 video_path = agent.GENERATE_VIDEO()
733
734 duration_minutes = (time.time() - start_time) / 60
735 total_tokens = agent.token_usage["total_tokens"]
736
737 print(f"✅ Knowledge topic '{kp}' processed. Cost Time: {duration_minutes:.2f} minutes, Tokens used: {total_tokens}")
738 return kp, video_path, duration_minutes, total_tokens
739
740
741def process_batch(batch_data, cfg: RunConfig):

Callers 2

process_batchFunction · 0.85
run_Code2VideoFunction · 0.85

Calls 2

GENERATE_VIDEOMethod · 0.95
TeachingVideoAgentClass · 0.85

Tested by

no test coverage detected