|
|
@@ -0,0 +1,30 @@ |
|
|
|
import time |
|
|
|
from bot.bot import Bot |
|
|
|
from revChatGPT.revChatGPT import Chatbot |
|
|
|
|
|
|
|
config = { |
|
|
|
"Authorization": "<Your Bearer Token Here>", # This is optional |
|
|
|
"session_token": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0.._BniuRSwMqdGn8t2.Hv_C4nsWF1FWnVGxNs19YZOGLDIWFlyC3FeLlTE9HUEgV1M8IFmhz1aH0j40vutVTzoEv3JDSEZN8je4kzewXE5tcKqhQF_Jh0SSHNL52OdRe_tqu_aE61L39NkvxEkmMRP2teXmWtiBIGtrPX3B77IbHIyqx9Kbk17awwl_WJokr39KlWhHE-Mpf9AwPvOW4UPi2csIxVNsVFW6MjxffRL8QZAqhXaeVlAnpjlpfJrK1B9TRoH7wkj0Q4nQ4MMhenvKXQHhOaa2tfTC79BeOBr8d60b2HPGCiOZuYc4vCqehXRl4VA7_JF9EKEmhgBQAPp0J1LFTC-3i0ZVAUX4zud8UEAsAwkjknQx7BHx9_QUOGil5I4U84WWzsGKxNNj1Jhi3z877V6d90CrTQax_yuuNzV9wb7j_RYx5EbO1MKmOPvL1iksa7xm0SYWsK2fYUID2vW2cE0nAavnGyi7g2-Lf83ARyWAmU8puuEweuEbsS_-1-IP6b3rtapOoZWfWmW74Mm6mmdxBIldrKHTDK8rJanjbp5Dho4YdJaTlAo7Mlg6fwpFk5i-2_QPr-s2E141hLCAhbKFQ6OTKfv3yugF1OoOG0IsXy49yuq3ezznDhtArYgZ6mj-DfHaQakuYrw9aHsfHebiVZ6tuwr_lZr73AuwneD0wGc1sk5nTYqFGn-E9ZC3kgng5Sa_CrOg2RhuNPsuDDsDuJ22ANilQprmDR0N8J-2ASlqkyf_af23QWwaEmjj8pcDrg_FWs7-6Qdju4pSFcLbtbAFh9ORi5SD463LxGxHsRPNCL9LfUZFrVFYVfTKk3mGtb7XQ80p7L1O7_ix6UkiastENknqH-cwk6HCW8VKf2ASp28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a7QC_53f8laQPMnT4c1M1d1yITarmtL9n6cL0Ku096w3c-4735yk-mYpds0KaAclU9_7NjcznEcY3NHRr0LxwxoV6-ClHFO6Ccqgxyk-Kng0J3oGYwgY4QBPuSCphvf9PmbhABeLILx0i-_eeI3gOfAKbZUGDweftoG1Lw7qgB14KOX1fig69PFxp8dGApMOTJvQeXWN7ISPlDZRfmRkSbO5siDsTS4WS01qcgdc_2osmN8aMyB_bP-FG4v3CF8z6Cpp6x-iIyXdHS_riNGydbf5-Et1e5nlYTRAVW4Cgf-P_AAZH82PGIpWsPWO3Lsisli1IdVSHi5Vxfj8OzzE0aC5CuXzvCv18KwCyDgHZ2AZeqGkBHPyptmXyIPspaSlRtq7H7j5w57deaOmJVjHM.iOPoBiz9LmbJxxXkoKyzfQ" |
|
|
|
} |
|
|
|
|
|
|
|
last_replay_time = time.time() |
|
|
|
chatbot = Chatbot(config) |
|
|
|
|
|
|
|
|
|
|
|
class ChatGPTBot(Bot): |
|
|
|
def reply(self, query): |
|
|
|
global last_replay_time |
|
|
|
now = time.time() |
|
|
|
if now - last_replay_time > 60 * 10: |
|
|
|
chatbot.refresh_session() |
|
|
|
last_replay_time = now |
|
|
|
|
|
|
|
res = chatbot.get_chat_response(query, output="text") |
|
|
|
# print(res) |
|
|
|
return res['message'] |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
|
|
|
|
bot = ChatGPTBot() |
|
|
|
print(bot.reply('讲一个故事')) |