Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,8 +37,12 @@ def search_key(d, target_key):
|
|
| 37 |
recursive_search(item)
|
| 38 |
|
| 39 |
recursive_search(d)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
return results
|
| 42 |
|
| 43 |
############################################################################################
|
| 44 |
|
|
@@ -65,11 +69,11 @@ class Chroma_retrieverTool(Tool):
|
|
| 65 |
|
| 66 |
class ESRS_info_tool(Tool):
|
| 67 |
name = "find_ESRS"
|
| 68 |
-
description = "Find ESRS description to help you to find what indicators the user want"
|
| 69 |
inputs = {
|
| 70 |
"indicator": {
|
| 71 |
"type": "string",
|
| 72 |
-
"description": "The indicator name. return the description of the indicator demanded.",
|
| 73 |
},
|
| 74 |
}
|
| 75 |
output_type = "string"
|
|
|
|
| 37 |
recursive_search(item)
|
| 38 |
|
| 39 |
recursive_search(d)
|
| 40 |
+
if len(results)>0:
|
| 41 |
+
return str(results[0])
|
| 42 |
+
else :
|
| 43 |
+
return "Indicator not found. Try globals indicators in this list : ['ESRS E4', 'ESRS 2 MDR', 'ESRS S2', 'ESRS E2', 'ESRS S4', 'ESRS E5', 'ESRS 2', 'ESRS E1', 'ESRS S3', 'ESRS S1', 'ESRS G1', 'ESRS E3']"
|
| 44 |
+
|
| 45 |
|
|
|
|
| 46 |
|
| 47 |
############################################################################################
|
| 48 |
|
|
|
|
| 69 |
|
| 70 |
class ESRS_info_tool(Tool):
|
| 71 |
name = "find_ESRS"
|
| 72 |
+
description = "Find ESRS description to help you to find what indicators the user want to analyze"
|
| 73 |
inputs = {
|
| 74 |
"indicator": {
|
| 75 |
"type": "string",
|
| 76 |
+
"description": "The indicator name with format for example like following "ESRS EX" or "EX". return the description of the indicator demanded.",
|
| 77 |
},
|
| 78 |
}
|
| 79 |
output_type = "string"
|