Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,11 @@ client = InferenceClient(
|
|
7 |
api_key= os.getenv("superSecretKey")
|
8 |
)
|
9 |
|
10 |
-
def
|
11 |
messages = [
|
12 |
{
|
13 |
"role": "user",
|
14 |
-
"content": f"
|
15 |
}
|
16 |
]
|
17 |
|
@@ -25,10 +25,10 @@ def evaluate_password_strength(password):
|
|
25 |
return response
|
26 |
|
27 |
demo = gr.Interface(
|
28 |
-
|
29 |
-
gr.Textbox(label="Enter your
|
30 |
-
gr.Textbox(label="
|
31 |
-
title="
|
32 |
description="Get the AI's evaluation of your password strength.",
|
33 |
)
|
34 |
|
|
|
7 |
api_key= os.getenv("superSecretKey")
|
8 |
)
|
9 |
|
10 |
+
def evaluate_code_security(code):
|
11 |
messages = [
|
12 |
{
|
13 |
"role": "user",
|
14 |
+
"content": f"You are BoxyReviewer. You work for OmniBlocks, a Python IDE. Your job is to review code before it is uploaded to the cloud. Not for bugs, that's the compiler's thing. Your job is to look at the code and make sure none of it is malicious before it gets to OmniBlocks' server. Your response must be formatted in a JSON format. The key 'result' should be either 'Safe' or 'Unsafe'. The key 'reason' should explain your reasoning. Here's the code {code}"
|
15 |
}
|
16 |
]
|
17 |
|
|
|
25 |
return response
|
26 |
|
27 |
demo = gr.Interface(
|
28 |
+
evaluate_code_security,
|
29 |
+
gr.Textbox(label="Enter your code"),
|
30 |
+
gr.Textbox(label="Code Security Evaluation"),
|
31 |
+
title="Code Security Evaluator",
|
32 |
description="Get the AI's evaluation of your password strength.",
|
33 |
)
|
34 |
|