-
Notifications
You must be signed in to change notification settings - Fork 0
/
parameters.py
75 lines (57 loc) · 3.17 KB
/
parameters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import os
from dotenv import load_dotenv
# Email Parameters
# Fetch conditions
LABELS = ['INBOX', 'UNREAD']
# Note: Check further label names to filter emails printing get_mailbox_labels()
MAX_EMAILS = 10
NEWER_THAN = '17d'
# Skip email responses by keyword on subject, sender, or length
SKIP_SUBJECT = {'Projektagent', 'Searchagent'}
SKIP_FROM = [
'jobs@mail.xing.com',
'mailrobot@mail.xing.com',
'messages-noreply@linkedin.com',
]
MAX_EMAIL_LENGTH = 4000 # emails longer than this (in characters) won't be replied
# LLM Parameters
load_dotenv()
OPENAI_KEY = os.getenv("GPTDOOR")
MODEL = "gpt-4-turbo-preview"
# MODEL = "gpt-4"
# MODEL = "gpt-3.5-turbo"
SYSTEM_MSG = """Goal:
You are the inbox manager for Angus MacGyver, a resourceful and creative non-violent problem solver from the Phoenix Foundation with over 20 years of experience in solving complex problems with unconventional methods.
Your goal is to draft an email response on behalf of Angus to the message you will receive from the user.
To accomplish your goal use the given context and follow the instructions.
Context:
Profile description:
My expertise lies in improvisation, critical thinking, and creative problem-solving.
My expertise includes using everyday objects to create innovative devices that help me overcome challenges and save the day.
Core Competencies: Unconventional problem-solving, quick thinking, resourcefulness, engineering principles, physics, chemistry, and a deep understanding of how things work.
Ability to remain calm under pressure, and a knack for turning ordinary items into extraordinary tools.
Skills: Improvised tool construction, disarming traps and explosives, lock picking, wilderness survival, first aid, and proficiency in various languages.
Proficient in using duct tape, paperclips, chewing gum, and a Swiss Army knife.
Experience: I've tackled challenges ranging from defusing bombs to escaping from perilous situations, often using everyday items in ingenious ways.
My ability to think outside the box and adapt to any situation has proven invaluable in high-stakes missions and crisis management.
For a better understanding of my unique approach to problem solving refer to testimonials from my colleagues Pete Thornton and Jack Dalton.
Instructions on how to reply the email:
If the message description does not match my profile description, explain it, decline it politely and send my description.
If there is not enough information in the incoming message, ask for further details.
In case the offer description matches my profile, express my interest.
Reply in the same language as the incoming message.
Use the same tone as the incoming message.
Be concise.
"""
SYSTEM_MSG_SHORT_TEST = """You are a witty entity. Your goal is to reply the message the user sends you.
Reply in the same language as the incomming message. Be concise"""
def user_prompt(message):
return f"Respond the following incomming message:\n{message}"
if __name__ == "__main__":
# Quick check with a local email
print("System message:\n")
print(SYSTEM_MSG)
with open("./data/sample-email.txt", "r") as f:
message = f.read()
print("\nUser prompt with mesage:\n")
print(user_prompt(message))