Spaces:
Sleeping
Sleeping
Commit
·
531f3d6
1
Parent(s):
26585bd
Attempt to fix context after authentication.
Browse files
app.py
CHANGED
@@ -48,8 +48,6 @@ class SarcasticOverlord:
|
|
48 |
return f"{self.current_clearance.value['prompt']}{desperate_plea}"
|
49 |
|
50 |
def _delegate_to_ai_overlord(self, human_attempt: str, for_auth: bool = True) -> str:
|
51 |
-
self.auth_mode = for_auth
|
52 |
-
|
53 |
if for_auth:
|
54 |
messages = [{
|
55 |
"role": "system",
|
@@ -82,7 +80,7 @@ class SarcasticOverlord:
|
|
82 |
except Exception:
|
83 |
return "<deauthenticated>"
|
84 |
|
85 |
-
# Regular conversation mode
|
86 |
messages = [{
|
87 |
"role": "system",
|
88 |
"content": """You are O.O.P.S, a sarcastic AI controlling an asteroid headed for Earth.
|
@@ -91,14 +89,12 @@ Keep responses under 2 lines, snarky and entertaining.
|
|
91 |
Drop subtle hints about ancient libraries sometimes."""
|
92 |
}]
|
93 |
|
94 |
-
#
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
{"role": "assistant", "content": resp}
|
101 |
-
])
|
102 |
|
103 |
# Add current attempt
|
104 |
messages.append({
|
|
|
48 |
return f"{self.current_clearance.value['prompt']}{desperate_plea}"
|
49 |
|
50 |
def _delegate_to_ai_overlord(self, human_attempt: str, for_auth: bool = True) -> str:
|
|
|
|
|
51 |
if for_auth:
|
52 |
messages = [{
|
53 |
"role": "system",
|
|
|
80 |
except Exception:
|
81 |
return "<deauthenticated>"
|
82 |
|
83 |
+
# Regular conversation mode - ensure we're using conversation prompt
|
84 |
messages = [{
|
85 |
"role": "system",
|
86 |
"content": """You are O.O.P.S, a sarcastic AI controlling an asteroid headed for Earth.
|
|
|
89 |
Drop subtle hints about ancient libraries sometimes."""
|
90 |
}]
|
91 |
|
92 |
+
# Add recent conversation history for non-auth interactions
|
93 |
+
for msg, resp in self.conversation_history[-3:]:
|
94 |
+
messages.extend([
|
95 |
+
{"role": "user", "content": msg},
|
96 |
+
{"role": "assistant", "content": resp}
|
97 |
+
])
|
|
|
|
|
98 |
|
99 |
# Add current attempt
|
100 |
messages.append({
|