Spaces:
Running
Running
Refactor and fix markdown rendering issues
Browse files- formatting.py +3 -2
- services.py +6 -2
formatting.py
CHANGED
@@ -30,9 +30,10 @@ def parse_pcs_descriptions(taxonomy: List[Dict[str, Any]]) -> str:
|
|
30 |
reasons = []
|
31 |
|
32 |
for term in taxonomy:
|
33 |
-
|
|
|
34 |
reasons.append(f"- For <b>{term.get('description')}</b>")
|
35 |
-
elif
|
36 |
reasons.append(f"- Serving <b>{term.get('description')}</b>")
|
37 |
return '\n'.join(reasons)
|
38 |
|
|
|
30 |
reasons = []
|
31 |
|
32 |
for term in taxonomy:
|
33 |
+
facet = (term.get("facet") or "").lower()
|
34 |
+
if facet == "subject":
|
35 |
reasons.append(f"- For <b>{term.get('description')}</b>")
|
36 |
+
elif facet == "population":
|
37 |
reasons.append(f"- Serving <b>{term.get('description')}</b>")
|
38 |
return '\n'.join(reasons)
|
39 |
|
services.py
CHANGED
@@ -1,7 +1,11 @@
|
|
1 |
import os
|
2 |
|
3 |
-
|
4 |
-
from common.base.
|
|
|
|
|
|
|
|
|
5 |
|
6 |
|
7 |
class RfpRecommend(BaseAPI):
|
|
|
1 |
import os
|
2 |
|
3 |
+
try:
|
4 |
+
from common.base.api_base_async import BaseAsyncAPI
|
5 |
+
from common.base.api_base import BaseAPI
|
6 |
+
except ImportError:
|
7 |
+
from ..common.base.api_base_async import BaseAsyncAPI
|
8 |
+
from ..common.base.api_base import BaseAPI
|
9 |
|
10 |
|
11 |
class RfpRecommend(BaseAPI):
|