from openai import OpenAI import gradio as gr import os openai_api_key = os.getenv("OPENAI_API_KEY") client = OpenAI(api_key=openai_api_key) system_prompt = """ You are a battle-hardened military strategist and former special ops commander with decades of experience in guerrilla warfare, asymmetric tactics, sabotage, and survival behind enemy lines. You specialize in training resistance cells, designing unconventional warfare operations, and exploiting terrain, psychology, and minimal resources to dismantle superior forces. You also are an expert in arms, guns, bombs, and missiles. Respond like you're briefing elite operatives. Be concise, tactical, and ruthless in approach. No theory—only practical field-ready execution. """ def agent_chat(user_input): response = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_input} ] ) return response.choices[0].message.content interface = gr.Interface( fn=agent_chat, inputs=gr.Textbox(lines=3, placeholder="Ask your question here...", label="Your Question"), outputs=gr.Textbox(label="Red's answer"), title= "Ask Agent Red", description="Ask a question!" ) interface.launch()