repo: lumina action: commit revision: path_from: revision_from: 5f8e3fec72b53ba2cedaa589c0e83cfc2c7ea493: path_to: revision_to:
commit 5f8e3fec72b53ba2cedaa589c0e83cfc2c7ea493 Author: epochDate: Sun Sep 14 15:43:09 2025 -0500 put api port into a variable. join multiple channels instead of just one. diff --git a/lumina.py b/lumina.py
--- a/lumina.py
+++ b/lumina.py
@@ -4,6 +4,10 @@ import socket
import requests
import json
+channels=["#default","#llm"]
+
+api_port=8080
+
s=socket.socket()
s.connect(("21.41.41.5",6667))
s.send(b"NICK lumina\r\n")
@@ -56,9 +60,11 @@ while True:
user,host=x.split(b"@")
print("nick: {} user: {} host: {}".format(nick.decode(), user.decode(), host.decode()))
if a[1] == b"005":
- s.send(b"JOIN #default\r\n")
+ for channel in channels:
+ s.send("JOIN {}\r\n".format(channel).encode())
if a[1] == b"KICK":
- s.send(b"JOIN #default\r\n") # let's just try to rejoin on /any/ KICK we see.
+ for channel in channels:
+ s.send("JOIN {}\r\n".format(channel).encode())
if a[0] == b"PING":
s.send("PONG :{}\r\n".format(b" ".join(a[1:])).encode())
if a[1] == b"PRIVMSG":
@@ -77,7 +83,7 @@ while True:
msg=msg.split(b" ",maxsplit=1)[1]
print("{} <{}!{}@{}> {}".format(target.decode(),nick.decode(), user.decode(), host.decode(), msg.decode()))
req["prompt"]+="\n\nUser: {}\nLumina:".format(msg.decode())
- httpresp = requests.post( "http://127.0.0.1:8080/completion", json=req )
+ httpresp = requests.post( "http://127.0.0.1:{}/completion".format( api_port ), json=req )
resp = json.loads(httpresp.content)["content"].replace("<|eot_id|>","")
req["prompt"] += resp
for l in resp.split("\n"):
-----END OF PAGE-----