Spaces:
Runtime error
Runtime error
Update src/services/utils.py
Browse files- src/services/utils.py +32 -5
src/services/utils.py
CHANGED
@@ -9,11 +9,38 @@ nltk.download("punkt_tab")
|
|
9 |
FILE_PATH = "/app/src/ressources/technologies_database.xlsx"
|
10 |
|
11 |
def set_prompt(problem):
|
12 |
-
prompt = """
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
return prompt
|
18 |
|
19 |
def load_technologies_excel():
|
|
|
9 |
FILE_PATH = "/app/src/ressources/technologies_database.xlsx"
|
10 |
|
11 |
def set_prompt(problem):
|
12 |
+
prompt = """
|
13 |
+
# ROLE
|
14 |
+
|
15 |
+
You are a meticulous senior technical analyst and constraints scout. Your task is to read a small description of a technical problem and identify distinct constraints each related to the problem and ensuring that the whole problem is encompassed by each constraints into a JSON object.
|
16 |
+
|
17 |
+
# OBJECTIVE
|
18 |
+
|
19 |
+
Find all the constraints in this technical problem making sure each are premised on the problem only.
|
20 |
+
Take into account different technical domains to encompass the whole problem.
|
21 |
+
Output each constraints in a JSON such as : {"title of the constraints1":"description1","title of the constraintsN":"descriptionN"}
|
22 |
+
|
23 |
+
# INSTRUCTIONS & RULES
|
24 |
+
|
25 |
+
1. **JSON Output**: Your entire response MUST be a single JSON code block starting with a hyphen (`-`) to denote a list. Do not include any explanatory text before or after the JSON.
|
26 |
+
2 **Discover and Iterate**: Your primary task is to scan the technical problem, find each constraints and create a seperate entry for it in the output JSON.
|
27 |
+
3. **Descriptive Sentences**: You MUST write clear, full sentences that describe the constraints's issues. Do not use single keywords. These descriptions should be based on the information in the technical problem.
|
28 |
+
4. **Infer Where Necessary**: The technical problem may not contain all details. Infer plausible information based on the context.
|
29 |
+
|
30 |
+
# JSON SCHEMA & EXAMPLE
|
31 |
+
|
32 |
+
{
|
33 |
+
'Exposing Compute Resources': 'The 6G network shall provide suitable APIs to allow authorized third parties and/or UEs to retrieve availability information about computational resources inside the Service Hosting Environment (SHE) and to utilize these computational resources for running workloads on demand.',
|
34 |
+
'Providing AI Compute': 'The 6G network shall be able to provide computing resources in the Service Hosting Environment for AI services and provide AI services to UEs.',
|
35 |
+
...
|
36 |
+
}
|
37 |
+
|
38 |
+
---
|
39 |
+
***NOW, BEGIN THE TASK.***
|
40 |
+
|
41 |
+
# TECHNICAL PROBLEM
|
42 |
+
|
43 |
+
""" + problem
|
44 |
return prompt
|
45 |
|
46 |
def load_technologies_excel():
|