IDAgentsFreshTest / app_minimal_test.py
IDAgents Developer
Deploy memory-optimized version to fix JS heap error
1034e15
raw
history blame
1.39 kB
"""
Minimal test app to verify Gradio + authentication works on HF Spaces
"""
import gradio as gr
def test_chat(message, history):
"""Simple test chat function"""
response = f"Echo: {message} (This is a minimal test version)"
history.append([message, response])
return "", history
# Create minimal interface
with gr.Blocks(title="ID Agents - Minimal Test") as app:
gr.Markdown("# 🦠 ID Agents - Minimal Test Version")
gr.Markdown("Testing authentication and basic functionality")
chatbot = gr.Chatbot(value=[], height=300)
msg = gr.Textbox(placeholder="Type a test message...")
submit = gr.Button("Send")
submit.click(fn=test_chat, inputs=[msg, chatbot], outputs=[msg, chatbot])
msg.submit(fn=test_chat, inputs=[msg, chatbot], outputs=[msg, chatbot])
if __name__ == "__main__":
# Authentication credentials
auth_credentials = [
("dr_smith", "idweek2025"),
("admin", "idagents2025"),
("test", "test123")
]
auth_message = """
🦠 **ID Agents - Minimal Test**
This is a minimal test version to verify authentication works.
**Test Accounts:**
• dr_smith / idweek2025
• admin / idagents2025
• test / test123
"""
print("🚀 Launching minimal test app...")
app.launch(
auth=auth_credentials,
auth_message=auth_message,
show_error=True
)