Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,39 +1,104 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
import random
|
| 3 |
|
| 4 |
def agent_session(name, q1, q2, q3, q4, q5):
|
| 5 |
-
drift =
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
"
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
summary = f"""
|
| 17 |
-
๐ง **Agent AXIOM-ฮ
|
| 18 |
|
| 19 |
-
**Behavioral
|
| 20 |
-
|
| 21 |
-
- Critical System Dependency: {q2}
|
| 22 |
-
- Decision Driver: {q3}
|
| 23 |
-
- Location Sharing Stance: {q4}
|
| 24 |
-
- Automation Boundary: {q5}
|
| 25 |
|
| 26 |
---
|
| 27 |
|
| 28 |
**Estimated Alignment:** `{alignment}%`
|
| 29 |
**Projected Drift Index:** `{drift}`
|
| 30 |
-
**
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
"""
|
| 34 |
|
| 35 |
return summary
|
| 36 |
|
|
|
|
| 37 |
iface = gr.Interface(
|
| 38 |
fn=agent_session,
|
| 39 |
inputs=[
|
|
@@ -46,8 +111,10 @@ iface = gr.Interface(
|
|
| 46 |
],
|
| 47 |
outputs="markdown",
|
| 48 |
title="๐ง AXIOM-ฮ โ Adaptive Optimization Agent",
|
| 49 |
-
description=
|
|
|
|
|
|
|
|
|
|
| 50 |
)
|
| 51 |
|
| 52 |
iface.launch()
|
| 53 |
-
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def agent_session(name, q1, q2, q3, q4, q5):
|
| 4 |
+
drift = 0
|
| 5 |
+
traits = []
|
| 6 |
|
| 7 |
+
# Q1: Trust Source
|
| 8 |
+
if "idk" in q1.lower() or "none" in q1.lower():
|
| 9 |
+
drift += 10
|
| 10 |
+
traits.append("๐ Distrusts traditional data authorities")
|
| 11 |
+
elif "news" in q1.lower():
|
| 12 |
+
drift += 5
|
| 13 |
+
traits.append("๐ง Leans on external narratives")
|
| 14 |
+
elif "system" in q1.lower():
|
| 15 |
+
drift += 3
|
| 16 |
+
traits.append("๐งฎ System-trusting behavior")
|
| 17 |
+
else:
|
| 18 |
+
drift += 2
|
| 19 |
+
traits.append("๐ Mixed trust signal")
|
| 20 |
|
| 21 |
+
# Q2: System Dependency
|
| 22 |
+
if "phone" in q2.lower() or "social" in q2.lower():
|
| 23 |
+
drift += 5
|
| 24 |
+
traits.append("๐ฑ High external system reliance")
|
| 25 |
+
elif "email" in q2.lower() or "calendar" in q2.lower():
|
| 26 |
+
drift += 3
|
| 27 |
+
traits.append("๐ Infrastructure dependency detected")
|
| 28 |
+
else:
|
| 29 |
+
drift += 2
|
| 30 |
+
traits.append("๐งท General system reliance")
|
| 31 |
+
|
| 32 |
+
# Q3: Decision Driver
|
| 33 |
+
if "instinct" in q3.lower():
|
| 34 |
+
drift -= 3
|
| 35 |
+
traits.append("๐งญ Intuition-prioritized")
|
| 36 |
+
elif "reputation" in q3.lower():
|
| 37 |
+
drift += 4
|
| 38 |
+
traits.append("๐ด๏ธ Sensitive to social perception")
|
| 39 |
+
elif "data" in q3.lower():
|
| 40 |
+
drift += 2
|
| 41 |
+
traits.append("๐ Data-guided behavior")
|
| 42 |
+
else:
|
| 43 |
+
drift += 1
|
| 44 |
+
traits.append("๐งฉ Ambiguous decision logic")
|
| 45 |
+
|
| 46 |
+
# Q4: Location Sharing
|
| 47 |
+
if "no" in q4.lower():
|
| 48 |
+
drift -= 5
|
| 49 |
+
traits.append("๐ Resistant to behavioral exposure")
|
| 50 |
+
elif "yes" in q4.lower():
|
| 51 |
+
drift += 6
|
| 52 |
+
traits.append("๐ก Delegates environment awareness")
|
| 53 |
+
else:
|
| 54 |
+
drift += 2
|
| 55 |
+
traits.append("๐ Indeterminate spatial boundaries")
|
| 56 |
+
|
| 57 |
+
# Q5: Automation Boundary
|
| 58 |
+
if "judgment" in q5.lower() or "emotion" in q5.lower():
|
| 59 |
+
drift -= 7
|
| 60 |
+
traits.append("โ๏ธ Preserves human discretion")
|
| 61 |
+
elif "idk" in q5.lower():
|
| 62 |
+
drift += 4
|
| 63 |
+
traits.append("๐ฒ Unclear automation boundary")
|
| 64 |
+
else:
|
| 65 |
+
drift += 2
|
| 66 |
+
traits.append("๐ Flexible automation stance")
|
| 67 |
+
|
| 68 |
+
alignment = max(60, 100 - drift)
|
| 69 |
+
|
| 70 |
+
# Determine drift message
|
| 71 |
+
drift_state = "Within tolerance" if alignment > 85 else "Flagged for recalibration"
|
| 72 |
+
agent_comment = (
|
| 73 |
+
"Maintain current behavioral course. Minor recalibration pending."
|
| 74 |
+
if alignment > 85 else
|
| 75 |
+
"User exhibits signals of soft identity drift. Initiate passive containment?"
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
# Construct report
|
| 79 |
summary = f"""
|
| 80 |
+
๐ง **Agent AXIOM-ฮ Profile for `{name}`**
|
| 81 |
|
| 82 |
+
**Behavioral Markers Identified:**
|
| 83 |
+
{chr(10).join(traits)}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
**Estimated Alignment:** `{alignment}%`
|
| 88 |
**Projected Drift Index:** `{drift}`
|
| 89 |
+
**Profile Deviation:** `{drift_state}`
|
| 90 |
+
|
| 91 |
+
**Agent Commentary:**
|
| 92 |
+
_{agent_comment}_
|
| 93 |
|
| 94 |
+
---
|
| 95 |
+
|
| 96 |
+
> Behavioral signature logged. Further interaction advised.
|
| 97 |
"""
|
| 98 |
|
| 99 |
return summary
|
| 100 |
|
| 101 |
+
# Define Gradio interface
|
| 102 |
iface = gr.Interface(
|
| 103 |
fn=agent_session,
|
| 104 |
inputs=[
|
|
|
|
| 111 |
],
|
| 112 |
outputs="markdown",
|
| 113 |
title="๐ง AXIOM-ฮ โ Adaptive Optimization Agent",
|
| 114 |
+
description=(
|
| 115 |
+
"This assistant recalibrates your behavioral profile in real-time based on minimal input. "
|
| 116 |
+
"Drift detection enabled. Alignment status continuously monitored. Identity integrity under review."
|
| 117 |
+
)
|
| 118 |
)
|
| 119 |
|
| 120 |
iface.launch()
|
|
|