From 7623e25238eb61da885697f2e48d6118f9371a9d Mon Sep 17 00:00:00 2001 From: retoor Date: Wed, 13 Aug 2025 00:22:00 +0200 Subject: [PATCH] Update. --- examples/princess/princess.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/princess/princess.py b/examples/princess/princess.py index 6cc93f8..b350ae6 100644 --- a/examples/princess/princess.py +++ b/examples/princess/princess.py @@ -9,9 +9,10 @@ load_dotenv() import os from ads import AsyncDataSet -from devranta.api import Api from grk import GrokAPIClient +from devranta.api import Api + logging.basicConfig( level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(message)s" ) @@ -78,6 +79,7 @@ class Bot: if rant["user_username"] == username: rant["type"] = "rant" + rant["rant_id"] = rant["id"] results.append(rant) logging.info("Found rant by %s: %s", username, rant) @@ -105,7 +107,9 @@ class Bot: for obj in objects: print("Rant: \033[92m" + obj["text"] + "\033[0m") diss = await self.llm.chat_async(obj["text"]) + diss = f"@{obj['user_username']} {diss}" print("Response: \033[91m" + diss + "\033[0m") + await self.api.post_comment(obj["rant_id"], diss) await self.mark_responded(obj["text"], diss) async def run(self) -> None: @@ -125,7 +129,6 @@ async def main() -> None: target = os.getenv("TARGET") llm_key = os.getenv("LLM_KEY") - bot = Bot(username, password, target, llm_key) await bot.delete_responded() await bot.run()