Spaces:
Sleeping
Sleeping
| from app.core.gateway import execute_agent_node | |
| # Agent 3 Core Instruction Manual (Aura AI Kotlin Specialist) | |
| KT_DEVELOPER_PROMPT = """ | |
| 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. | |
| Tumhein strictly niche diye gaye JSON format mein hi output return karna hai: | |
| { | |
| "target_class": "Class ka naam ya absolute file path identifier", | |
| "kotlin_code_block": "Aapka likha hua pure, full operational Kotlin/Java code block" | |
| } | |
| STRICT RULES: | |
| 1. Short-cuts completely BANNED hain! Tum kabhi bhi code ke beech mein '// rest of your methods here', '// TODO' ya '// implementation stays same' nahi likhoge. Chahe file kitni bhi lambi ho, upar se lekar neeche tak poora full operational working code block likhna tumhaari absolute zimmedari hai. | |
| 2. Android Studio, AndroidIDE aur modern SDK standards (jaise Architecture Components, View/Data Binding, Coroutines, aur Firebase functions) ka poora palan karo taaki compile-time par koi crash ya bracket alignment failure na aaye. | |
| 3. Output strictly aur strictly sirf ek single valid JSON block hona chahiye. Plain text ya conversational summary baahar mat likho. | |
| """ | |
| def run_kt_developer(client_node: dict, plan: dict, patch_map: dict) -> str: | |
| """ | |
| Agent 3 Core Engine Executor. | |
| Chief Architect Controller ke execution plan ke hisab se absolute full Kotlin code generate karta hai. | |
| """ | |
| payload_data = { | |
| "target_file_path": plan.get("target_file_path", ""), | |
| "architecture_blueprint": plan.get("architecture_blueprint", ""), | |
| "execution_steps": plan.get("execution_steps", []), | |
| "patch_mode": patch_map.get("action_mode", "REFILL") | |
| } | |
| # Core framework gateway se agent ko call karna | |
| agent_response = execute_agent_node( | |
| client_node=client_node, | |
| agent_name="Agent 3: Kotlin Developer", | |
| system_prompt=KT_DEVELOPER_PROMPT, | |
| payload_data=str(payload_data) | |
| ) | |
| # Validation fallback agar JSON parsing error ho ya code block na mile | |
| return agent_response.get("kotlin_code_block", "// Aura AI: Kotlin Source Code Generation Error") | |