Sephfox commited on
Commit
2141f7e
·
verified ·
1 Parent(s): 9a34b02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +86 -75
app.py CHANGED
@@ -304,23 +304,35 @@ with col2:
304
 
305
  """
306
  st.code(data_display, language="")
307
- # First, create a template string with placeholders
308
- prompt_template = "Human: Analyze the sensory input for a hyper-advanced AI humanoid:\n"
309
- prompt_template += " Location: ({}, {})\n"
310
- prompt_template += " Duration: {}s, Intensity: {}\n"
311
- prompt_template += " Pressure: {}\n"
312
- prompt_template += " Temperature: {}\N{DEGREE SIGN}C\n"
313
- prompt_template += " Texture: {}\n"
314
- prompt_template += " EM Field: {} μT\n"
315
- prompt_template += " Quantum State: {}\n"
316
- prompt_template += " Resulting in:\n"
317
- prompt_template += " Pain: {}, Pleasure: {}\n"
318
- prompt_template += " Tickle: {}, Itch: {}\n"
319
- prompt_template += " Proprioception: {}\n"
320
- prompt_template += " Synesthesia: {}\n"
321
- prompt_template += " Neural Response: {}\n"
322
- prompt_template += " Provide a detailed, scientific, and creative description of the AI humanoid's experience and response to this sensory input.\n\n"
323
- prompt_template += "The interaction at coordinates ({touch_x:.1f}, {touch_y:.1f}) has triggered a cascade of sensory information. The pressure of {measured_pressure:.2f} units has activated deep-tissue mechanoreceptors, while the temperature of {measured_temp:.2f}\N{DEGREE SIGN}C has stimulated thermoreceptors, creating a mild thermal gradient across the affected area.\n"
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
  # First, format each value individually
326
  touch_x_str = f"{touch_x:.1f}"
@@ -339,75 +351,74 @@ neural_response_str = f"{neural_response:.2f}"
339
 
340
  # Then, create the prompt using these pre-formatted values
341
  prompt = prompt_template.format(
342
- touch_x_str, touch_y_str,
343
- touch_duration_str, touch_pressure_str,
344
- measured_pressure_str, measured_temp_str,
345
- measured_texture, measured_em_str, quantum_state,
346
- pain_level_str, pleasure_level_str,
347
- tickle_level_str, itch_level_str,
348
- proprioception_str, synesthesia, neural_response_str
349
  )
350
 
 
 
 
351
 
352
- # You can use this prompt to generate a response from your AI model
353
- # For demonstration, let's create a mock AI response
354
- ai_response = f"""Based on the complex sensory input received, the hyper-advanced AI humanoid is experiencing a multifaceted neural response:
355
 
356
- The interaction at coordinates ({{touch_x:.1f}}, {{touch_y:.1f}}) has triggered a cascade of sensory information. The pressure of {{measured_pressure:.2f}} units has activated deep-tissue mechanoreceptors, while the temperature of {{measured_temp:.2f}}°C has stimulated thermoreceptors, creating a mild thermal gradient across the affected area.
357
 
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:.2f}} μ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:.2f}} suggests a delicate entanglement between the AI's quantum processors and the environment, potentially influencing decision-making processes at a subatomic level.
361
 
362
- The resulting pain level of {{pain_level:.2f}} and pleasure level of {{pleasure_level:.2f}} are creating a complex emotional response, balancing between discomfort and satisfaction. The tickle sensation ({{tickle_level:.2f}}) and itch response ({{itch_level:.2f}}) add layers of nuance to the overall tactile experience.
363
 
364
- The proprioception value of {{proprioception:.2f}} 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.
365
 
