# from poe_api_wrapper import PoeApi | |
# import pprint | |
# client = PoeApi("sXvCnfYy8CHnXNTRlxhmVg==") | |
# # print(client.get_chat_history()['data']) | |
# bot = "gpt3_5" | |
# message = ''' hello''' | |
# # Create new chat thread | |
# # Streamed example: | |
# # for chunk in client.send_message(bot, message,chatCode='TWVzc2FnZTozMDY2MzYwNjQ5OQ=='): | |
# # pprint.pprint(chunk) | |
# # print("\n") | |
# # # Non-streamed example: | |
# for chunk in client.send_message(bot, message,chatCode=''): | |
# pass | |
# pprint.pprint(chunk) | |
# # You can get chatCode and chatId of created thread to continue the conversation | |
# chatCode = chunk["chatCode"] | |
# chatId = chunk["chatId"] | |
# # You can get the meaningful title as well | |
# title = chunk["title"] | |
# # Send message to an existing chat thread | |
# # 1. Using chatCode | |
# for chunk in client.send_message(bot, message, chatCode="2i58ciex72dom7im83r"): | |
# print(chunk["response"], end="", flush=True) | |
# 2. Using chatId | |
# for chunk in client.send_message(bot, message, chatId=59726162): | |
# print(chunk["response"], end="", flush=True) |