File size: 1,042 Bytes
f09eba4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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)