Skip to content

Commit

Permalink
change to hackmit
Browse files Browse the repository at this point in the history
  • Loading branch information
azliu0 committed Jun 26, 2024
1 parent dd9d0cb commit a9799b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions client/src/routes/inbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ export default function InboxPage() {
.filter(
(email) =>
email.sender ===
'"Blueprint Team" <blueprint@my.hackmit.org>',
'"HackMIT Team" <hackmit@my.hackmit.org>',
)
.map((email) => activeThread.emailList.indexOf(email)),
)}
Expand All @@ -713,7 +713,7 @@ export default function InboxPage() {
key={email.id}
bullet={
email.sender ===
'"Blueprint Team" <blueprint@my.hackmit.org>' && (
'"HackMIT Team" <hackmit@my.hackmit.org>' && (
<ThemeIcon
size={20}
color="blue"
Expand Down
2 changes: 1 addition & 1 deletion server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _get_config_option(name: str, default_value: str | None = None) -> str:
MAIL_PASSWORD = _get_config_option("MAIL_PASSWORD", "test_mail_password")
MAIL_CC = _get_config_option("MAIL_CC", "test_mail_cc")

MAIL_SENDER_TAG = f'"Blueprint Team" <{MAIL_USERNAME}>'
MAIL_SENDER_TAG = f'"HackMIT Team" <{MAIL_USERNAME}>'

AUTH_CLIENT_ID = _get_config_option("AUTH_CLIENT_ID", "test_auth_client_id")
AUTH_CLIENT_SECRET = _get_config_option("AUTH_CLIENT_SECRET", "test_auth_client_secret")
Expand Down
8 changes: 4 additions & 4 deletions server/controllers/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ def receive_email():
print(
"data from",
data["From"],
"blueprint@my.hackmit.org" not in data["From"],
"hackmit@my.hackmit.org" not in data["From"],
flush=True,
)
if "blueprint@my.hackmit.org" not in data["From"] and replied_to_email:
if "hackmit@my.hackmit.org" not in data["From"] and replied_to_email:
thread = db.session.execute(
select(Thread).where(Thread.id == replied_to_email.thread_id)
).scalar()
Expand Down Expand Up @@ -400,7 +400,7 @@ def send_email():
msg = email.mime.multipart.MIMEMultipart()
msg["Subject"] = reply_to_email.subject
# msg["FROM"] = MAIL_SENDER_TAG
msg["FROM"] = '"Blueprint Team" <blueprint@my.hackmit.org>'
msg["FROM"] = '"HackMIT Team" <hackmit@my.hackmit.org>'
msg["In-Reply-To"] = reply_to_email.message_id
msg["References"] = reply_to_email.message_id
to_email_addresses = [thread.first_sender, MAIL_CC]
Expand All @@ -426,7 +426,7 @@ def send_email():
thread.resolved = True
reply_email = Email(
datetime.now(timezone.utc),
'"Blueprint Team" <blueprint@my.hackmit.org>',
'"HackMIT Team" <hackmit@my.hackmit.org>',
reply_to_email.subject,
clean_text,
get_full_message_id(response["MessageId"]),
Expand Down
9 changes: 4 additions & 5 deletions server/nlp/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

openai.api_key = OPENAI_API_KEY

MODEL = "gpt-3.5-turbo"
MODEL = "gpt-4o"


def openai_response(thread: list[OpenAIMessage], sender: str) -> str:
Expand All @@ -32,13 +32,12 @@ def openai_response(thread: list[OpenAIMessage], sender: str) -> str:
messages = [
{
"role": "system",
"content": f"You are an organizer for Blueprint, a hackathon for high \
schoolers led by the organizers of HackMIT. You are responsible for \
"content": f"You are an organizer for HackMIT. You are responsible for \
responding to an email from a participant. \
Please write an email response to the participant. Begin the email with \
the header 'Dear [First Name]' where '[First Name]' is the participant's \
first name and end the email with the footer 'Best regards, The Blueprint \
Team'. Do not include the subject line in your response. \
first name and end the email with the footer 'Best regards, The \
HackMIT Team'. Do not include the subject line in your response. \
The participant's email address is {sender}.\
You receive documents to help you answer the email. \
Please do not include information that is not explicitly stated in the \
Expand Down

0 comments on commit a9799b6

Please sign in to comment.