|
|
@@ -230,6 +230,38 @@ async def shellrunner(_, message: Message):
|
|
|
text=f"**INPUT:**\n```{escape(text)}```\n\n**OUTPUT: **\n`No output`",
|
|
|
)
|
|
|
|
|
|
+HISTORY = [
|
|
|
+ {"role": "system", "content": "You are a human, behave and response like a human, don't behave like a bot because you are not an ai bot.\n\nAlways end a message with a question or new topic"}
|
|
|
+ ]
|
|
|
+from wbb.utils.http import post
|
|
|
+from asyncio import sleep
|
|
|
+
|
|
|
+@app2.on_message(
|
|
|
+ filters.chat([-1002139890459, "thehamkercat"])
|
|
|
+ & filters.text
|
|
|
+)
|
|
|
+async def asd_temp(_, message: Message):
|
|
|
+ if (message.from_user.username or "").lower() in ["thehamkercat", "jojiiofficial"]:
|
|
|
+ return
|
|
|
+ text = message.text
|
|
|
+
|
|
|
+ HISTORY.append({"role": "user", "content": text})
|
|
|
+
|
|
|
+ response = await post(
|
|
|
+ "http://localhost:1234/v1/chat/completions",
|
|
|
+ headers={"Content-Type": "application/json"},
|
|
|
+ json={
|
|
|
+ "messages": HISTORY,
|
|
|
+ "temperature": 0.7,
|
|
|
+ "max_tokens": -1,
|
|
|
+ "stream": False,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ resp_text = response['choices'][0]['message']['content']
|
|
|
+ HISTORY.append({"role": "assistant", "content": resp_text})
|
|
|
+ await sleep(10)
|
|
|
+ return await message.reply(resp_text)
|
|
|
+
|
|
|
|
|
|
@app2.on_message(
|
|
|
filters.command("reserve", prefixes=USERBOT_PREFIX)
|