Spaces:
Sleeping
Sleeping
suhasg
commited on
Commit
·
7c6e8cc
1
Parent(s):
880f604
added a prompt on the template
Browse files
app.py
CHANGED
@@ -205,9 +205,9 @@ def form_json_rule(condition_string):
|
|
205 |
final_template = final_template.replace("shielded_replaced_string", condition_string)
|
206 |
gpt_assistant_prompt2 = """You are a json rule maker. You make rules based on the structure provided.
|
207 |
IMPORTANT:
|
208 |
-
Only give the json as response no other text should be present.
|
209 |
Give the response json in compact form.
|
210 |
-
the response should be exactly same to the template used in the prompt
|
211 |
"""
|
212 |
resp = make_api_call(gpt_assistant_prompt2, final_template)
|
213 |
return resp
|
@@ -301,7 +301,7 @@ def main():
|
|
301 |
st.json(json_rule)
|
302 |
st.download_button(
|
303 |
label="Download JSON Rule",
|
304 |
-
data=json_rule,
|
305 |
file_name="json_rule.json",
|
306 |
mime="application/json"
|
307 |
)
|
|
|
205 |
final_template = final_template.replace("shielded_replaced_string", condition_string)
|
206 |
gpt_assistant_prompt2 = """You are a json rule maker. You make rules based on the structure provided.
|
207 |
IMPORTANT:
|
208 |
+
Only give the valid json as response no other text should be present.
|
209 |
Give the response json in compact form.
|
210 |
+
the response should be exactly same to the template used in the prompt
|
211 |
"""
|
212 |
resp = make_api_call(gpt_assistant_prompt2, final_template)
|
213 |
return resp
|
|
|
301 |
st.json(json_rule)
|
302 |
st.download_button(
|
303 |
label="Download JSON Rule",
|
304 |
+
data=json.dumps(json_rule),
|
305 |
file_name="json_rule.json",
|
306 |
mime="application/json"
|
307 |
)
|