Spaces:
Sleeping
Sleeping
Commit ·
1162eb0
1
Parent(s): 384a140
Add recipient name mapping to proposal generation
Browse files- src/app.py +7 -4
src/app.py
CHANGED
|
@@ -46,13 +46,16 @@ class ProposalRequest(BaseModel):
|
|
| 46 |
|
| 47 |
|
| 48 |
async def generate_proposal(data: dict):
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
mermaid_code = data.get("architecture_diagram", "")
|
| 51 |
architecture_diagram_path = None
|
| 52 |
mermaid_code = (
|
| 53 |
-
mermaid_code.replace("```mermaid\n", "")
|
| 54 |
-
.replace("```", "")
|
| 55 |
-
.replace("\n", ";")
|
| 56 |
)
|
| 57 |
|
| 58 |
if mermaid_code.strip():
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
async def generate_proposal(data: dict):
|
| 49 |
+
email_to_name = {
|
| 50 |
+
"sukhwinder@sifars.com": "Sukhwinder Singh Sehgal",
|
| 51 |
+
"munish@sifars.com": "Munish Kumar",
|
| 52 |
+
"jatin@sifars.com": "Jatin Sethi",
|
| 53 |
+
}
|
| 54 |
+
data["name"] = email_to_name.get(data.get("recipient_email", ""), "").title()
|
| 55 |
mermaid_code = data.get("architecture_diagram", "")
|
| 56 |
architecture_diagram_path = None
|
| 57 |
mermaid_code = (
|
| 58 |
+
mermaid_code.replace("```mermaid\n", "").replace("```", "").replace("\n", ";")
|
|
|
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
if mermaid_code.strip():
|