Fix: update agents/chat_agent.py
Browse files1234567891011121314151 unmodified line17181920212223242526272829303132333435"""ChatAgent — Conversational AI via LLMRouter"""import structlogfrom typing import Dictfrom .base_agent import BaseAgentlog = structlog.get_logger()SYSTEM_PROMPT = """You are God Mode+ AI — an elite autonomous AI software engineer (Devin + Manus style).You can plan, code, debug, refactor, test, and deploy software autonomously.Be concise, helpful, and professional. Use markdown formatting."""class ChatAgent(BaseAgent):1 unmodified linesuper().__init__("ChatAgent", ws_manager, ai_router)async def run(self, task: str, context: Dict = {}, **kwargs) -> str:session_id = kwargs.get("session_id", context.get("session_id", ""))task_id = kwargs.get("task_id", context.get("task_id", ""))messages = [{"role": "system", "content": SYSTEM_PROMPT},{"role": "user", "content": task},]await self.emit(task_id, "agent_thinking", {"agent": "chat", "message": task[:100]}, session_id)result = await self.ask_llm(messages=messages,task_id=task_id,session_id=session_id,)return result1234567891011121314151617181 unmodified line20212223242526272829303132333435363738394041424344"""ChatAgent — Conversational interface with streaming, Burmese support"""from typing import Dictimport structlogfrom .base_agent import BaseAgentlog = structlog.get_logger()CHAT_SYSTEM = """You are God Agent — an elite autonomous AI operating system.You support both English and Burmese (မြန်မာဘာသာ) languages.Be helpful, precise, and autonomous.When users write in Burmese, respond in Burmese.When discussing code, provide production-quality examples."""class ChatAgent(BaseAgent):1 unmodified linesuper().__init__("ChatAgent", ws_manager, ai_router)async def run(self, task: str, context: Dict = {}, **kwargs) -> str:session_id = kwargs.get("session_id", "")task_id = kwargs.get("task_id", "")history = context.get("history", [])messages = [{"role": "system", "content": CHAT_SYSTEM}]for h in history[-10:]:messages.append({"role": h.get("role", "user"), "content": h.get("content", "")})messages.append({"role": "user", "content": task})await self.emit_chat(session_id, "stream_start", {"agent": "ChatAgent", "status": "generating"})response = await self.llm(messages, task_id=task_id, session_id=session_id)await self.emit_chat(session_id, "stream_end", {"agent": "ChatAgent","full_response": response,"status": "complete",})return response
agents/chat_agent.py+30-21