mirror of
https://git.squeakyrat.moe/faggot-chan/
synced 2026-11-04 18:35:45 +01:00
trying a couple fixes without claude's help
This commit is contained in:
1 parent
387331d1af
commit
bc17bc956a
2 files changed
+6
-3
No files matched your search
@@ -213,7 +213,7 @@ async def geminichat(websocket):
|
||||
messages.append({"role": "user", "content": "\n".join(current_user_lines)})
|
||||
|
||||
# final isolated turn — the specific message she needs to reply to
|
||||
messages.append({"role": "user", "content": f"[responding to]: {nots(user_input)}\n(that is the newest message and the only one you answer, the lines above are just context. only the name that starts it is speaking to you, everyone else is someone else)"})
|
||||
messages.append({"role": "user", "content": f"[responding to]: {nots(user_input)}})
|
||||
|
||||
# make sure we start with a user turn (gemini rejects empty parts so no empty string here)
|
||||
if messages and messages[0]["role"] != "user":
|
||||
@@ -268,6 +268,9 @@ async def geminichat(websocket):
|
||||
reason = response.prompt_feedback.block_reason if response.prompt_feedback else None
|
||||
if not reason and response.candidates:
|
||||
reason = response.candidates[0].finish_reason
|
||||
if "PROHIBITED_CONTENT" in str(reason):
|
||||
await websocket.send(json.dumps({"ok": "google doesn't want me to reply to this :stocking:"}))
|
||||
continue
|
||||
raise RuntimeError(f"gemini returned no text ({reason})")
|
||||
|
||||
# strip <think> blocks just in case, thank you claude
|
||||
|
||||
@@ -120,7 +120,7 @@ async def ollamachat(websocket):
|
||||
return True
|
||||
return False
|
||||
|
||||
BOT_NAME = "Faggot-chan"
|
||||
BOT_NAME = "Faggot-chan" #i'll make this a variable later you can edit
|
||||
|
||||
# parse shortterm lines into (speaker, text) pairs
|
||||
def parse_line(line):
|
||||
@@ -173,7 +173,7 @@ async def ollamachat(websocket):
|
||||
messages.append({"role": "user", "content": "\n".join(current_user_lines)})
|
||||
|
||||
# final isolated turn — the specific message she needs to reply to
|
||||
messages.append({"role": "user", "content": f"[responding to]: {nots(user_input)}\n(that is the newest message and the only one you answer, the lines above are just context. only the name that starts it is speaking to you, everyone else is someone else)"})
|
||||
messages.append({"role": "user", "content": f"[responding to]: {nots(user_input)}})
|
||||
|
||||
# ollama only takes images (no audio/video/pdf), and only on the final turn so history stays text
|
||||
images = [base64.b64decode(m["data"]) for m in media if m["mime_type"].startswith("image/")]
|
||||
|
||||
Reference in new issue
Block a user