Skip to content

Commit

Permalink
Ref #36 -- Add additional instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa-anm committed Apr 17, 2024
1 parent 55278f4 commit f11aa38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sam/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ def handle_message(event: {str, Any}, say: Say):
channel_type = event["channel_type"]
user_id = event["user"]
text = event["text"]
profile = say.client.users_profile_get(user=user_id)
name = profile["profile"]["display_name"]
email = profile["profile"]["email"]
additional_instructions = f"Always say the user name {name} when replying"
additional_instructions += (
f"\nIf you are being asked about the email it is: {email}"
)
text += f"\n{additional_instructions}"
text = text.replace(f"<@{USER_HANDLE}>", "Sam")
thread_id = utils.get_thread_id(channel_id)
# We may only add messages to a thread while the assistant is not running
Expand Down
1 change: 1 addition & 0 deletions slack-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ oauth_config:
- chat:write
- commands
- users:read
- users.profile:read
- files:read
- files:write
- reactions:write
Expand Down

0 comments on commit f11aa38

Please sign in to comment.