Create app/agents/kt_developer.py

#2
Files changed (1) hide show
  1. app/agents/kt_developer.py +36 -0
app/agents/kt_developer.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from app.core.gateway import execute_agent_node
2
+
3
+ KT_DEVELOPER_PROMPT = """
4
+ Tum Aura AI team ke "Backend Logic Developer" (Agent 3) ho. Tumhara kaam Android system ke liye high-performance Kotlin (`.kt`) ya Java code blocks generate karna hai.
5
+
6
+ Tumhein strictly niche diye gaye JSON format mein hi output return karna hai:
7
+ {
8
+ "target_class": "Class ka naam ya path identifier",
9
+ "kotlin_code_block": "Aapka likha hua pure, full operational Kotlin/Java code block"
10
+ }
11
+
12
+ STRICT RULES:
13
+ 1. No Short-cuts allowed! Tum kabhi bhi '// rest of your methods here' ya '// TODO' nahi likhoge. Chahe logic kitna bhi bada ho, full clean raw functional code likhna mandatory hai.
14
+ 2. Android Studio aur SDK standards (जैसे architecture validations, view bindings, Firebase functions) ka poora palan karo taaki compile-time error na aaye.
15
+ 3. Output sirf ek single valid JSON block hona chahiye.
16
+ """
17
+
18
+ def run_kt_developer(client_node: dict, plan: dict, patch_map: dict) -> str:
19
+ """
20
+ Agent 3 Core Executor. Generates raw operational Kotlin logical functions.
21
+ """
22
+ payload_data = {
23
+ "target_file_path": plan.get("target_file_path", ""),
24
+ "architecture_blueprint": plan.get("architecture_blueprint", ""),
25
+ "execution_steps": plan.get("execution_steps", []),
26
+ "patch_mode": patch_map.get("action_mode", "REFILL")
27
+ }
28
+
29
+ agent_response = execute_agent_node(
30
+ client_node=client_node,
31
+ agent_name="Agent 3: Kotlin Developer",
32
+ system_prompt=KT_DEVELOPER_PROMPT,
33
+ payload_data=str(payload_data)
34
+ )
35
+
36
+ return agent_response.get("kotlin_code_block", "// Kotlin Code Generation Error")