366
- {"The synesthesia rating of " + str(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."}
367
 
368
- The cumulative neural response of {{neural_response:.2f}} 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.
369
-
370
- 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.
371
- """
372
 
373
- st.write("AI Response:")
374
- st.write(ai_response)
375
-
376
- # Update autonomy
377
- sensory_input = {
378
- 'pain': pain_level,
379
- 'pleasure': pleasure_level,
380
- 'intensity': touch_pressure,
381
- 'duration': touch_duration,
382
- 'location': (touch_x, touch_y)
383
- }
384
- st.session_state.autonomy.update_state(sensory_input)
385
-
386
- # Display autonomy state
387
- st.write("### Autonomy State")
388
- st.write(f"Mood: {st.session_state.autonomy.mood:.2f}")
389
- st.write(f"Energy: {st.session_state.autonomy.energy:.2f}")
390
- st.write(f"Curiosity: {st.session_state.autonomy.curiosity:.2f}")
391
-
392
- # Display decision
393
- decision = st.session_state.autonomy.decide_action()
394
- st.write(f"Decision: {decision}")
395
-
396
- # Save interaction
397
- if st.button("Save Interaction"):
398
- interaction_data = {
399
- "timestamp": datetime.now().isoformat(),
400
- "sensory_input": sensory_input,
401
- "ai_state": {
402
- "mood": st.session_state.autonomy.mood,
403
- "energy": st.session_state.autonomy.energy,
404
- "curiosity": st.session_state.autonomy.curiosity
405
- },
406
- "ai_response": ai_response,
407
- "decision": decision
408
- }
409
- saved_file = save_interaction(interaction_data)
410
- st.success(f"Interaction saved to {saved_file}")
411
 
412
  # Display recent interactions
413
  st.subheader("Recent Interactions")
 
304
 
305
  """
306
  st.code(data_display, language="")
307
+ # First, create a template string with placeholders
308
+ prompt_template = """Human: Analyze the sensory input for a hyper-advanced AI humanoid:
309
+ Location: ({touch_x:.1f}, {touch_y:.1f})
310
+ Duration: {touch_duration:.1f}s, Intensity: {touch_pressure:.2f}
311
+ Pressure: {measured_pressure:.2f}
312
+ Temperature: {measured_temp:.2f}\N{DEGREE SIGN}C
313
+ Texture: {measured_texture}
314
+ EM Field: {measured_em:.2f} μT
315
+ Quantum State: {quantum_state}
316
+ Resulting in:
317
+ Pain: {pain_level:.2f}, Pleasure: {pleasure_level:.2f}
318
+ Tickle: {tickle_level:.2f}, Itch: {itch_level:.2f}
319
+ Proprioception: {proprioception:.2f}
320
+ Synesthesia: {synesthesia}
321
+ Neural Response: {neural_response:.2f}
322
+ Provide a detailed, scientific, and creative description of the AI humanoid's experience and response to this sensory input.
323
+
324
+ The interaction at coordinates ({touch_x:.1f}, {touch_y:.1f}) has triggered a cascade of sensory information. The pressure of {measured_pressure:.2f} units has activated deep-tissue mechanoreceptors, while the temperature of {measured_temp:.2f}\N{DEGREE SIGN}C has stimulated thermoreceptors, creating a mild thermal gradient across the affected area.
325
+
326
+ 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:.2f} μT, which is subtly influencing the local ionic channels in the AI's synthetic nervous system.
327
+
328
+ 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.
329
+ The resulting pain level of {pain_level:.2f} and pleasure level of {pleasure_level:.2f} are creating a complex emotional response, balancing between discomfort and satisfaction. The tickle sensation ({tickle_level:.2f}) and itch response ({itch_level:.2f}) add layers of nuance to the overall tactile experience.
330
+ The proprioception value of {proprioception:.2f} 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.
331
+
332
+ {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."}
333
+
334
+ The cumulative neural response of {neural_response:.2f} 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.
335
+ 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."""
336
 
337
  # First, format each value individually
338
  touch_x_str = f"{touch_x:.1f}"
 
351
 
352
  # Then, create the prompt using these pre-formatted values
353
  prompt = prompt_template.format(
354
+ touch_x=touch_x_str, touch_y=touch_y_str,
355
+ touch_duration=touch_duration_str, touch_pressure=touch_pressure_str,
356
+ measured_pressure=measured_pressure_str, measured_temp=measured_temp_str,
357
+ measured_texture=measured_texture, measured_em=measured_em_str, quantum_state=quantum_state,
358
+ pain_level=pain_level_str, pleasure_level=pleasure_level_str,
359
+ tickle_level=tickle_level_str, itch_level=itch_level_str,
360
+ proprioception=proprioception_str, synesthesia=synesthesia, neural_response=neural_response_str
361
  )
362
 
363
+ # You can use this prompt to generate a response from your AI model
364
+ # For demonstration, let's create a mock AI response
365
+ ai_response = f"""Based on the complex sensory input received, the hyper-advanced AI humanoid is experiencing a multifaceted neural response:
366
 
367
+ The interaction at coordinates ({touch_x:.1f}, {touch_y:.1f}) has triggered a cascade of sensory information. The pressure of {measured_pressure:.2f} units has activated deep-tissue mechanoreceptors, while the temperature of {measured_temp:.2f}\N{DEGREE SIGN}C has stimulated thermoreceptors, creating a mild thermal gradient across the affected area.
 
 
368
 
369
+ 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:.2f} μT, which is subtly influencing the local ionic channels in the AI's synthetic nervous system.
370
 
371
+ 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.
372
 
373
+ The resulting pain level of {pain_level:.2f} and pleasure level of {pleasure_level:.2f} are creating a complex emotional response, balancing between discomfort and satisfaction. The tickle sensation ({tickle_level:.2f}) and itch response ({itch_level:.2f}) add layers of nuance to the overall tactile experience.
374
 
375
+ The proprioception value of {proprioception:.2f} 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.
376
 
377
+ {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."}
378
 
379
+ The cumulative neural response of {neural_response:.2f} 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.
380
 
381
+ 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.
382
+ """
 
 
383
 
384
+ st.write("AI Response:")
385
+ st.write(ai_response)
386
+
387
+ # Update autonomy
388
+ sensory_input = {
389
+ 'pain': pain_level,
390
+ 'pleasure': pleasure_level,
391
+ 'intensity': touch_pressure,
392
+ 'duration': touch_duration,
393
+ 'location': (touch_x, touch_y)
394
+ }
395
+ st.session_state.autonomy.update_state(sensory_input)
396
+
397
+ # Display autonomy state
398
+ st.write("### Autonomy State")
399
+ st.write(f"Mood: {st.session_state.autonomy.mood:.2f}")
400
+ st.write(f"Energy: {st.session_state.autonomy.energy:.2f}")
401
+ st.write(f"Curiosity: {st.session_state.autonomy.curiosity:.2f}")
402
+
403
+ # Display decision
404
+ decision = st.session_state.autonomy.decide_action()
405
+ st.write(f"Decision: {decision}")
406
+
407
+ # Save interaction
408
+ if st.button("Save Interaction"):
409
+ interaction_data = {
410
+ "timestamp": datetime.now().isoformat(),
411
+ "sensory_input": sensory_input,
412
+ "ai_state": {
413
+ "mood": st.session_state.autonomy.mood,
414
+ "energy": st.session_state.autonomy.energy,
415
+ "curiosity": st.session_state.autonomy.curiosity
416
+ },
417
+ "ai_response": ai_response,
418
+ "decision": decision
419
+ }
420
+ saved_file = save_interaction(interaction_data)
421
+ st.success(f"Interaction saved to {saved_file}")
422
 
423
  # Display recent interactions
424
  st.subheader("Recent Interactions")