Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,61 +24,49 @@ def respond(
|
|
| 24 |
max_tokens,
|
| 25 |
):
|
| 26 |
SYS_PROMPT = """
|
| 27 |
-
Extract
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
"Artwork and decorative accessories": 1,
|
| 37 |
-
"Portable lighting": 1,
|
| 38 |
-
"Upholstered furniture and decorative pillows": 1,
|
| 39 |
-
"Millwork": 1
|
| 40 |
-
}
|
| 41 |
-
}
|
| 42 |
-
Make sure to fetch details from the provided text and ignore unnecessary information. The response should be in JSON format only, without any additional comments.
|
| 43 |
-
Task:
|
| 44 |
-
Convert the provided extracted text into the JSON format described above.
|
| 45 |
-
Provided Text:
|
| 46 |
-
PROPERTY IMPROVEMENT PLAN
|
| 47 |
-
PREPARED FOR:
|
| 48 |
-
Springfield, IL
|
| 49 |
-
To be relicensed as Hilton Garden Inn
|
| 50 |
...
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
| 52 |
...
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
}
|
| 82 |
"""
|
| 83 |
messages = [{"role": "system", "content": SYS_PROMPT}]
|
| 84 |
if len(history) == 0:
|
|
|
|
| 24 |
max_tokens,
|
| 25 |
):
|
| 26 |
SYS_PROMPT = """
|
| 27 |
+
Extract the following information from the given text:
|
| 28 |
+
Identify the specific areas where the work needs to be done and Add the furniture that has to be changed.
|
| 29 |
+
Do not specify the work that has to be done.
|
| 30 |
+
Format the extracted information in the following JSON structure:
|
| 31 |
+
|
| 32 |
+
{
|
| 33 |
+
"Area Type1": {
|
| 34 |
+
"Furnture1",
|
| 35 |
+
"Furnture2",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
...
|
| 37 |
+
}
|
| 38 |
+
"Area Type2": {
|
| 39 |
+
"Furnture1",
|
| 40 |
+
"Furnture2",
|
| 41 |
...
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
Requirements:
|
| 46 |
+
1. Each area type (e.g., lobby, bar, etc.) should have its own node.
|
| 47 |
+
3. List the furniture on which the work needs to be performed without specifying the work or units of items.
|
| 48 |
+
4. Ignore any personal information or irrelevant details.
|
| 49 |
+
5. Follow the JSON pattern strictly and ensure clarity and accuracy in the extracted information.
|
| 50 |
+
|
| 51 |
+
Example:
|
| 52 |
+
|
| 53 |
+
Given the paragraph: "In the lobby, replace 5 light fixtures and remove 2 old carpets. In the bar,
|
| 54 |
+
install 3 new tables and remove 4 broken chairs."
|
| 55 |
+
|
| 56 |
+
The JSON output should be:
|
| 57 |
+
{
|
| 58 |
+
"Lobby": {
|
| 59 |
+
"Light fixtures"
|
| 60 |
+
"Old carpets"
|
| 61 |
+
},
|
| 62 |
+
"Bar": {
|
| 63 |
+
"New tables"
|
| 64 |
+
"Broken chairs"
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
Please ensure that the output JSON is well-structured and includes only relevant details about the work to be done.
|
|
|
|
| 70 |
"""
|
| 71 |
messages = [{"role": "system", "content": SYS_PROMPT}]
|
| 72 |
if len(history) == 0:
|