Ai-interview / test_simple.py
Parimal Kalpande
update
f09eba4
# test_simple.py
import gradio as gr
import os
def simple_greeting(name):
return f"Hello {name}! The app is working properly."
def test_groq_connection():
groq_key = os.environ.get("GROQ_API_KEY")
if groq_key:
return "βœ… GROQ API key is configured"
else:
return "❌ GROQ API key is missing"
# Create a simple interface to test basic functionality
with gr.Blocks() as demo:
gr.Markdown("# AI Interview Coach - Connection Test")
with gr.Row():
name_input = gr.Textbox(label="Your Name", placeholder="Enter your name")
greeting_output = gr.Textbox(label="Greeting", interactive=False)
with gr.Row():
test_btn = gr.Button("Test GROQ Connection")
status_output = gr.Textbox(label="API Status", interactive=False)
name_input.change(simple_greeting, inputs=[name_input], outputs=[greeting_output])
test_btn.click(test_groq_connection, outputs=[status_output])
if __name__ == "__main__":
demo.launch(server_name="0.0.0.0", server_port=7860)