removed test
Browse files- App/Chat/utils/test.py +34 -0
App/Chat/utils/test.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# from poe_api_wrapper import PoeApi
|
| 2 |
+
# import pprint
|
| 3 |
+
# client = PoeApi("sXvCnfYy8CHnXNTRlxhmVg==")
|
| 4 |
+
# # print(client.get_chat_history()['data'])
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
# bot = "gpt3_5"
|
| 9 |
+
# message = ''' hello'''
|
| 10 |
+
# # Create new chat thread
|
| 11 |
+
# # Streamed example:
|
| 12 |
+
# # for chunk in client.send_message(bot, message,chatCode='TWVzc2FnZTozMDY2MzYwNjQ5OQ=='):
|
| 13 |
+
# # pprint.pprint(chunk)
|
| 14 |
+
# # print("\n")
|
| 15 |
+
|
| 16 |
+
# # # Non-streamed example:
|
| 17 |
+
# for chunk in client.send_message(bot, message,chatCode=''):
|
| 18 |
+
# pass
|
| 19 |
+
|
| 20 |
+
# pprint.pprint(chunk)
|
| 21 |
+
|
| 22 |
+
# # You can get chatCode and chatId of created thread to continue the conversation
|
| 23 |
+
# chatCode = chunk["chatCode"]
|
| 24 |
+
# chatId = chunk["chatId"]
|
| 25 |
+
# # You can get the meaningful title as well
|
| 26 |
+
# title = chunk["title"]
|
| 27 |
+
|
| 28 |
+
# # Send message to an existing chat thread
|
| 29 |
+
# # 1. Using chatCode
|
| 30 |
+
# for chunk in client.send_message(bot, message, chatCode="2i58ciex72dom7im83r"):
|
| 31 |
+
# print(chunk["response"], end="", flush=True)
|
| 32 |
+
# 2. Using chatId
|
| 33 |
+
# for chunk in client.send_message(bot, message, chatId=59726162):
|
| 34 |
+
# print(chunk["response"], end="", flush=True)
|