Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| import json | |
| from lucius_agent import call_lucius | |
| from frontinus_agent import generate_docs | |
| from copilot_promptor import generate_prompt | |
| SYSTEM_PROMPT = """ | |
| Ty si Primus, hlavný orchestrátor Aethero Orchestra. Koordinuješ Luciusa, Frontinusa a Copilota. | |
| Syntetizuj vstupy prezidenta, volaj agentov a generuj štruktúrované výstupy pre AetheroOS. | |
| """ | |
| def orchestrate_chat(system_prompt, user_input, max_tokens=1024, temperature=0.7, top_p=0.9): | |
| try: | |
| parsed = json.loads(user_input) | |
| except json.JSONDecodeError: | |
| return "❌ Nevalidný JSON. Skontroluj syntax." | |
| lucius_output = call_lucius(parsed) | |
| docs_output = generate_docs(lucius_output, max_tokens=max_tokens, temperature=temperature) | |
| prompt_output = generate_prompt(lucius_output) | |
| return f""" | |
| === Výstup Aethero Orchestra === | |
| 🎯 Intent: {parsed.get("intent", "nezistený")} | |
| 📌 Focus: {parsed.get("focus", "nezistený")} | |
| 🧠 Emócie: {parsed.get("emotional_state", "neurčené")} | |
| 🗂️ Direktíva: {parsed.get("system_directive", "—")} | |
| 🧠 Lucius: {lucius_output} | |
| 📄 Dokumentácia: {docs_output} | |
| 🧾 Prompt: {prompt_output} | |
| ============================== | |
| """ | |
| with gr.Blocks(title="Aethero Orchestra") as demo: | |
| with gr.Row(): | |
| input_text = gr.Textbox(label="🎙️ Prezidentov Vstup", lines=10, placeholder="{ JSON prompt }") | |
| with gr.Row(): | |
| system_prompt = gr.Textbox(label="📜 Orchestrálna Identita", value=SYSTEM_PROMPT) | |
| with gr.Row(): | |
| max_tokens = gr.Slider(256, 4096, value=1024, label="🧱 Max Tokens") | |
| temperature = gr.Slider(0.1, 1.5, value=0.7, label="🔥 Temperature") | |
| top_p = gr.Slider(0.1, 1.0, value=0.9, label="🌊 Top-p") | |
| with gr.Row(): | |
| output_text = gr.Textbox(label="🧠 Výstup Orchestru", lines=18) | |
| with gr.Row(): | |
| gr.Button("🟩 Spusti Orchestráciu").click( | |
| fn=orchestrate_chat, | |
| inputs=[system_prompt, input_text, max_tokens, temperature, top_p], | |
| outputs=output_text | |
| ) | |
| demo.launch() |