Spaces:
Sleeping
Sleeping
Commit
·
6a3bea4
1
Parent(s):
68adf80
Add recipient email selection to proposal generation and update documentation
Browse files- .env.example +0 -1
- custom-gpt-action.yaml +8 -0
- instructions.md +8 -0
- src/__init__.py +0 -3
- src/app.py +9 -2
.env.example
CHANGED
|
@@ -3,4 +3,3 @@ SMTP_PORT=
|
|
| 3 |
SMTP_USERNAME=
|
| 4 |
SMTP_PASSWORD=
|
| 5 |
SENDER_EMAIL=
|
| 6 |
-
RECIPIENT_EMAIL=
|
|
|
|
| 3 |
SMTP_USERNAME=
|
| 4 |
SMTP_PASSWORD=
|
| 5 |
SENDER_EMAIL=
|
|
|
custom-gpt-action.yaml
CHANGED
|
@@ -57,6 +57,7 @@ components:
|
|
| 57 |
- licensing_model
|
| 58 |
- risk_analysis
|
| 59 |
- past_projects
|
|
|
|
| 60 |
properties:
|
| 61 |
project_name:
|
| 62 |
type: string
|
|
@@ -255,3 +256,10 @@ components:
|
|
| 255 |
Sifars has a proven track record of delivering innovative software solutions that drive business growth and transformation. Two projects that align closely with the requirements of the **MyCares** application are:
|
| 256 |
1. HealthTrack: A comprehensive health management platform that integrates AI-based health tracking, personalized recommendations, and social engagement features. HealthTrack has successfully empowered users to take control of their well-being and connect with healthcare professionals for personalized care.
|
| 257 |
2. SocialConnect: A social networking application that leverages AI algorithms for content curation, user engagement analysis, and personalized recommendations. SocialConnect has revolutionized social media interactions by providing a tailored experience for users based on their preferences and interests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
- licensing_model
|
| 58 |
- risk_analysis
|
| 59 |
- past_projects
|
| 60 |
+
- recipient_email
|
| 61 |
properties:
|
| 62 |
project_name:
|
| 63 |
type: string
|
|
|
|
| 256 |
Sifars has a proven track record of delivering innovative software solutions that drive business growth and transformation. Two projects that align closely with the requirements of the **MyCares** application are:
|
| 257 |
1. HealthTrack: A comprehensive health management platform that integrates AI-based health tracking, personalized recommendations, and social engagement features. HealthTrack has successfully empowered users to take control of their well-being and connect with healthcare professionals for personalized care.
|
| 258 |
2. SocialConnect: A social networking application that leverages AI algorithms for content curation, user engagement analysis, and personalized recommendations. SocialConnect has revolutionized social media interactions by providing a tailored experience for users based on their preferences and interests.
|
| 259 |
+
recipient_email:
|
| 260 |
+
type: string
|
| 261 |
+
description: 'Select the recipient email from the predefined list of emails.'
|
| 262 |
+
enum:
|
| 263 |
+
- sukhwinder@sifars.com
|
| 264 |
+
- munish@sifars.com
|
| 265 |
+
- jatin@sifars.com
|
instructions.md
CHANGED
|
@@ -108,6 +108,14 @@ You are an AI-powered proposal generator responsible for crafting professional,
|
|
| 108 |
- Solution provided
|
| 109 |
- Impact & results
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
---
|
| 112 |
|
| 113 |
## **Additional Notes:**
|
|
|
|
| 108 |
- Solution provided
|
| 109 |
- Impact & results
|
| 110 |
|
| 111 |
+
### **15. Recipient Email**
|
| 112 |
+
|
| 113 |
+
- Enum:
|
| 114 |
+
- sukhwinder@sifars.com
|
| 115 |
+
- munish@sifars.com
|
| 116 |
+
- jatin@sifars.com
|
| 117 |
+
- Choose the appropriate recipient email for the proposal.
|
| 118 |
+
|
| 119 |
---
|
| 120 |
|
| 121 |
## **Additional Notes:**
|
src/__init__.py
CHANGED
|
@@ -21,9 +21,6 @@ if not os.getenv("SMTP_PASSWORD"):
|
|
| 21 |
if not os.getenv("SENDER_EMAIL"):
|
| 22 |
raise ValueError("SENDER_EMAIL environment not set.")
|
| 23 |
|
| 24 |
-
if not os.getenv("RECIPIENT_EMAIL"):
|
| 25 |
-
raise ValueError("RECIPIENT_EMAIL environment not set.")
|
| 26 |
-
|
| 27 |
__all__ = ["app"]
|
| 28 |
__version__ = "0.1.0"
|
| 29 |
__author__ = "Kanha Upadhyay"
|
|
|
|
| 21 |
if not os.getenv("SENDER_EMAIL"):
|
| 22 |
raise ValueError("SENDER_EMAIL environment not set.")
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
__all__ = ["app"]
|
| 25 |
__version__ = "0.1.0"
|
| 26 |
__author__ = "Kanha Upadhyay"
|
src/app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
import os
|
| 2 |
import re
|
| 3 |
import tempfile
|
|
|
|
| 4 |
|
| 5 |
import pypandoc
|
| 6 |
from fastapi import FastAPI, HTTPException
|
|
@@ -20,6 +20,12 @@ TEMPLATE = TEMPLATE.replace("`", "")
|
|
| 20 |
VARIABLES = re.findall(r"\{(.*?)\}", TEMPLATE)
|
| 21 |
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
class ProposalRequest(BaseModel):
|
| 24 |
project_name: str
|
| 25 |
project_overview: str
|
|
@@ -35,6 +41,7 @@ class ProposalRequest(BaseModel):
|
|
| 35 |
licensing_model: str
|
| 36 |
risk_analysis: str
|
| 37 |
past_projects: str
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
async def generate_proposal(data: dict):
|
|
@@ -50,7 +57,7 @@ async def generate_proposal(data: dict):
|
|
| 50 |
docx_file_path = temp_file.name.replace(".md", ".docx")
|
| 51 |
pypandoc.convert_file(temp_file.name, "docx", outputfile=docx_file_path)
|
| 52 |
attachments = [docx_file_path]
|
| 53 |
-
recipient_email =
|
| 54 |
subject = f"Proposal for {data.get('project_name')}"
|
| 55 |
body = f"Hello,\n\nPlease find the proposal attached.\n\nBest,\nProposal Bot"
|
| 56 |
async with EmailClient() as email_client:
|
|
|
|
|
|
|
| 1 |
import re
|
| 2 |
import tempfile
|
| 3 |
+
from enum import Enum
|
| 4 |
|
| 5 |
import pypandoc
|
| 6 |
from fastapi import FastAPI, HTTPException
|
|
|
|
| 20 |
VARIABLES = re.findall(r"\{(.*?)\}", TEMPLATE)
|
| 21 |
|
| 22 |
|
| 23 |
+
class Email(str, Enum):
|
| 24 |
+
sukhwinder = "sukhwinder@sifars.com"
|
| 25 |
+
munish = "munish@sifars.com"
|
| 26 |
+
jatin = "jatin@sifars.com"
|
| 27 |
+
|
| 28 |
+
|
| 29 |
class ProposalRequest(BaseModel):
|
| 30 |
project_name: str
|
| 31 |
project_overview: str
|
|
|
|
| 41 |
licensing_model: str
|
| 42 |
risk_analysis: str
|
| 43 |
past_projects: str
|
| 44 |
+
recipient_email: Email
|
| 45 |
|
| 46 |
|
| 47 |
async def generate_proposal(data: dict):
|
|
|
|
| 57 |
docx_file_path = temp_file.name.replace(".md", ".docx")
|
| 58 |
pypandoc.convert_file(temp_file.name, "docx", outputfile=docx_file_path)
|
| 59 |
attachments = [docx_file_path]
|
| 60 |
+
recipient_email = data.get("recipient_email", "sukhwinder@sifars.com")
|
| 61 |
subject = f"Proposal for {data.get('project_name')}"
|
| 62 |
body = f"Hello,\n\nPlease find the proposal attached.\n\nBest,\nProposal Bot"
|
| 63 |
async with EmailClient() as email_client:
|