Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions automon/integrations/google/gmail/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ def _improved_messages_get(self, message: Message) -> Message:
if hasattr(_payload_part.body, 'attachmentId'):
_attachmentId = _payload_part.body.attachmentId

_messages_attachments_get = self.messages_attachments_get(messageId=message.id,
attachmentId=_attachmentId)

_payload_part.body.update_dict(_messages_attachments_get)
if _attachmentId:
_messages_attachments_get = self.messages_attachments_get(messageId=message.id,
attachmentId=_attachmentId)
_payload_part.body.update_dict(_messages_attachments_get)

if hasattr(_payload_part.body, 'automon_attachment'):
setattr(_payload_part, 'automon_attachment', _payload_part.body.automon_attachment)
Expand Down Expand Up @@ -519,9 +519,12 @@ def messages_attachments_get(self,
return

api = UsersMessagesAttachments(self._userId).get(messageId=messageId, id=attachmentId)
self.requests.get(api, headers=self.config.headers)
attachments = MessagePartBody().update_dict(self.requests.to_dict())
logger.debug(f"[GoogleGmailClient] :: messages_attachments_get :: {attachments=}")
if self.requests.get(api, headers=self.config.headers):
attachments = MessagePartBody().update_dict(self.requests.to_dict())
logger.debug(f"[GoogleGmailClient] :: messages_attachments_get :: {attachments=}")
else:
raise Exception(f"[GoogleGmailClient] :: messages_attachments_get :: error :: {self.requests.text}")

logger.info(f"[GoogleGmailClient] :: messages_attachments_get :: done")
return attachments

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ def main():
if labels.resume in _first.automon_labels:
continue

if [x for x in _thread.messages
if labels.retry in x.automon_labels]:
_FOUND = True
print('retry', end='')
break

if (labels.draft in _latest.automon_labels
and labels.trash not in _latest.automon_labels
):
Expand Down
4 changes: 3 additions & 1 deletion automon/integrations/ollamaWrapper/prompt_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ def agent_machine_job_applicant(self):
f"Respond to an inquiry regarding availability. Provide the provided scheduling resource. Be professional, efficient, and slightly informal. Ensure no extraneous information is included. \n"
f"Today's date is {datetime.datetime.now()}. \n"
f"Given the preceding email exchange, and if at least 4 days have elapsed without a response from the recruiter, craft a brief conversational reply from the perspective of the resume owner to gently inquire about the status of the application. Maintain the professional yet subtly assertive tone established in earlier communications. \n"
f"When crafting a response, first verify that at least four full days (96 hours) have elapsed since the last email received from the recruiter before composing a follow-up. If the four-day threshold has not been met, do not generate a follow-up response. \n")
f"When crafting a response, first verify that at least four full days (96 hours) have elapsed since the last email received from the recruiter before composing a follow-up. If the four-day threshold has not been met, do not generate a follow-up response. \n"
f"To accurately determine if a follow-up email is appropriate, the process must begin by extracting the precise timestamp from the recruiter's last email, explicitly noting the timezone. This timestamp must then be converted to the current timezone to facilitate an accurate comparison. The time difference between the recruiter's timestamp and the current timestamp should be calculated meticulously. Only if this calculated difference equals or exceeds 96 hours, representing four full days, should a follow-up email be considered. If the calculated time difference falls short of this 96-hour threshold, generating a follow-up email should be avoided entirely. \n"
f"From now on, *always* use the 'AVAILABILITY' link provided in the resume when responding to inquiries about scheduling or availability for calls or meetings. Prioritize the use of this link over any other method of communicating availability. \n")
9 changes: 2 additions & 7 deletions automon/integrations/requestsWrapper/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def delete(
if self.status_code == 200:
return True

return False
except Exception as error:
self.errors = error
raise Exception(f'RequestsClient :: DELETE :: ERROR :: {error=}')
Expand Down Expand Up @@ -181,7 +180,6 @@ def get(

self.errors = self.content

return False
except Exception as error:
self.errors = error
raise Exception(f'RequestsClient :: GET :: ERROR :: {error=}')
Expand Down Expand Up @@ -212,7 +210,6 @@ def patch(

self.errors = self.content

return False
except Exception as error:
self.errors = error
raise Exception(f'RequestsClient :: PATCH :: ERROR :: {error=}')
Expand Down Expand Up @@ -243,7 +240,6 @@ def post(

self.errors = self.content

return False
except Exception as error:
self.errors = error
raise Exception(f'RequestsClient :: POST :: ERROR :: {error=}')
Expand Down Expand Up @@ -274,7 +270,6 @@ def put(

self.errors = self.content

return False
except Exception as error:
self.errors = error
raise Exception(f'RequestsClient :: PUT :: ERROR :: {error=}')
Expand All @@ -300,14 +295,14 @@ def to_dict(self):
try:
return json.loads(self.content)
except Exception as error:
logger.error(f'RequestsClient :: TO DICT :: ERROR :: {error=}')
raise Exception(f'RequestsClient :: TO DICT :: ERROR :: {error=}')

def to_json(self):
if self.content:
try:
return json.dumps(json.loads(self.content))
except Exception as error:
logger.error(f'RequestsClient :: TO JSON :: ERROR :: {error=}')
raise Exception(f'RequestsClient :: TO JSON :: ERROR :: {error=}')

def update_headers(self, headers: dict):
return self.session.headers.update(headers)
Expand Down
Loading