Spaces:
Runtime error
Runtime error
Actualizar app.py
Browse files
app.py
CHANGED
|
@@ -4,23 +4,24 @@ from orchestrator import SuperOrchestrator, SuperConfig
|
|
| 4 |
|
| 5 |
def main():
|
| 6 |
config = SuperConfig(
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
enable_local_models=
|
| 11 |
-
debug_mode=
|
| 12 |
)
|
| 13 |
-
|
| 14 |
|
| 15 |
def responde(message, history, task_type):
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
with gr.Blocks() as demo:
|
| 20 |
gr.Markdown("# 馃 Super Chatbot Multi-Agente")
|
| 21 |
chat = gr.Chatbot()
|
| 22 |
with gr.Row():
|
| 23 |
-
msg = gr.Textbox(
|
| 24 |
task_type = gr.Dropdown(
|
| 25 |
choices=[
|
| 26 |
"conversaci贸n","c贸digo","depuraci贸n","explicaci贸n_c贸digo",
|
|
@@ -30,12 +31,12 @@ def main():
|
|
| 30 |
value="conversaci贸n",
|
| 31 |
label="Tipo de tarea"
|
| 32 |
)
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
-
|
| 37 |
-
msg.submit(responde, inputs=[msg, chat, task_type], outputs=chat)
|
| 38 |
-
|
| 39 |
|
| 40 |
demo.launch()
|
| 41 |
|
|
|
|
| 4 |
|
| 5 |
def main():
|
| 6 |
config = SuperConfig(
|
| 7 |
+
deepseek_api_key=os.getenv("DEEPSEEK_KEY", ""),
|
| 8 |
+
openai_api_key=os.getenv("OPENAI_KEY", ""),
|
| 9 |
+
hf_token=os.getenv("HF_TOKEN", ""),
|
| 10 |
+
enable_local_models=True,
|
| 11 |
+
debug_mode=True
|
| 12 |
)
|
| 13 |
+
orb = SuperOrchestrator(config)
|
| 14 |
|
| 15 |
def responde(message, history, task_type):
|
| 16 |
+
resp = orb.process(message, task_type)
|
| 17 |
+
history.append([message, resp.content])
|
| 18 |
+
return history, history
|
| 19 |
|
| 20 |
with gr.Blocks() as demo:
|
| 21 |
gr.Markdown("# 馃 Super Chatbot Multi-Agente")
|
| 22 |
chat = gr.Chatbot()
|
| 23 |
with gr.Row():
|
| 24 |
+
msg = gr.Textbox(label="Escribe tu mensaje", placeholder="驴Qu茅 necesitas?")
|
| 25 |
task_type = gr.Dropdown(
|
| 26 |
choices=[
|
| 27 |
"conversaci贸n","c贸digo","depuraci贸n","explicaci贸n_c贸digo",
|
|
|
|
| 31 |
value="conversaci贸n",
|
| 32 |
label="Tipo de tarea"
|
| 33 |
)
|
| 34 |
+
enviar = gr.Button("Enviar")
|
| 35 |
+
limpiar = gr.Button("Limpiar chat")
|
| 36 |
|
| 37 |
+
enviar.click(responde, inputs=[msg, chat, task_type], outputs=[chat, chat])
|
| 38 |
+
msg.submit(responde, inputs=[msg, chat, task_type], outputs=[chat, chat])
|
| 39 |
+
limpiar.click(lambda: [], outputs=[chat])
|
| 40 |
|
| 41 |
demo.launch()
|
| 42 |
|