Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created July 23, 2025 01:11
Show Gist options
  • Select an option

  • Save KyMidd/054f45fff753fec13c22b6dba3caf0a9 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/054f45fff753fec13c22b6dba3caf0a9 to your computer and use it in GitHub Desktop.
def message_handler(event_body, bot_bearer_token, user_graph_auth_token, bedrock_client):
# ...
# Walk the previous messages to build conversation context
# If personal chat, we only read most recent message, on history. Too hard to break out of context
# For Teams channels, we read messages back in the channel/post/thread/whatever-they-called-it-now
conversation = get_teams_conversation_history(user_graph_auth_token, event_body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment