Skip to content

Commit

Permalink
adding get_conversation()
Browse files Browse the repository at this point in the history
  • Loading branch information
Didier Durand committed Feb 27, 2024
1 parent 43565b6 commit 6c880e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/q_list_conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ def list_conversations_with_messages(app_id: str = "", usr_id: str = "", verbose
return None


def get_q_conversation(app_id: str = "", usr_id: str = "", cnv_id="", verbose=False) -> dict | None:
convs = list_conversations_with_messages(app_id, usr_id, verbose)
for conv in convs:
if conv["conversationId"] == cnv_id:
return conv
return None


if __name__ == "__main__":
parser = argparse.ArgumentParser(description="list documents indexed by Amazon Q")
parser.add_argument("-a", "--app_id", type=str, help="Q application id")
Expand Down

0 comments on commit 6c880e6

Please sign in to comment.