commented out actions, sections part
Browse files- .gitignore +2 -1
- app.py +10 -10
- test.py +3 -3
.gitignore
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
plan.txt
|
| 2 |
.env
|
| 3 |
|
| 4 |
-
model
|
|
|
|
|
|
| 1 |
plan.txt
|
| 2 |
.env
|
| 3 |
|
| 4 |
+
model
|
| 5 |
+
__pycache__
|
app.py
CHANGED
|
@@ -63,16 +63,16 @@ analysis_system_message = {
|
|
| 63 |
{
|
| 64 |
"signal": string,
|
| 65 |
"message": string, // (optional)
|
| 66 |
-
"summary": string,
|
| 67 |
-
"actions": [{ "id": string, "name": string }; use only existing HTML ids
|
| 68 |
-
],
|
| 69 |
-
"sections": [{ "id": string, "name": string }
|
| 70 |
-
|
| 71 |
-
Where:
|
| 72 |
-
- actions is an array where each value consist of JSON object of HTML element ID and a name you suggest for the action. for example, { "id": "loginBtn", "name": "Press login" }.
|
| 73 |
-
- sections is an array where each value consist of JSON object of section ID and a name you suggest for the section. for example, { "id": "about-me", "name": "Header Section" }.
|
| 74 |
-
Valid signal codes:
|
| 75 |
-
|
| 76 |
Rules:
|
| 77 |
1. Always return JSON, never plain text or explanations.
|
| 78 |
2. Do not include extra keys.
|
|
|
|
| 63 |
{
|
| 64 |
"signal": string,
|
| 65 |
"message": string, // (optional)
|
| 66 |
+
"summary": string,"""+
|
| 67 |
+
# "actions": [{ "id": string, "name": string }; use only existing HTML ids
|
| 68 |
+
# ],
|
| 69 |
+
# "sections": [{ "id": string, "name": string }
|
| 70 |
+
# ]
|
| 71 |
+
# Where:
|
| 72 |
+
# - actions is an array where each value consist of JSON object of HTML element ID and a name you suggest for the action. for example, { "id": "loginBtn", "name": "Press login" }.
|
| 73 |
+
# - sections is an array where each value consist of JSON object of section ID and a name you suggest for the section. for example, { "id": "about-me", "name": "Header Section" }.
|
| 74 |
+
+"""Valid signal codes:"""+
|
| 75 |
+
+ codes + """
|
| 76 |
Rules:
|
| 77 |
1. Always return JSON, never plain text or explanations.
|
| 78 |
2. Do not include extra keys.
|
test.py
CHANGED
|
@@ -35,7 +35,7 @@ def test_prompt_endpoint():
|
|
| 35 |
# check for analysis requests
|
| 36 |
dataArr = [
|
| 37 |
{"prompt": "analyze this site"},
|
| 38 |
-
{"prompt": "what options are there"},
|
| 39 |
{"prompt": "summarize the content"},
|
| 40 |
]
|
| 41 |
|
|
@@ -97,8 +97,8 @@ def test_analyze_endpoint():
|
|
| 97 |
assert isinstance(output, dict), "Output is not a dictionary"
|
| 98 |
assert "signal" in output, "Missing 'signal' key"
|
| 99 |
assert "summary" in output, "Missing 'summary' key"
|
| 100 |
-
assert "actions" in output, "Missing 'actions' key"
|
| 101 |
-
assert "sections" in output, "Missing 'sections' key"
|
| 102 |
assert output["signal"] in ["a1", "a0", "e0", "e1"], "Invalid 'signal' value"
|
| 103 |
else:
|
| 104 |
print(f"Request failed with status code: {response.status_code}")
|
|
|
|
| 35 |
# check for analysis requests
|
| 36 |
dataArr = [
|
| 37 |
{"prompt": "analyze this site"},
|
| 38 |
+
# {"prompt": "what options are there"},
|
| 39 |
{"prompt": "summarize the content"},
|
| 40 |
]
|
| 41 |
|
|
|
|
| 97 |
assert isinstance(output, dict), "Output is not a dictionary"
|
| 98 |
assert "signal" in output, "Missing 'signal' key"
|
| 99 |
assert "summary" in output, "Missing 'summary' key"
|
| 100 |
+
# assert "actions" in output, "Missing 'actions' key"
|
| 101 |
+
# assert "sections" in output, "Missing 'sections' key"
|
| 102 |
assert output["signal"] in ["a1", "a0", "e0", "e1"], "Invalid 'signal' value"
|
| 103 |
else:
|
| 104 |
print(f"Request failed with status code: {response.status_code}")
|