manabb commited on
Commit
b16c761
·
verified ·
1 Parent(s): 6881c53

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ from openai import OpenAI
4
+
5
+ client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
6
+
7
+ def check_compliance(text):
8
+ response = client.responses.create(
9
+ model="gpt-4.1-nano",
10
+ input=text,
11
+ temperature=0.1
12
+ )
13
+ return response.output[0].content[0].text
14
+
15
+ gr.Interface(
16
+ fn=check_compliance,
17
+ inputs=gr.Textbox(lines=15, label="Enter Proposal"),
18
+ outputs=gr.Textbox(lines=15, label="Compliance Result"),
19
+ ).launch()