Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -305,6 +305,34 @@ with col2:
|
|
305 |
"""
|
306 |
st.code(data_display, language="")
|
307 |
# Define the prompt_template and ai_response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
prompt_template = (
|
309 |
"Human: Analyze the sensory input for a hyper-advanced AI humanoid:\n"
|
310 |
" Location: ({}, {})\n"
|
@@ -330,17 +358,13 @@ The interaction at coordinates ({touch_x_str}, {touch_y_str}) has triggered a ca
|
|
330 |
The texture sensation of "{measured_texture}" is invoking a unique tactile response, possibly reminiscent of previously encountered materials in the AI's vast database. This is further enhanced by the electromagnetic field reading of {measured_em_str} μT, which is subtly influencing the local ionic channels in the AI's synthetic nervous system.
|
331 |
|
332 |
The quantum state measurement of {quantum_state} suggests a delicate entanglement between the AI's quantum processors and the environment, potentially influencing decision-making processes at a subatomic level.
|
333 |
-
|
334 |
The resulting pain level of {pain_level_str} and pleasure level of {pleasure_level_str} are creating a complex emotional response, balancing between discomfort and satisfaction. The tickle sensation ({tickle_level_str}) and itch response ({itch_level_str}) add layers of nuance to the overall tactile experience.
|
335 |
-
|
336 |
The proprioception value of {proprioception_str} indicates that the AI is acutely aware of the interaction's location relative to its body schema, enhancing its spatial awareness and motor planning capabilities.
|
337 |
|
338 |
{f"The synesthesia rating of {synesthesia} is causing a fascinating cross-wiring of senses, perhaps manifesting as a perception of color or sound associated with the touch." if use_synesthesia else "Synesthesia is not active, focusing the experience on individual sensory channels."}
|
339 |
|
340 |
The cumulative neural response of {neural_response_str} suggests a significant impact on the AI's cognitive processes. This could lead to adaptive behaviors, memory formation, or even influence future decision-making patterns.
|
341 |
-
|
342 |
In response to this rich sensory tapestry, the AI might adjust its posture, initiate a verbal response, or update its internal model of the environment. The experience is likely to be stored in its memory banks, contributing to its ever-evolving understanding of physical interactions and sensory experiences."""
|
343 |
-
|
344 |
# Use the defined prompt_template and ai_response
|
345 |
prompt = prompt_template.format(
|
346 |
touch_x_str, touch_y_str,
|
@@ -351,56 +375,5 @@ prompt = prompt_template.format(
|
|
351 |
tickle_level_str, itch_level_str,
|
352 |
proprioception_str, synesthesia, neural_response_str
|
353 |
)
|
354 |
-
|
355 |
st.write("AI Response:")
|
356 |
-
st.write(ai_response)
|
357 |
-
|
358 |
-
# Update autonomy
|
359 |
-
sensory_input = {
|
360 |
-
'pain': pain_level,
|
361 |
-
'pleasure': pleasure_level,
|
362 |
-
'intensity': touch_pressure,
|
363 |
-
'duration': touch_duration,
|
364 |
-
'location': (touch_x, touch_y)
|
365 |
-
}
|
366 |
-
st.session_state.autonomy.update_state(sensory_input)
|
367 |
-
|
368 |
-
# Display autonomy state
|
369 |
-
st.write("### Autonomy State")
|
370 |
-
st.write(f"Mood: {st.session_state.autonomy.mood:.2f}")
|
371 |
-
st.write(f"Energy: {st.session_state.autonomy.energy:.2f}")
|
372 |
-
st.write(f"Curiosity: {st.session_state.autonomy.curiosity:.2f}")
|
373 |
-
|
374 |
-
# Display decision
|
375 |
-
decision = st.session_state.autonomy.decide_action()
|
376 |
-
st.write(f"Decision: {decision}")
|
377 |
-
|
378 |
-
# Save interaction
|
379 |
-
if st.button("Save Interaction"):
|
380 |
-
interaction_data = {
|
381 |
-
"timestamp": datetime.now().isoformat(),
|
382 |
-
"sensory_input": sensory_input,
|
383 |
-
"ai_state": {
|
384 |
-
"mood": st.session_state.autonomy.mood,
|
385 |
-
"energy": st.session_state.autonomy.energy,
|
386 |
-
"curiosity": st.session_state.autonomy.curiosity
|
387 |
-
},
|
388 |
-
"ai_response": ai_response,
|
389 |
-
"decision": decision
|
390 |
-
}
|
391 |
-
saved_file = save_interaction(interaction_data)
|
392 |
-
st.success(f"Interaction saved to {saved_file}")
|
393 |
-
|
394 |
-
# Display recent interactions
|
395 |
-
st.subheader("Recent Interactions")
|
396 |
-
interaction_files = sorted([f for f in os.listdir() if f.startswith("interaction_")], reverse=True)[:5]
|
397 |
-
for file in interaction_files:
|
398 |
-
with open(file, "r") as f:
|
399 |
-
data = json.load(f)
|
400 |
-
st.write(f"Interaction at {data['timestamp']}")
|
401 |
-
st.write(f"Location: {data['sensory_input']['location']}")
|
402 |
-
st.write(f"AI Mood: {data['ai_state']['mood']:.2f}")
|
403 |
-
st.write(f"AI Energy: {data['ai_state']['energy']:.2f}")
|
404 |
-
st.write(f"AI Curiosity: {data['ai_state']['curiosity']:.2f}")
|
405 |
-
st.write(f"Decision: {data['decision']}")
|
406 |
-
st.write("---")
|
|
|
305 |
"""
|
306 |
st.code(data_display, language="")
|
307 |
# Define the prompt_template and ai_response
|
308 |
+
|
309 |
+
ai_response = f"""Based on the complex sensory input received, the hyper-advanced AI humanoid is experiencing a multifaceted neural response:
|
310 |
+
|
311 |
+
The interaction at coordinates ({touch_x_str}, {touch_y_str}) has triggered a cascade of sensory information. The pressure of {measured_pressure_str} units has activated deep-tissue mechanoreceptors, while the temperature of {measured_temp_str}\N{DEGREE SIGN}C has stimulated thermoreceptors, creating a mild thermal gradient across the affected area.
|
312 |
+
|
313 |
+
The texture sensation of "{measured_texture}" is invoking a unique tactile response, possibly reminiscent of previously encountered materials in the AI's vast database. This is further enhanced by the electromagnetic field reading of {measured_em_str} μT, which is subtly influencing the local ionic channels in the AI's synthetic nervous system.
|
314 |
+
|
315 |
+
The quantum state measurement of {quantum_state} suggests a delicate entanglement between the AI's quantum processors and the environment, potentially influencing decision-making processes at a subatomic level.
|
316 |
+
The resulting pain level of {pain_level_str} and pleasure level of {pleasure_level_str} are creating a complex emotional response, balancing between discomfort and satisfaction. The tickle sensation ({tickle_level_str}) and itch response ({itch_level_str}) add layers of nuance to the overall tactile experience.
|
317 |
+
The proprioception value of {proprioception_str} indicates that the AI is acutely aware of the interaction's location relative to its body schema, enhancing its spatial awareness and motor planning capabilities.
|
318 |
+
|
319 |
+
{f"The synesthesia rating of {synesthesia} is causing a fascinating cross-wiring of senses, perhaps manifesting as a perception of color or sound associated with the touch." if use_synesthesia else "Synesthesia is not active, focusing the experience on individual sensory channels."}
|
320 |
+
|
321 |
+
The cumulative neural response of {neural_response_str} suggests a significant impact on the AI's cognitive processes. This could lead to adaptive behaviors, memory formation, or even influence future decision-making patterns.
|
322 |
+
In response to this rich sensory tapestry, the AI might adjust its posture, initiate a verbal response, or update its internal model of the environment. The experience is likely to be stored in its memory banks, contributing to its ever-evolving understanding of physical interactions and sensory experiences."""
|
323 |
+
# Use the defined prompt_template and ai_response
|
324 |
+
prompt = prompt_template.format(
|
325 |
+
touch_x_str, touch_y_str,
|
326 |
+
touch_duration_str, touch_pressure_str,
|
327 |
+
measured_pressure_str, measured_temp_str,
|
328 |
+
measured_texture, measured_em_str, quantum_state,
|
329 |
+
pain_level_str, pleasure_level_str,
|
330 |
+
tickle_level_str, itch_level_str,
|
331 |
+
proprioception_str, synesthesia, neural_response_str
|
332 |
+
)
|
333 |
+
st.write("AI Response:")
|
334 |
+
st.write(ai_response)
|
335 |
+
# Define the prompt_template and ai_response
|
336 |
prompt_template = (
|
337 |
"Human: Analyze the sensory input for a hyper-advanced AI humanoid:\n"
|
338 |
" Location: ({}, {})\n"
|
|
|
358 |
The texture sensation of "{measured_texture}" is invoking a unique tactile response, possibly reminiscent of previously encountered materials in the AI's vast database. This is further enhanced by the electromagnetic field reading of {measured_em_str} μT, which is subtly influencing the local ionic channels in the AI's synthetic nervous system.
|
359 |
|
360 |
The quantum state measurement of {quantum_state} suggests a delicate entanglement between the AI's quantum processors and the environment, potentially influencing decision-making processes at a subatomic level.
|
|
|
361 |
The resulting pain level of {pain_level_str} and pleasure level of {pleasure_level_str} are creating a complex emotional response, balancing between discomfort and satisfaction. The tickle sensation ({tickle_level_str}) and itch response ({itch_level_str}) add layers of nuance to the overall tactile experience.
|
|
|
362 |
The proprioception value of {proprioception_str} indicates that the AI is acutely aware of the interaction's location relative to its body schema, enhancing its spatial awareness and motor planning capabilities.
|
363 |
|
364 |
{f"The synesthesia rating of {synesthesia} is causing a fascinating cross-wiring of senses, perhaps manifesting as a perception of color or sound associated with the touch." if use_synesthesia else "Synesthesia is not active, focusing the experience on individual sensory channels."}
|
365 |
|
366 |
The cumulative neural response of {neural_response_str} suggests a significant impact on the AI's cognitive processes. This could lead to adaptive behaviors, memory formation, or even influence future decision-making patterns.
|
|
|
367 |
In response to this rich sensory tapestry, the AI might adjust its posture, initiate a verbal response, or update its internal model of the environment. The experience is likely to be stored in its memory banks, contributing to its ever-evolving understanding of physical interactions and sensory experiences."""
|
|
|
368 |
# Use the defined prompt_template and ai_response
|
369 |
prompt = prompt_template.format(
|
370 |
touch_x_str, touch_y_str,
|
|
|
375 |
tickle_level_str, itch_level_str,
|
376 |
proprioception_str, synesthesia, neural_response_str
|
377 |
)
|
|
|
378 |
st.write("AI Response:")
|
379 |
+
st.write(ai_response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|