mgbam commited on
Commit
8b57e2f
Β·
verified Β·
1 Parent(s): 0180e60

Update core_creator/voice_to_app.py

Browse files
Files changed (1) hide show
  1. core_creator/voice_to_app.py +44 -0
core_creator/voice_to_app.py CHANGED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # voice_to_app.py - Core Creator Logic
2
+
3
+ from core_creator.intent_parser import classify_robot_idea
4
+ from core_creator.app_blueprint import generate_app_blueprint
5
+ from core_creator.code_generator import generate_app_code
6
+ from core_creator.assets_manager import fetch_visual_assets
7
+
8
+ class VoiceToAppCreator:
9
+ def __init__(self, voice_transcript: str):
10
+ self.voice_input = voice_transcript
11
+ self.intent = None
12
+ self.blueprint = None
13
+ self.generated_code = None
14
+ self.assets = None
15
+
16
+ def run_pipeline(self):
17
+ print("\n[πŸ”] Classifying robot intent...")
18
+ self.intent = classify_robot_idea(self.voice_input)
19
+
20
+ print(f"[🧠] Detected intent: {self.intent}")
21
+ self.blueprint = generate_app_blueprint(self.voice_input, self.intent)
22
+
23
+ print("[βš™οΈ] Generating code from blueprint...")
24
+ self.generated_code = generate_app_code(self.blueprint)
25
+
26
+ print("[🎨] Fetching visual/audio assets...")
27
+ self.assets = fetch_visual_assets(self.intent)
28
+
29
+ print("[βœ…] Robot App creation complete.")
30
+ return {
31
+ "intent": self.intent,
32
+ "blueprint": self.blueprint,
33
+ "code": self.generated_code,
34
+ "assets": self.assets
35
+ }
36
+
37
+ # Example usage
38
+ if __name__ == "__main__":
39
+ user_idea = "Build a robot that teaches kids to brush their teeth with fun animations."
40
+ creator = VoiceToAppCreator(user_idea)
41
+ app_package = creator.run_pipeline()
42
+
43
+ print("\n--- Final App Package ---")
44
+ print(app_package["code"][:500]) # preview generated code