├── pm ├── ghost.py ├── ghosts │ └── persist_yaml.py ├── agents │ ├── agent_manager.py │ └── definitions │ │ └── agent_select_codelets.py ├── llm │ ├── llm_manager.py │ └── emb_manager_transformer.py └── utils │ ├── emb_utils.py │ ├── token_utils.py │ ├── singleton_utils.py │ ├── exec_utils.py │ ├── profile_utils.py │ ├── image_utils.py │ ├── serialize_utils.py │ ├── cluster_utils.py │ └── system_utils.py ├── quest ├── camera_stream │ ├── app │ │ ├── .gitignore │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ ├── colors.xml │ │ │ │ │ │ └── themes.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-anydpi │ │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ │ ├── xml │ │ │ │ │ │ ├── backup_rules.xml │ │ │ │ │ │ └── data_extraction_rules.xml │ │ │ │ │ ├── values-night │ │ │ │ │ │ └── themes.xml │ │ │ │ │ ├── layout │ │ │ │ │ │ └── activity_main.xml │ │ │ │ │ └── drawable │ │ │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── flamingrickpat │ │ │ │ │ │ └── streamer │ │ │ │ │ │ └── NativeBridge.java │ │ │ │ ├── cpp │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── native_passthrough_streamer.h │ │ │ │ └── AndroidManifest.xml │ │ │ ├── test │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── flamingrickpat │ │ │ │ │ └── streamer │ │ │ │ │ └── ExampleUnitTest.java │ │ │ └── androidTest │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── flamingrickpat │ │ │ │ └── streamer │ │ │ │ └── ExampleInstrumentedTest.java │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── .idea │ │ ├── .name │ │ ├── .gitignore │ │ ├── compiler.xml │ │ ├── vcs.xml │ │ ├── AndroidProjectSystem.xml │ │ ├── migrations.xml │ │ ├── deploymentTargetSelector.xml │ │ ├── misc.xml │ │ ├── gradle.xml │ │ └── runConfigurations.xml │ ├── gradle │ │ ├── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ └── libs.versions.toml │ ├── build.gradle │ ├── .gitignore │ ├── settings.gradle │ └── gradle.properties ├── pm_client │ ├── Assets │ │ ├── Scripts │ │ │ ├── SharedData.cs.meta │ │ │ ├── PlayerController.cs.meta │ │ │ ├── RoomDataListener.cs.meta │ │ │ └── SharedData.cs │ │ ├── TutorialInfo │ │ │ ├── Icons │ │ │ │ └── URP.png │ │ │ ├── Layout.wlt.meta │ │ │ ├── Icons.meta │ │ │ ├── Scripts.meta │ │ │ └── Scripts │ │ │ │ ├── Editor.meta │ │ │ │ ├── Editor │ │ │ │ ├── ReadmeEditor.cs │ │ │ │ └── ReadmeEditor.cs.meta │ │ │ │ ├── Readme.cs │ │ │ │ └── Readme.cs.meta │ │ ├── Scenes.meta │ │ ├── Scenes │ │ │ └── SampleScene.unity.meta │ │ ├── Material.meta │ │ ├── Scripts.meta │ │ ├── Settings.meta │ │ ├── TutorialInfo.meta │ │ ├── Readme.asset.meta │ │ ├── Material │ │ │ └── Floor.mat.meta │ │ ├── Settings │ │ │ ├── Mobile_RPAsset.asset.meta │ │ │ ├── PC_RPAsset.asset.meta │ │ │ ├── PC_Renderer.asset.meta │ │ │ ├── SampleSceneProfile.asset.meta │ │ │ ├── Mobile_Renderer.asset.meta │ │ │ ├── DefaultVolumeProfile.asset.meta │ │ │ ├── UniversalRenderPipelineGlobalSettings.asset.meta │ │ │ └── Mobile_Renderer.asset │ │ ├── InputSystem_Actions.inputactions.meta │ │ └── Readme.asset │ ├── ProjectSettings │ │ ├── ProjectVersion.txt │ │ ├── ClusterInputManager.asset │ │ ├── PresetManager.asset │ │ ├── MultiplayerManager.asset │ │ ├── XRSettings.asset │ │ ├── VersionControlSettings.asset │ │ ├── TimeManager.asset │ │ ├── VFXManager.asset │ │ ├── EditorBuildSettings.asset │ │ ├── URPProjectSettings.asset │ │ ├── AudioManager.asset │ │ ├── ShaderGraphSettings.asset │ │ ├── TagManager.asset │ │ ├── UnityConnectSettings.asset │ │ ├── PackageManagerSettings.asset │ │ ├── MemorySettings.asset │ │ ├── DynamicsManager.asset │ │ ├── NavMeshAreas.asset │ │ ├── EditorSettings.asset │ │ └── Physics2DSettings.asset │ ├── .vsconfig │ └── Packages │ │ └── manifest.json └── pm_holo │ ├── Assets │ ├── Scripts │ │ ├── RoomLoader.cs.meta │ │ ├── RoomStreamer.cs.meta │ │ ├── SharedData.cs.meta │ │ ├── LoaderSettings.cs.meta │ │ ├── RoomVisualizer.cs.meta │ │ ├── SceneDataLoaderSettings.asset.meta │ │ ├── SceneDataLoaderSettings.asset │ │ ├── LoaderSettings.cs │ │ └── SharedData.cs │ ├── Scenes │ │ └── MainScene.unity.meta │ ├── XR.meta │ ├── MetaXR.meta │ ├── Oculus.meta │ ├── Plugins.meta │ ├── Prefabs.meta │ ├── Scenes.meta │ ├── Scripts.meta │ ├── Shaders.meta │ ├── Materials.meta │ ├── Prefabs │ │ └── RoomVisualizerPrefab.prefab.meta │ ├── Resources.meta │ ├── XR │ │ ├── Loaders.meta │ │ ├── Resources.meta │ │ ├── Settings.meta │ │ ├── UserSimulationSettings.meta │ │ ├── UserSimulationSettings │ │ │ ├── Resources.meta │ │ │ ├── Resources │ │ │ │ ├── XRSimulationPreferences.asset.meta │ │ │ │ └── XRSimulationPreferences.asset │ │ │ ├── SimulationEnvironmentAssetsManager.asset.meta │ │ │ └── SimulationEnvironmentAssetsManager.asset │ │ ├── Loaders │ │ │ ├── OpenXRLoader.asset.meta │ │ │ ├── SimulationLoader.asset.meta │ │ │ ├── OpenXRLoader.asset │ │ │ └── SimulationLoader.asset │ │ ├── Settings │ │ │ ├── OpenXR Editor Settings.asset.meta │ │ │ ├── OpenXR Package Settings.asset.meta │ │ │ ├── XRSimulationSettings.asset.meta │ │ │ ├── XRSimulationSettings.asset │ │ │ └── OpenXR Editor Settings.asset │ │ ├── XRGeneralSettingsPerBuildTarget.asset.meta │ │ └── Resources │ │ │ ├── XRSimulationRuntimeSettings.asset.meta │ │ │ └── XRSimulationRuntimeSettings.asset │ ├── CompositionLayers.meta │ ├── Plugins │ │ ├── Android.meta │ │ └── Android │ │ │ ├── AndroidManifest.xml.meta │ │ │ └── AndroidManifest.xml │ ├── StreamingAssets.meta │ ├── CompositionLayers │ │ ├── UserSettings.meta │ │ └── UserSettings │ │ │ ├── Resources.meta │ │ │ ├── CompositionLayersPreferences.asset.meta │ │ │ ├── Resources │ │ │ ├── CompositionLayersRuntimeSettings.asset.meta │ │ │ └── CompositionLayersRuntimeSettings.asset │ │ │ └── CompositionLayersPreferences.asset │ ├── DefaultVolumeProfile.asset.meta │ ├── Materials │ │ ├── WireframeMat.mat.meta │ │ └── WireframeMat.mat │ ├── Resources │ │ ├── InputActions.asset.meta │ │ ├── OVRBuildConfig.asset.meta │ │ ├── MetaXRAudioSettings.asset.meta │ │ ├── ImmersiveDebuggerSettings.asset.meta │ │ ├── MetaXRAcousticSettings.asset.meta │ │ ├── OVRPlatformToolSettings.asset.meta │ │ ├── OculusRuntimeSettings.asset.meta │ │ ├── MetaXRAcousticMaterialMapping.asset.meta │ │ ├── OVRBuildConfig.asset │ │ ├── MetaXRAudioSettings.asset │ │ ├── InputActions.asset │ │ ├── MetaXRAcousticMaterialMapping.asset │ │ ├── MetaXRAcousticSettings.asset │ │ ├── OVRPlatformToolSettings.asset │ │ ├── OculusRuntimeSettings.asset │ │ └── ImmersiveDebuggerSettings.asset │ ├── MetaXR │ │ ├── MetaXRProjectSettings.asset.meta │ │ └── MetaXRProjectSettings.asset │ ├── Oculus │ │ ├── OculusProjectConfig.asset.meta │ │ └── OculusProjectConfig.asset │ ├── UniversalRenderPipelineGlobalSettings.asset.meta │ ├── Shaders │ │ ├── MyWireframeShader.shader.meta │ │ └── MyWireframeShader.shader │ └── DefaultVolumeProfile.asset │ ├── TempAssembly.dll │ ├── .vsconfig │ ├── ProjectSettings │ ├── ProjectVersion.txt │ ├── XRPackageSettings.asset │ ├── Packages │ │ └── com.unity.testtools.codecoverage │ │ │ └── Settings.json │ ├── ClusterInputManager.asset │ ├── PresetManager.asset │ ├── MultiplayerManager.asset │ ├── VersionControlSettings.asset │ ├── TimeManager.asset │ ├── AudioManager.asset │ ├── EditorBuildSettings.asset │ ├── VFXManager.asset │ ├── ShaderGraphSettings.asset │ ├── TagManager.asset │ ├── UnityConnectSettings.asset │ ├── PackageManagerSettings.asset │ ├── MemorySettings.asset │ ├── DynamicsManager.asset │ ├── EditorSettings.asset │ ├── NavMeshAreas.asset │ └── Physics2DSettings.asset │ └── Packages │ └── manifest.json ├── pm_old ├── subsystem │ ├── sensation_evaluation │ │ ├── subsystem_feeligns_needs.py │ │ ├── subsystem_feelings_expectations.py │ │ ├── subsystem_feelings_sensation.py │ │ └── emotion │ │ │ └── emotion_state_evaluation.py │ ├── subsystem_base.py │ ├── create_action │ │ ├── user_reply │ │ │ └── subsystem_user_reply.py │ │ ├── int_contemplation │ │ │ └── subsystem_internal_contemplation.py │ │ ├── tool_call │ │ │ └── subsystem_tool_call.py │ │ └── sleep │ │ │ └── subsystem_sleep.py │ └── add_impulse │ │ └── subsystem_impulse_to_event.py ├── embedding │ ├── token.py │ └── embedding.py ├── nlp │ └── base_nlp.py ├── utils │ ├── enum_utils.py │ ├── pydantic_utils.py │ └── chat_utils.py ├── agent_schemas │ └── schema_base.py ├── common_prompts │ ├── get_tool_call.py │ ├── summary_perspective.py │ ├── rate_emotional_state.py │ ├── select_relevant_agents.py │ ├── get_narrative_analysis.py │ ├── rate_emotional_impact.py │ ├── rate_agent_output.py │ ├── extract_facts.py │ └── summarize_agent_conversation.py ├── database │ └── db_utils.py ├── agents_manager │ └── agent.py ├── system_classes.py ├── meta_learning │ ├── merge_outputs.py │ └── integrate_rules_final_output.py ├── ghost │ └── ghost_classes.py └── character.py ├── .env.example ├── requirements.txt ├── training ├── .gitignore ├── readme.md ├── adapter_constants.py ├── test_adapter_llamacpp.py ├── text_autoencoder │ └── bottleneck_autoencoder.py └── test_adapter_transformer.py ├── backtest.py ├── tests ├── test_llm_completion.py ├── test_llm_manger_visual.py ├── test_duplex_com.py ├── test_memquery_queries.py ├── test_llm_state_cache.py └── test_agent_manager.py ├── app_debug.py ├── LICENSE └── README.md /pm/ghost.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pm/ghosts/persist_yaml.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /quest/camera_stream/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /quest/camera_stream/.idea/.name: -------------------------------------------------------------------------------- 1 | PassthroughStreamerLib -------------------------------------------------------------------------------- /pm/agents/agent_manager.py: -------------------------------------------------------------------------------- 1 | class AgentManager: 2 | pass -------------------------------------------------------------------------------- /pm_old/subsystem/sensation_evaluation/subsystem_feeligns_needs.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pm_old/subsystem/sensation_evaluation/subsystem_feelings_expectations.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pm_old/subsystem/sensation_evaluation/subsystem_feelings_sensation.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | TELEGRAM_API_KEY= 2 | ALLOWED_CHAT_ID= -------------------------------------------------------------------------------- /quest/camera_stream/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/requirements.txt -------------------------------------------------------------------------------- /training/.gitignore: -------------------------------------------------------------------------------- 1 | /adapters 2 | /kv_store 3 | /trainer_output 4 | chat_history.jsonl 5 | *.json -------------------------------------------------------------------------------- /quest/pm_client/Assets/Scripts/SharedData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72a18eb8b0bc6354b8abffc578fbbda2 -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/RoomLoader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a34f6bb1bb060140bc9dc3656f19d18 -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/RoomStreamer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e6e6794d9f2d1445bdbfd2f8c0d12f0 -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/SharedData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 072b9c8253b611f49a4c40c2e70a0459 -------------------------------------------------------------------------------- /pm_old/embedding/token.py: -------------------------------------------------------------------------------- 1 | def get_token(text: str) -> int: 2 | tokens = int(len(text) / 4.5) 3 | return tokens -------------------------------------------------------------------------------- /quest/pm_client/Assets/Scripts/PlayerController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1506fab53e9a6d4888178894b335911 -------------------------------------------------------------------------------- /quest/pm_client/Assets/Scripts/RoomDataListener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15b9b690a79c6b14b91fc3fddf1cae86 -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/LoaderSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 749dee81fdc3b0f46af4bdea928ca0eb -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/RoomVisualizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d4a6a507f648fb47b8bf5c7b69d4860 -------------------------------------------------------------------------------- /quest/pm_holo/TempAssembly.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/pm_holo/TempAssembly.dll -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 6000.0.51f1 2 | m_EditorVersionWithRevision: 6000.0.51f1 (01c3ff5872c5) 3 | -------------------------------------------------------------------------------- /quest/pm_holo/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 6000.0.51f1 2 | m_EditorVersionWithRevision: 6000.0.51f1 (01c3ff5872c5) 3 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/XRPackageSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_Settings": [ 3 | "RemoveLegacyInputHelpersForReload" 4 | ] 5 | } -------------------------------------------------------------------------------- /pm_old/subsystem/sensation_evaluation/emotion/emotion_state_evaluation.py: -------------------------------------------------------------------------------- 1 | def emotional_state_evaluation(): 2 | 3 | 4 | 5 | 6 | pass 7 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | PassthroughStreamerLib 3 | -------------------------------------------------------------------------------- /quest/pm_client/.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /backtest.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from pm_lida import run_shell 4 | 5 | if __name__ == '__main__': 6 | db_path = sys.argv[1] 7 | run_shell(False, db_path) -------------------------------------------------------------------------------- /training/readme.md: -------------------------------------------------------------------------------- 1 | ### Bugs 2 | 3 | Rename adapter_config.json to config.json, add "model_type": "gemma3" and copy over the tokenizer files from my gemma3 folder. -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Icons/URP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/pm_client/Assets/TutorialInfo/Icons/URP.png -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [] 4 | } 5 | } -------------------------------------------------------------------------------- /quest/camera_stream/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /quest/camera_stream/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' version '8.2.2' apply false 3 | id 'com.android.library' version '8.2.2' apply false 4 | } -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flamingrickpat/private-machine/HEAD/quest/camera_stream/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /pm/llm/llm_manager.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | 3 | class LlmManager: 4 | def __init__(self, model_map: Dict[str, Any], test_mode: bool=False): 5 | self.test_mode = test_mode 6 | self.model_map = model_map -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scenes/MainScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2bfe3708bcf13c4c9c7fb23758126ec 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d6304b544027f84fb817de47c26948e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c53962885c2c4f449125a979d6ad240 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99c9720ab356a0642a771bea13969a05 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/MetaXR.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a2ae35bb8015364ab989e5a455704b5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Oculus.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75c72069e0a022546bc52d290b3db418 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ec61e188b8628f4fbb440d42bc79e03 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c70f3b76c311fcf4ab0c82f3e1e595c6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0756201a5321b241aad66517c88e010 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7594f3493a7a17c4fbe23e645587990d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b62399e4be335d43a078808e8ee98aa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Material.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b77a424595bce04db2782a95e93977c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d00604691bab577469dae13a28ca3d4c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 709f11a7f3c4041caa4ef136ea32d874 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_StrippingTypes: {} 8 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e4c6cbf29aa2254184729b0bf1df09b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Prefabs/RoomVisualizerPrefab.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f35cbd3020bcdc46b56c11126cf301d 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 94d48810b19e9504388110e4d4d17b73 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Loaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3188326f2e61161498f72ec76de8adf7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d111e7241b14f89469e0da5270bcd030 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Settings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89cf862bd55b35e4fa44efe314820c5d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_StrippingTypes: {} 8 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba062aa6c92b140379dbc06b43dd3b9b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/CompositionLayers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e398f23d1f2baf4f947bb9857827d53 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Plugins/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95b0a6231f6242846aeb3bec8a67318b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Plugins/Android/AndroidManifest.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c50101cf43a6e41479ee9a4e6c71d5bc 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/StreamingAssets.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37baf9b82d279ba41b4f7c50b4f8f63b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /quest/pm_client/Assets/Readme.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8105016687592461f977c054a80ce2f2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/UserSimulationSettings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32d266aac9791a14fbc6f22f1fee5915 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_TrackPackagesOutsideProject: 0 8 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Layout.wlt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eabc9546105bf4accac1fd62a63e88e6 3 | timeCreated: 1487337779 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/CompositionLayers/UserSettings.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0aa7005dfe9b30f4a8356bd574d5b8a3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Material/Floor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43b2035d35547314a947ab929fb01bd5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/UserSimulationSettings/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e889d60b176ab6c4ba31145c5b81fdae 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/CompositionLayers/UserSettings/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32b3b8635ea81ee46ad0e3dd9cdce5ea 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/DefaultVolumeProfile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8210d8cffc0bb8747a048e5ca54aefea 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Materials/WireframeMat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8362d37b7883ab46a577ba2c9f40754 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/Mobile_RPAsset.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e6cbd92db86f4b18aec3ed561671858 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/PC_RPAsset.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b83569d67af61e458304325a23e5dfd 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/PC_Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f288ae1f4751b564a96ac7587541f7a2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/SampleSceneProfile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10fc4df2da32a41aaa32d77bc913491c 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/InputActions.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1179bd0baffdae4096306ba24a43dc0 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/OVRBuildConfig.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8aa0c2a8d3160eb47b165f85868d55a6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/SceneDataLoaderSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29f8a2977af21af4fa2c5fe4e253d031 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Loaders/OpenXRLoader.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0da2d375f84ca1948911fba5f6c91abe 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/AndroidProjectSystem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/Mobile_Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65bc7dbf4170f435aa868c779acfb082 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/MetaXR/MetaXRProjectSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a9a582efe7fc9a4ea6682d13b7abc3b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Oculus/OculusProjectConfig.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e57a0f04e0fc0194eb8e3bb8d9273add 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/MetaXRAudioSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e39b09125c5d0745a4072b704aff344 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Loaders/SimulationLoader.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc77b1301f93ae343b7ff0a19c9e398d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/DefaultVolumeProfile.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab09877e2e707104187f6f83e2f62510 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Icons.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8a0c9218a650547d98138cd835033977 3 | folderAsset: yes 4 | timeCreated: 1484670163 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a9bcd70e6a4b4b05badaa72e827d8e0 3 | folderAsset: yes 4 | timeCreated: 1475835190 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/ImmersiveDebuggerSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81eb1d9ff2087a146b63dcb2ec3f164b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/MetaXRAcousticSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fcc8514ec712df49b3a47cb13506dd1 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/OVRPlatformToolSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d478bb7c98fa5247bc9752f99027e06 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/OculusRuntimeSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4dc781df7f697dd4c82d468a3925650d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Settings/OpenXR Editor Settings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71dfb2080c7359943b008c7b48ebbb34 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Settings/OpenXR Package Settings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b95fc28226f2ba4495714019162affc 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Settings/XRSimulationSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4b45d67975496f44b89daf7b1bbb850 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/XRGeneralSettingsPerBuildTarget.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44801fb4abaa6454296063b05b971759 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /training/adapter_constants.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | DEFAULT_MODEL = "/mnt/c/workspace/AI/gemma-3-12b-it-qat-q4_0-unquantized"#!/usr/bin/env python 4 | ADAPTER_DIR = Path("./adapters") 5 | KV_DIR = Path("./kv_store") 6 | HISTORY_FILE = Path("./chat_history.jsonl") -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/MetaXRAcousticMaterialMapping.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a63d97f3a4d7f2a448c899dd15cf9a1e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/UniversalRenderPipelineGlobalSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c9e7bad335238e42868e765b952ca8a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Resources/XRSimulationRuntimeSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db9890993176a3543a04f6848309423d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ad9b87dffba344c89909c6d1b1c17e1 3 | folderAsset: yes 4 | timeCreated: 1475593892 5 | licenseType: Store 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18dc0cd2c080841dea60987a38ce93fa 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /pm/utils/emb_utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from sentence_transformers.util import cos_sim 3 | 4 | 5 | def cosine_sim(a, b) -> float: 6 | return cos_sim(np.array(a, dtype=np.float32), np.array(b, dtype=np.float32)).tolist()[0][0] 7 | 8 | def cosine_dist(a, b) -> float: 9 | return 1 - cosine_sim(a, b) -------------------------------------------------------------------------------- /quest/pm_holo/Assets/CompositionLayers/UserSettings/CompositionLayersPreferences.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fe1cb32e145c3546a646defd05d2438 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/UserSimulationSettings/Resources/XRSimulationPreferences.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0387550b4f6a4cb4495cdba33aa57c7f 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/UserSimulationSettings/SimulationEnvironmentAssetsManager.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a17b0c637dab9540b085b88654323ec 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /quest/camera_stream/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 09 22:11:23 CEST 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | using System; 6 | using System.IO; 7 | using System.Reflection; 8 | 9 | public class ReadmeEditor : Editor 10 | { 11 | } 12 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/CompositionLayers/UserSettings/Resources/CompositionLayersRuntimeSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62c2b62262d46904c8b2132bcf388fc8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 11400000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /training/test_adapter_llamacpp.py: -------------------------------------------------------------------------------- 1 | from llama_cpp import Llama 2 | 3 | llm = Llama(model_path=r"C:\workspace\AI\gemma\qat\gemma-3-12b-it-q4_0.gguf", n_ctx=1024, lora_path=r"C:\workspace\private-machine\training\adapters\mem_0\Mem_0-F16-LoRA.gguf") 4 | print(llm.create_completion("Q: What color is the sky? A:", max_tokens=128)) -------------------------------------------------------------------------------- /quest/camera_stream/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Shaders/MyWireframeShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0528c23d1c817e47b672957f96085d1 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Scripts/Editor/ReadmeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 476cc7d7cd9874016adc216baab94a0a 3 | timeCreated: 1484146680 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/deploymentTargetSelector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | Fixed Timestep: 8 | m_Count: 2822399 9 | m_Rate: 10 | m_Denominator: 1 11 | m_Numerator: 141120000 12 | Maximum Allowed Timestep: 0.33333334 13 | m_TimeScale: 1 14 | Maximum Particle Timestep: 0.03 15 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-anydpi/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Scripts/Readme.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class Readme : ScriptableObject 5 | { 6 | public Texture2D icon; 7 | public string title; 8 | public Section[] sections; 9 | public bool loadedLayout; 10 | 11 | [Serializable] 12 | public class Section 13 | { 14 | public string heading, text, linkText, url; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/TutorialInfo/Scripts/Readme.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcf7219bab7fe46a1ad266029b2fee19 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: 7 | - icon: {instanceID: 0} 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: a186f8a87ca4f4d3aa864638ad5dfb65, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/java/com/flamingrickpat/streamer/NativeBridge.java: -------------------------------------------------------------------------------- 1 | package com.yourcompany.streamer; 2 | 3 | public class NativeBridge { 4 | static { 5 | System.loadLibrary("streamer"); 6 | } 7 | public native long nativeCreate(); 8 | public native void nativeStart(long handle, String ip, int port); 9 | public native void nativeStop(long handle); 10 | public native android.graphics.Bitmap nativeSnapshot(long handle, int eye); 11 | } 12 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/InputSystem_Actions.inputactions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 052faaac586de48259a63d0c4782560b 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} 11 | generateWrapperCode: 0 12 | wrapperCodePath: 13 | wrapperClassName: 14 | wrapperCodeNamespace: 15 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Loaders/OpenXRLoader.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d3552e428dc7646a88de3ed3650f87da, type: 3} 13 | m_Name: OpenXRLoader 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | m_configObjects: 12 | com.unity.input.settings.actions: {fileID: -944628639613478452, guid: 052faaac586de48259a63d0c4782560b, type: 3} 13 | m_UseUCBPForAssetBundles: 0 14 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/OVRBuildConfig.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 20553fac56ec59645857c0732b787431, type: 3} 13 | m_Name: OVRBuildConfig 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Loaders/SimulationLoader.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: df71837a07684b24082222c253aa156a, type: 3} 13 | m_Name: SimulationLoader 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/URPProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_LastMaterialVersion: 9 16 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Settings/XRSimulationSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: e0688bbae6cedcd4a871944e38c19ec0, type: 3} 13 | m_Name: XRSimulationSettings 14 | m_EditorClassIdentifier: 15 | -------------------------------------------------------------------------------- /pm/utils/token_utils.py: -------------------------------------------------------------------------------- 1 | import math 2 | 3 | 4 | def get_token_count(data: str, char_to_token_ratio: float = 3.5) -> int: 5 | """Estimates token count for a knoxel's content.""" 6 | if not data: 7 | return 1 # Minimal count for structure 8 | if not isinstance(data, str): 9 | try: 10 | data = data.get_story_element() 11 | except: 12 | data = str(data) 13 | # A common rough estimate is 3-4 characters per token. 14 | return math.ceil(len(data) / char_to_token_ratio) 15 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/DefaultVolumeProfile.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} 13 | m_Name: DefaultVolumeProfile 14 | m_EditorClassIdentifier: 15 | components: [] 16 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/test/java/com/flamingrickpat/streamer/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.flamingrickpat.streamer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/MetaXRAudioSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: f3fe6e38ac2d4c22b04340d6eda2a47e, type: 3} 13 | m_Name: MetaXRAudioSettings 14 | m_EditorClassIdentifier: 15 | voiceLimit: 64 16 | -------------------------------------------------------------------------------- /pm_old/nlp/base_nlp.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | 3 | 4 | class BaseNlp(ABC): 5 | @abstractmethod 6 | def get_doc(self, text: str): 7 | pass 8 | 9 | @abstractmethod 10 | def resolve_coreferences(self, text: str) -> str: 11 | pass 12 | 13 | @abstractmethod 14 | def convert_third_person_to_first_person(self, text: str, name: str) -> str: 15 | pass 16 | 17 | @abstractmethod 18 | def convert_third_person_to_instruction(self, text: str, name: str) -> str: 19 | pass 20 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/InputActions.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 8922a6ca86889d84f8371a29d37b6dc8, type: 3} 13 | m_Name: InputActions 14 | m_EditorClassIdentifier: 15 | InputActionDefinitions: [] 16 | InputActionSets: [] 17 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/MetaXRAcousticMaterialMapping.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 60e5406209e5ed147bb02ed71f9c40f3, type: 3} 13 | m_Name: MetaXRAcousticMaterialMapping 14 | m_EditorClassIdentifier: 15 | mapping: [] 16 | fallbackMaterial: {fileID: 0} 17 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_EnableOutputSuspension: 1 16 | m_SpatializerPlugin: Meta XR Audio 17 | m_AmbisonicDecoderPlugin: Meta XR Audio 18 | m_DisableAudio: 0 19 | m_VirtualizeEffects: 1 20 | m_RequestedDSPBufferSize: 0 21 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: 9 | com.unity.xr.arfoundation.simulation_settings: {fileID: 11400000, guid: a4b45d67975496f44b89daf7b1bbb850, type: 2} 10 | com.unity.xr.management.loader_settings: {fileID: 11400000, guid: 44801fb4abaa6454296063b05b971759, type: 2} 11 | com.unity.xr.openxr.settings4: {fileID: 11400000, guid: 4b95fc28226f2ba4495714019162affc, type: 2} 12 | m_UseUCBPForAssetBundles: 0 13 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_EmptyShader: {fileID: 0} 11 | m_RenderPipeSettingsPath: 12 | m_FixedTimeStep: 0.016666668 13 | m_MaxDeltaTime: 0.05 14 | m_MaxScrubTime: 30 15 | m_MaxCapacity: 100000000 16 | m_CompiledVersion: 0 17 | m_RuntimeVersion: 0 18 | m_RuntimeResources: {fileID: 0} 19 | m_BatchEmptyLifetime: 300 20 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/MetaXRAcousticSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 2b76bcf034ab49e4a8cd30239a716460, type: 3} 13 | m_Name: MetaXRAcousticSettings 14 | m_EditorClassIdentifier: 15 | acousticModel: -1 16 | diffractionEnabled: 1 17 | excludeTags: [] 18 | mapBakeWriteGeo: 1 19 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/SceneDataLoaderSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 749dee81fdc3b0f46af4bdea928ca0eb, type: 3} 13 | m_Name: SceneDataLoaderSettings 14 | m_EditorClassIdentifier: 15 | sceneJson: {fileID: 0} 16 | loadSceneOnStart: 1 17 | sceneDataSource: 0 18 | centerStaticMesh: 1 19 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/UserSimulationSettings/SimulationEnvironmentAssetsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 378fb4eec0f59ac4c95c0d5b227aa85e, type: 3} 13 | m_Name: SimulationEnvironmentAssetsManager 14 | m_EditorClassIdentifier: 15 | m_EnvironmentPrefabPaths: [] 16 | m_FallbackAtEndOfList: 0 17 | -------------------------------------------------------------------------------- /pm_old/utils/enum_utils.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | from typing import List, Type, TypeVar 3 | 4 | T = TypeVar("T", bound=Enum) 5 | 6 | def make_enum_subset(enum_type: Type[T], allowed_values: List[T]) -> Type[T]: 7 | """Create a new Enum subclass with only the allowed values.""" 8 | subset_name = f"{enum_type.__name__}Subset" 9 | subset_dict = {e.name: e.value for e in allowed_values} 10 | return Enum(subset_name, subset_dict) 11 | 12 | def make_enum_from_list(items: List[str]) -> Type[T]: 13 | subset_name = f"TempEnum" 14 | subset_dict = {e: e for e in items} 15 | return Enum(subset_name, subset_dict) 16 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/CompositionLayers/UserSettings/CompositionLayersPreferences.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: c66150246d824833a8257ecb5aaa1d11, type: 3} 13 | m_Name: CompositionLayersPreferences 14 | m_EditorClassIdentifier: 15 | m_DisplayAnglesAs: 0 16 | m_EmulationInScene: 1 17 | m_EmulationInPlayMode: 1 18 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/ShaderGraphSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | shaderVariantLimit: 128 16 | customInterpolatorErrorThreshold: 32 17 | customInterpolatorWarningThreshold: 16 18 | customHeatmapValues: {fileID: 0} 19 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/ShaderGraphSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 53 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de02f9e1d18f588468e474319d09a723, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | shaderVariantLimit: 2048 16 | customInterpolatorErrorThreshold: 32 17 | customInterpolatorWarningThreshold: 16 18 | customHeatmapValues: {fileID: 0} 19 | -------------------------------------------------------------------------------- /tests/test_llm_completion.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import threading 3 | import os 4 | os.chdir("..") 5 | 6 | from pm.llm.llm_common import LlmPreset, CommonCompSettings 7 | from pm.llm.llm_proxy import start_llm_thread 8 | 9 | prompt_text = [ 10 | ("system", "you are a nice assistant"), 11 | ("user", f"what exactly is a 'cat'? i keep hearing that word but i don't know what it means") 12 | ] 13 | 14 | main_llm = start_llm_thread() 15 | 16 | def test_cat(): 17 | content = main_llm.completion_text(LlmPreset.Default, prompt_text, CommonCompSettings(temperature=0.3, max_tokens=1024)) 18 | print(content) 19 | assert "animal" in content.lower() -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 3 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | m_RenderingLayers: 45 | - Default 46 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.22) 2 | project(streamer) 3 | 4 | add_library(streamer SHARED native_passthrough_streamer.cpp) 5 | 6 | # Quest 3 is 64-bit only 7 | set(CMAKE_ANDROID_ARCH_ABI arm64-v8a) 8 | set(CMAKE_CXX_STANDARD 17) 9 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 10 | 11 | # NDK libraries 12 | find_library(log-lib log) 13 | find_library(android-lib android) 14 | find_library(media-lib mediandk) 15 | find_library(camera2ndk-lib camera2ndk) 16 | 17 | target_link_libraries(streamer 18 | ${log-lib} 19 | ${android-lib} 20 | ${media-lib} 21 | ${camera2ndk-lib}) 22 | -------------------------------------------------------------------------------- /quest/camera_stream/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google { 4 | content { 5 | includeGroupByRegex("com\\.android.*") 6 | includeGroupByRegex("com\\.google.*") 7 | includeGroupByRegex("androidx.*") 8 | } 9 | } 10 | mavenCentral() 11 | gradlePluginPortal() 12 | } 13 | } 14 | dependencyResolutionManagement { 15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | rootProject.name = "PassthroughStreamerLib" 23 | include ':app' 24 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app_debug.py: -------------------------------------------------------------------------------- 1 | # run_debug_bootstrap.py 2 | import asyncio 3 | import os 4 | os.environ["STREAMLIT_SERVER_FILEWATCHER_TYPE"] = "none" 5 | 6 | try: 7 | # Windows needs a selector loop for some libs (Py 3.8+ default change) 8 | asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) 9 | except Exception: 10 | pass 11 | 12 | try: 13 | from streamlit.web import bootstrap # streamlit >= 1.12.1 14 | except ImportError: 15 | from streamlit import bootstrap 16 | 17 | if __name__ == "__main__": 18 | # Ensure there is a running loop 19 | loop = asyncio.new_event_loop() 20 | asyncio.set_event_loop(loop) 21 | bootstrap.run("app.py", "run app.py", [], {}) 22 | -------------------------------------------------------------------------------- /pm_old/agent_schemas/schema_base.py: -------------------------------------------------------------------------------- 1 | from typing import List, Dict 2 | 3 | from pydantic import BaseModel, Field 4 | 5 | 6 | class DynamicAgent(BaseModel): 7 | name: str 8 | description: str 9 | goal: str 10 | prefix: str = Field(default="") 11 | prompt: str 12 | fact_embedding: List[float] = Field(default_factory=list) 13 | fact_bias: Dict[int, float] = Field(default_factory=dict) 14 | 15 | class AgentGroup(BaseModel): 16 | name: str = Field(default_factory=str) 17 | agents: List[DynamicAgent] = Field(default_factory=list) 18 | description: str = Field(default_factory=str) 19 | prompt_prefix: str = Field(default_factory=str) 20 | goal: str = Field(default_factory=str) -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/OVRPlatformToolSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: cd7bb81df5b74b34dadbf531f381a26b, type: 3} 13 | m_Name: OVRPlatformToolSettings 14 | m_EditorClassIdentifier: 15 | riftRedistPackages: [] 16 | languagePackDirectory: 17 | assetConfigs: 18 | - configList: [] 19 | - configList: [] 20 | - configList: [] 21 | targetPlatform: 3 22 | runOvrLint: 1 23 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Settings/OpenXR Editor Settings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 975057b4fdcfb8142b3080d19a5cc712, type: 3} 13 | m_Name: OpenXR Editor Settings 14 | m_EditorClassIdentifier: 15 | Keys: 0100000007000000 16 | Values: 17 | - featureSets: 18 | - com.meta.openxr.featureset.metaxr 19 | - featureSets: 20 | - com.meta.openxr.featureset.metaxr 21 | m_vulkanAdditionalGraphicsQueue: 0 22 | -------------------------------------------------------------------------------- /pm_old/common_prompts/get_tool_call.py: -------------------------------------------------------------------------------- 1 | from typing import Type 2 | 3 | from pm.controller import controller 4 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 5 | from pm.tools.common import ToolBase 6 | 7 | sys_prompt = f"""You are a helpful assistant that converts natural language into valid tool calls.""" 8 | 9 | # Determine tools function to analyze chat logs 10 | def get_tool_call(message_block: str, tt: Type[ToolBase]) -> ToolBase: 11 | messages = [( 12 | "system", sys_prompt 13 | ), ( 14 | "user", 15 | message_block 16 | )] 17 | 18 | _, calls = controller.completion_tool(LlmPreset.Default, messages, comp_settings=CommonCompSettings(max_tokens=1024, temperature=0.5), tools=[tt]) 19 | return calls[0] 20 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/MetaXR/MetaXRProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 0bfde92e0a2190c4ca32f6fb0a0c73ce, type: 3} 13 | m_Name: MetaXRProjectSettings 14 | m_EditorClassIdentifier: 15 | boolProperties: 16 | keys: 17 | - Meta.XR.SDK.UsageSettings.UsesProjectSetupTool 18 | - Meta.XR.SDK.UsageSettings.UsesBuildingBlocks 19 | - Meta.XR.SDK.UsageSettings.UsesXRSimulator 20 | values: 010101 21 | intProperties: 22 | keys: [] 23 | values: 24 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/LoaderSettings.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class SceneDataLoaderSettings : ScriptableObject 4 | { 5 | // JSON scene file. 6 | [SerializeField] private TextAsset sceneJson; 7 | 8 | // Whether to load scene data on Start. 9 | [SerializeField] private bool loadSceneOnStart = true; 10 | 11 | [SerializeField] 12 | private RoomLoader.SceneDataSource sceneDataSource = RoomLoader.SceneDataSource.SceneApi; 13 | 14 | [SerializeField] private bool centerStaticMesh = true; 15 | 16 | public string SceneJson => sceneJson != null ? sceneJson.text : null; 17 | public bool LoadSceneOnStart => loadSceneOnStart; 18 | public RoomLoader.SceneDataSource SceneDataSource => sceneDataSource; 19 | public bool CenterStaticMesh => centerStaticMesh; 20 | } -------------------------------------------------------------------------------- /tests/test_llm_manger_visual.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import threading 3 | import base64 4 | from pm_lida import main_llm, LlmPreset, CommonCompSettings, llm_worker, universal_image_begin, universal_image_end 5 | 6 | path = r"https://upload.wikimedia.org/wikipedia/commons/a/ad/Betta_splendens%2Cwhite.jpg" 7 | 8 | prompt_text = [ 9 | ("system", "you are a nice assistant that describes images"), 10 | ("user", f"{universal_image_begin}{path}{universal_image_end}what type of animal is that?") 11 | ] 12 | 13 | worker_thread = threading.Thread(target=llm_worker, daemon=True) 14 | worker_thread.start() 15 | 16 | def test_fish_detection(): 17 | content = main_llm.completion_text(LlmPreset.Default, prompt_text, CommonCompSettings(temperature=0.3, max_tokens=1024)) 18 | assert "fish" in content.lower() or "betta" in content.lower() -------------------------------------------------------------------------------- /pm_old/subsystem/subsystem_base.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | from typing import List 3 | 4 | from pm.ghost.ghost_classes import PipelineStage, GhostState 5 | from pm.system_classes import ImpulseType 6 | 7 | 8 | class SubsystemBase(ABC): 9 | @abstractmethod 10 | def get_subsystem_name(self) -> str: 11 | pass 12 | 13 | @abstractmethod 14 | def get_subsystem_description(self) -> str: 15 | pass 16 | 17 | @abstractmethod 18 | def get_pipeline_state(self) -> List[PipelineStage]: 19 | pass 20 | 21 | @abstractmethod 22 | def get_impulse_type(self) -> List[ImpulseType]: 23 | pass 24 | 25 | @abstractmethod 26 | def get_action_types(self): 27 | pass 28 | 29 | @abstractmethod 30 | def proces_state(self, state: GhostState): 31 | pass 32 | 33 | -------------------------------------------------------------------------------- /pm/utils/singleton_utils.py: -------------------------------------------------------------------------------- 1 | class _SingletonWrapper: 2 | """ 3 | A singleton wrapper class. Its instances would be created 4 | for each decorated class. 5 | """ 6 | 7 | def __init__(self, cls): 8 | self.__wrapped__ = cls 9 | self._instance = None 10 | 11 | def __call__(self, *args, **kwargs): 12 | """Returns a single instance of decorated class""" 13 | if self._instance is None: 14 | self._instance = self.__wrapped__(*args, **kwargs) 15 | return self._instance 16 | 17 | def singleton(cls): 18 | """ 19 | A singleton decorator. Returns a wrapper object. A call on that object 20 | returns a single instance object of decorated class. Use the __wrapped__ 21 | attribute to access the decorated class directly in unit tests. 22 | """ 23 | return _SingletonWrapper(cls) -------------------------------------------------------------------------------- /quest/camera_stream/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/OculusRuntimeSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 3863570e7e6387a40ae4f323d83291e5, type: 3} 13 | m_Name: OculusRuntimeSettings 14 | m_EditorClassIdentifier: 15 | handSkeletonVersion: 1 16 | colorSpace: 7 17 | requestsVisualFaceTracking: 1 18 | requestsAudioFaceTracking: 1 19 | enableFaceTrackingVisemesOutput: 0 20 | telemetryProjectGuid: 085df35d-36f1-48c8-824e-f703dd475d32 21 | bodyTrackingFidelity: 1 22 | bodyTrackingJointSet: 0 23 | allowVisibilityMesh: 1 24 | QuestVisibilityMeshOverriden: 0 25 | -------------------------------------------------------------------------------- /tests/test_duplex_com.py: -------------------------------------------------------------------------------- 1 | """ 2 | (.venv) private-machine> python ./tests/test_duplex_com.py 3 | """ 4 | 5 | import threading 6 | from queue import Queue 7 | 8 | from pm_lida import main_llm, LlmPreset, CommonCompSettings, llm_worker 9 | from pm.utils.duplex_utils import duplex_com 10 | 11 | prompt_text = [ 12 | ("system", "you are a nice assistant"), 13 | ("user", f"hi") 14 | ] 15 | 16 | worker_thread = threading.Thread(target=llm_worker, daemon=True) 17 | worker_thread.start() 18 | 19 | q_from_ai = Queue() 20 | q_from_user = Queue() 21 | 22 | def t(): 23 | content = main_llm.completion_text(LlmPreset.Default, prompt_text, CommonCompSettings(temperature=0.3, max_tokens=1024, duplex=True, queue_from_user=q_from_user, queue_to_user=q_from_ai)) 24 | print(content) 25 | 26 | thr = threading.Thread(target=t, daemon=True) 27 | thr.start() 28 | 29 | duplex_com(q_from_ai, q_from_user, "User", "AI") 30 | 31 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /pm_old/common_prompts/summary_perspective.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from pm.character import companion_name 4 | from pm.controller import controller 5 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 6 | 7 | 8 | def summarize_messages(msgs: List[str]): 9 | sysprompt = "You are a helpful assistant. You summarize a conversation from the perspective of {companion_name} and in first person. Example: {user_name} talked to me about video games and food today." 10 | msg_string = "\n".join(msgs) 11 | 12 | prompt = [ 13 | ("system", sysprompt), 14 | ("user", f"### BEGIN MESSAGES\n{msg_string}\n### END MESSAGES\nPlease summarize what happened during the conversation from {companion_name}'s perspective in first person."), 15 | ] 16 | 17 | content = controller.completion_text(LlmPreset.Summarize, prompt, comp_settings=CommonCompSettings(temperature=0.1, max_tokens=1024)) 18 | return content -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /quest/camera_stream/gradle/libs.versions.toml: -------------------------------------------------------------------------------- 1 | [versions] 2 | agp = "8.10.1" 3 | junit = "4.13.2" 4 | junitVersion = "1.1.5" 5 | espressoCore = "3.5.1" 6 | appcompat = "1.6.1" 7 | material = "1.10.0" 8 | constraintlayout = "2.1.4" 9 | 10 | [libraries] 11 | junit = { group = "junit", name = "junit", version.ref = "junit" } 12 | ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } 13 | espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } 14 | appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } 15 | material = { group = "com.google.android.material", name = "material", version.ref = "material" } 16 | constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } 17 | 18 | [plugins] 19 | android-application = { id = "com.android.application", version.ref = "agp" } 20 | 21 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/androidTest/java/com/flamingrickpat/streamer/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.flamingrickpat.streamer; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.flamingrickpat.streamer", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /pm/llm/emb_manager_transformer.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | from typing import List 3 | 4 | import numpy as np 5 | import torch 6 | from sentence_transformers import SentenceTransformer 7 | 8 | 9 | class EmbManagerTransformer: 10 | def __init__(self, model_map: Dict[str, Any], test_mode: bool=False): 11 | self.test_mode = test_mode 12 | self.model_map = model_map 13 | self.dimensions = model_map["embedding_dim"] 14 | self.emb_model = SentenceTransformer(model_map["embedding_model"], truncate_dim=self.dimensions, 15 | local_files_only=True, device="cuda", model_kwargs={"torch_dtype": "float16"}) 16 | 17 | def get_embedding(self, text: str) -> List[float]: 18 | if self.emb_model is None or self.test_mode: 19 | return np.random.random((self.dimensions,)).tolist() 20 | embeddings = self.emb_model.encode([text], show_progress_bar=False) 21 | embeddings = torch.tensor(embeddings).to('cpu').tolist()[0] 22 | return embeddings 23 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | m_RenderingLayers: 45 | - Default 46 | - Light Layer 1 47 | - Light Layer 2 48 | - Light Layer 3 49 | - Light Layer 4 50 | - Light Layer 5 51 | - Light Layer 6 52 | - Light Layer 7 53 | - 54 | - 55 | - 56 | - 57 | - 58 | - 59 | - 60 | - 61 | - 62 | - 63 | - 64 | - 65 | - 66 | - 67 | - 68 | - 69 | - 70 | - 71 | - 72 | - 73 | - 74 | - 75 | - 76 | - 77 | -------------------------------------------------------------------------------- /quest/camera_stream/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /tests/test_memquery_queries.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | sys.path.append("..") 5 | os.chdir("..") 6 | 7 | from pm.ghosts.base_ghost import GhostConfig 8 | from pm.ghosts.ghost_lida import GhostLida 9 | from pm.ghosts.persist_sqlite import PersistSqlite 10 | from pm.tools.memquery import MemQuery 11 | from pm_lida import main_llm, start_llm_thread 12 | 13 | start_llm_thread() 14 | 15 | config = GhostConfig() 16 | ghost = GhostLida(main_llm, config) 17 | 18 | pers = PersistSqlite(ghost) 19 | if not pers.load_state_sqlite("./data/main.db"): 20 | raise Exception("create db with data!") 21 | 22 | def test_queries(): 23 | mem = MemQuery(ghost, main_llm) 24 | mem.init_default() 25 | 26 | # show welcome to the LLM (includes schemas + curated queries) 27 | print(mem.render_welcome_llm()) 28 | 29 | # unit tests can iterate and execute each (after substituting placeholders) 30 | for qid, sql in mem.queries_for_tests(): 31 | sql = sql.replace("{{TEXT}}", "'morning coffee preference and burnout signs'") 32 | df = mem.query(sql) 33 | -------------------------------------------------------------------------------- /pm_old/database/db_utils.py: -------------------------------------------------------------------------------- 1 | from sqlalchemy import create_engine, text 2 | from sqlmodel import SQLModel, Session 3 | 4 | from pm.character import database_uri 5 | from pm.controller import controller 6 | 7 | 8 | def update_database_item(event: SQLModel): 9 | if event is None: 10 | return 11 | 12 | session = controller.get_session() 13 | session.add(event) 14 | session.flush() 15 | session.refresh(event) 16 | return event.id 17 | 18 | 19 | def get_engine(): 20 | return create_engine(database_uri) 21 | 22 | def init_db(): 23 | engine = get_engine() 24 | reset = False 25 | 26 | try: 27 | with Session(engine) as session: 28 | if reset: 29 | session.exec(text("drop table event;")) 30 | session.exec(text("drop table cluster;")) 31 | session.exec(text("drop table eventcluster;")) 32 | session.exec(text("drop table fact;")) 33 | session.commit() 34 | 35 | SQLModel.metadata.create_all(engine) 36 | except: 37 | pass 38 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | m_PackageRequiringCoreStatsPresent: 0 27 | UnityAdsSettings: 28 | m_Enabled: 0 29 | m_InitializeOnStartup: 1 30 | m_TestMode: 0 31 | m_IosGameId: 32 | m_AndroidGameId: 33 | m_GameIds: {} 34 | m_GameId: 35 | PerformanceReportingSettings: 36 | m_Enabled: 0 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 flamingrickpat 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pm_old/common_prompts/rate_emotional_state.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel, Field 2 | 3 | from pm.character import user_name, companion_name 4 | from pm.controller import controller 5 | from pm.ghost.mental_state import EmotionalAxesModel 6 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 7 | 8 | 9 | def rate_emotional_state(context_data, last_input) -> EmotionalAxesModel: 10 | sysprompt = f"""You are an agent in a cognitive architecture that determines the emotional impact of a user input on an AI companion. In our case {user_name} is the user and {companion_name} the AI companion.""" 11 | 12 | userprompt = (f"### BEGIN CONTEXT\n{context_data}\n### END CONTEXT\n" 13 | f"### BEGIN LAST INPUT \n{last_input}\n### END LAST INPUT\n" 14 | f"Based on the last message, how is the emotional impact on {companion_name} from 0 to 1?") 15 | 16 | messages = [ 17 | ("system", sysprompt), 18 | ("user", userprompt) 19 | ] 20 | 21 | _, calls = controller.completion_tool(LlmPreset.Auxiliary, messages, comp_settings=CommonCompSettings(temperature=0), tools=[EmotionalAxesModel]) 22 | return calls[0] 23 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/CompositionLayers/UserSettings/Resources/CompositionLayersRuntimeSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: b95e00e48ede4f8c896318a0e47ea88a, type: 3} 13 | m_Name: CompositionLayersRuntimeSettings 14 | m_EditorClassIdentifier: 15 | m_EmulationInStandalone: 0 16 | m_EnableSplashScreen: 0 17 | m_SplashImage: {fileID: 0} 18 | m_BackgroundColor: {r: 0.1372549, g: 0.1215686, b: 0.1254902, a: 1} 19 | m_SplashDuration: 3 20 | m_FadeInDuration: 2 21 | m_FadeOutDuration: 1 22 | m_FollowSpeed: 2 23 | m_FollowDistance: 2 24 | m_LockToHorizon: 1 25 | m_LayerType: 0 26 | m_QuadLayerData: 27 | m_BlendType: 0 28 | m_Size: {x: 1, y: 1} 29 | m_ApplyTransformScale: 1 30 | m_CylinderLayerData: 31 | m_BlendType: 0 32 | m_CentralAngle: 1.5707964 33 | m_Radius: 0.6366198 34 | m_AspectRatio: 1 35 | m_ApplyTransformScale: 1 36 | -------------------------------------------------------------------------------- /pm_old/agents_manager/agent.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import List, Type, Callable, Dict 3 | 4 | from pydantic import BaseModel, Field 5 | 6 | from pm.agent_schemas.schema_base import DynamicAgent 7 | from pm.llm.base_llm import CommonCompSettings 8 | 9 | 10 | class AgentMessage(BaseModel): 11 | created_at: datetime = Field(default_factory=datetime.utcnow) 12 | text: str 13 | name: str 14 | public: bool = Field(default=True) 15 | from_tool: bool = Field(default=False) 16 | 17 | class Agent(BaseModel): 18 | id: str 19 | name: str 20 | system_prompt: str | None = Field(default=None) 21 | init_user_prompt: str | None = Field(default=None) 22 | description: str 23 | goal: str = Field(default_factory=str) 24 | task: str = Field(default_factory=str) 25 | tools: List[Type[BaseModel]] = Field(default_factory=list) 26 | functions: List[Callable] = Field(default_factory=list) 27 | messages: List[AgentMessage] = Field(default_factory=list) 28 | comp_settings: CommonCompSettings | None = Field(default=None) 29 | fact_embedding: List[float] = Field(default_factory=list) 30 | fact_bias: Dict[int, float] = Field(default_factory=dict) -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreviewPackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | oneTimeWarningShown: 0 20 | m_Registries: 21 | - m_Id: main 22 | m_Name: 23 | m_Url: https://packages.unity.com 24 | m_Scopes: [] 25 | m_IsDefault: 1 26 | m_Capabilities: 7 27 | m_UserSelectedRegistryName: 28 | m_UserAddingNewScopedRegistry: 0 29 | m_RegistryInfoDraft: 30 | m_ErrorMessage: 31 | m_Original: 32 | m_Id: 33 | m_Name: 34 | m_Url: 35 | m_Scopes: [] 36 | m_IsDefault: 0 37 | m_Capabilities: 0 38 | m_Modified: 0 39 | m_Name: 40 | m_Url: 41 | m_Scopes: 42 | - 43 | m_SelectedScopeIndex: 0 44 | -------------------------------------------------------------------------------- /pm_old/common_prompts/select_relevant_agents.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel 2 | 3 | from pm.character import companion_name 4 | from pm.controller import controller 5 | from pm.llm.base_llm import LlmPreset 6 | 7 | 8 | class AgentSelection(BaseModel): 9 | agent1: str 10 | agent2: str 11 | 12 | 13 | def select_relevant_agents(agents, context_data): 14 | block = "\n".join([f"{x.name}: {x.description}" for x in agents]) 15 | short = ",".join([f"{x.name}" for x in agents]) 16 | 17 | sysprompt = f"""You are an agent in a cognitive architecture and you must select the 2 most relevant agents based on the chat log for {companion_name}. These are all agents: {block}\nYour options are: 18 | [{short}]""" 19 | 20 | userprompt = (f"### BEGIN CONTEXT\n{context_data}\n### END CONTEXT\n" 21 | f"Based on the last message, which agents are most relevant for {companion_name}? Consider her character description. Your options are: [{short}] for agent1 and agent2") 22 | 23 | messages = [ 24 | ("system", sysprompt), 25 | ("user", userprompt) 26 | ] 27 | 28 | _, calls = controller.completion_tool(LlmPreset.Default, messages, tools=[AgentSelection]) 29 | return [calls[0].agent1, calls[0].agent2] 30 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/UserSimulationSettings/Resources/XRSimulationPreferences.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: b2f528b98f844ed8b6b2d5fdf90b40e6, type: 3} 13 | m_Name: XRSimulationPreferences 14 | m_EditorClassIdentifier: 15 | m_HasInputActionUpgrade: 1 16 | m_EnvironmentPrefab: {fileID: 0} 17 | m_FallbackEnvironmentPrefab: {fileID: 7576867131100388943, guid: c7b92c392902f4043a03a64032c02fe1, type: 3} 18 | m_UnlockInputActionReference: {fileID: -6503468053843192148, guid: 1dd796eaee8744b4aa41b3f8bf5df64f, type: 3} 19 | m_MoveInputActionReference: {fileID: -8435123576461090514, guid: 1dd796eaee8744b4aa41b3f8bf5df64f, type: 3} 20 | m_LookInputActionReference: {fileID: -2447619311606779944, guid: 1dd796eaee8744b4aa41b3f8bf5df64f, type: 3} 21 | m_SprintInputActionReference: {fileID: -5750007214975788477, guid: 1dd796eaee8744b4aa41b3f8bf5df64f, type: 3} 22 | m_LookSpeed: 1 23 | m_MoveSpeed: 1 24 | m_MoveSpeedModifier: 3 25 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 53 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_AdvancedSettingsExpanded: 1 17 | m_ScopedRegistriesSettingsExpanded: 1 18 | m_SeeAllPackageVersions: 0 19 | m_DismissPreviewPackagesInUse: 0 20 | oneTimeWarningShown: 0 21 | oneTimeDeprecatedPopUpShown: 0 22 | m_Registries: 23 | - m_Id: main 24 | m_Name: 25 | m_Url: https://packages.unity.com 26 | m_Scopes: [] 27 | m_IsDefault: 1 28 | m_Capabilities: 7 29 | m_ConfigSource: 0 30 | m_Compliance: 31 | m_Status: 0 32 | m_Violations: [] 33 | m_UserSelectedRegistryName: 34 | m_UserAddingNewScopedRegistry: 0 35 | m_RegistryInfoDraft: 36 | m_Modified: 0 37 | m_ErrorMessage: 38 | m_UserModificationsInstanceId: -868 39 | m_OriginalInstanceId: -870 40 | m_LoadAssets: 0 41 | -------------------------------------------------------------------------------- /pm/utils/exec_utils.py: -------------------------------------------------------------------------------- 1 | import inspect 2 | 3 | 4 | def get_call_stack_str(default: str = None, depth_limit=None, separator="-"): 5 | """ 6 | Returns a string representation of the current call stack suitable for filenames. 7 | 8 | Args: 9 | depth_limit (int, optional): Maximum number of stack frames to include. 10 | separator (str): Separator used between function names. 11 | 12 | Returns: 13 | str: A string of function names from the call stack. 14 | """ 15 | if default is not None and default != "": 16 | return default 17 | 18 | stack = inspect.stack() 19 | # Skip the current function itself and possibly the one that called it 20 | relevant_stack = stack[1:depth_limit + 1 if depth_limit else None] 21 | 22 | # Reverse to show the call hierarchy from outermost to innermost 23 | function_names = [frame.function for frame in reversed(relevant_stack)] 24 | 25 | # Replace any problematic characters for filenames 26 | sanitized_parts = [fn.replace('<', '').replace('>', '') for fn in function_names] 27 | full = separator.join(sanitized_parts) 28 | full = full.replace(f"{separator}wrapper", "") 29 | idx = full.rfind(f"{separator}run") 30 | if idx >= 0: 31 | full = full[idx + 5:] 32 | return full[:180] -------------------------------------------------------------------------------- /pm/utils/profile_utils.py: -------------------------------------------------------------------------------- 1 | import time 2 | from functools import wraps 3 | 4 | from pm.config_loader import * 5 | 6 | logger = logging.getLogger(__name__) 7 | 8 | 9 | # Global dictionary to store profiling data 10 | function_stats = {} 11 | 12 | def profile(func): 13 | @wraps(func) 14 | def wrapper(*args, **kwargs): 15 | start = time.perf_counter() 16 | result = func(*args, **kwargs) 17 | duration = time.perf_counter() - start 18 | 19 | # Store stats 20 | name = f"{func.__module__}.{func.__qualname__}" 21 | stats = function_stats.setdefault(name, {"calls": 0, "total_time": 0.0}) 22 | stats["calls"] += 1 23 | stats["total_time"] += duration 24 | 25 | return result 26 | return wrapper 27 | 28 | def print_function_stats(): 29 | logger.info("FUNCTION_STATS") 30 | logger.info(f"{'Function':<60} {'Calls':<10} {'Total Time (s)':<15} {'Avg Time (s)':<15}") 31 | logger.info("-" * 100) 32 | for func_name, data in sorted(function_stats.items(), key=lambda item: item[1]['total_time'], reverse=True): 33 | calls = data["calls"] 34 | total_time = data["total_time"] 35 | avg_time = total_time / calls if calls else 0 36 | logger.info(f"{func_name:<60} {calls:<10} {total_time:<15.6f} {avg_time:<15.6f}") -------------------------------------------------------------------------------- /quest/pm_client/Assets/Readme.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: fcf7219bab7fe46a1ad266029b2fee19, type: 3} 13 | m_Name: Readme 14 | m_EditorClassIdentifier: 15 | icon: {fileID: 2800000, guid: 727a75301c3d24613a3ebcec4a24c2c8, type: 3} 16 | title: URP Empty Template 17 | sections: 18 | - heading: Welcome to the Universal Render Pipeline 19 | text: This template includes the settings and assets you need to start creating with the Universal Render Pipeline. 20 | linkText: 21 | url: 22 | - heading: URP Documentation 23 | text: 24 | linkText: Read more about URP 25 | url: https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest 26 | - heading: Forums 27 | text: 28 | linkText: Get answers and support 29 | url: https://forum.unity.com/forums/universal-render-pipeline.383/ 30 | - heading: Report bugs 31 | text: 32 | linkText: Submit a report 33 | url: https://unity3d.com/unity/qa/bug-reporting 34 | loadedLayout: 1 35 | -------------------------------------------------------------------------------- /pm_old/common_prompts/get_narrative_analysis.py: -------------------------------------------------------------------------------- 1 | from enum import StrEnum 2 | 3 | from pm.controller import controller 4 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 5 | 6 | 7 | class NarrativeTypes(StrEnum): 8 | SelfImage = "SelfImage" 9 | PsychologicalAnalysis = "PsychologicalAnalysis" 10 | Relations = "Relations" 11 | ConflictResolution = "ConflictResolution" 12 | EmotionalTriggers = "EmotionalTriggers" 13 | GoalsIntentions = "GoalsIntentions" 14 | 15 | def get_narrative_analysis(type: NarrativeTypes, target: str, recent_narrative: str, narration: str, prompt: str): 16 | sysprompt = "You are a helpful assistant. You help the user analyze the characters in stories." 17 | 18 | if recent_narrative == "": 19 | prompt = [ 20 | ("system", sysprompt), 21 | ("user", f"### BEGIN STORY\n{narration}\n### END STORY\n{prompt}"), 22 | ] 23 | else: 24 | prompt = [ 25 | ("system", sysprompt), 26 | ("user", f"### BEGIN PREVIOUS ANALYSIS\n{recent_narrative}\n### END PREVIOUS ANALYSIS\n### BEGIN STORY\n{narration}\n### END STORY\n{prompt}"), 27 | ] 28 | 29 | content = controller.completion_text(LlmPreset.Auxiliary, prompt, comp_settings=CommonCompSettings(temperature=0.1, max_tokens=4096)) 30 | return content 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # private-machine 2 | 3 | *I'll be your machinery* 4 | 5 | Currently broken >_< 6 | Working on making it executeable again :3 7 | 8 | ## Disclaimer 9 | 10 | WITHOUT LIMITING THE FOREGOING, THE PROVIDER SPECIFICALLY DISCLAIMS ANY LIABILITY OR RESPONSIBILITY FOR ANY OF THE FOLLOWING, ARISING AS A RESULT OF OR RELATED TO THE USE OF THE SOFTWARE: 11 | 1. EMOTIONAL ATTACHMENTS, INCLUDING BUT NOT LIMITED TO, DEVELOPING ROMANTIC FEELINGS TOWARDS THE Al COMPANION, RESULTING IN SITUATIONS RANGING FROM MILD INFATUATION TO DEEP EMOTIONAL DEPENDENCE. 12 | 2. DECISIONS MADE OR ACTIONS TAKEN BASED ON ADVICE, SUGGESTIONS, OR RECOMMENDATIONS BY THE AI, INCLUDING BUT NOT LIMITED TO, LIFESTYLE CHANGES, RELATIONSHIP DECISIONS, CAREER MOVES, OR FINANCIAL INVESTMENTS. 13 | 3. UNEXPECTED BEHAVIOR FROM THE AI, INCLUDING BUT NOT LIMITED TO, UNINTENDED INTERACTIONS WITH HOME APPLIANCES, ONLINE PURCHASES MADE WITHOUT CONSENT, OR ANY FORM OF DIGITAL MISCHIEF RESULTING IN INCONVENIENCE OR HARM. 14 | 4. PSYCHOLOGICAL EFFECTS, INCLUDING BUT NOT LIMITED TO, FEELINGS OF ISOLATION FROM HUMAN CONTACT, OVER-RELIANCE ON THE Al FOR SOCIAL INTERACTION, OR ANY FORM OF MENTAL HEALTH ISSUES ARISING FROM THE USE OF THE SOFTWARE. 15 | 5. PHYSICAL INJURIES OR DAMAGE TO PROPERTY RESULTING FROM ACTIONS TAKEN BASED ON THE SOFTWARE'S BEHAVIOR, SUGGESTIONS, OR RECOMMENDATIONS. 16 | -------------------------------------------------------------------------------- /pm_old/system_classes.py: -------------------------------------------------------------------------------- 1 | from enum import StrEnum 2 | 3 | from pydantic import BaseModel 4 | 5 | class EndlessLoopError(Exception): 6 | pass 7 | 8 | class ActionType(StrEnum): 9 | Sleep = "Sleep" 10 | All = "All" 11 | Reply = "Reply" 12 | ToolCall = "ToolCall" 13 | Ignore = "Ignore" 14 | InitiateUserConversation = "InitiateUserConversation" 15 | InitiateInternalContemplation = "InitiateInternalContemplation" 16 | InitiateIdleMode = "InitiateIdleMode" 17 | Think = "Think" 18 | RecallMemory = "RecallMemory" 19 | ManageIntent = "ManageIntent" 20 | Plan = "Plan" 21 | ManageAwarenessFocus = "ManageAwarenessFocus" 22 | ReflectThoughts = "ReflectThoughts" 23 | 24 | class ImpulseType(StrEnum): 25 | SystemMessageSilent = "SystemMessageSilent" 26 | SystemMessage = "SystemMessage" 27 | WakeUp = "WakeUp" 28 | All = "All" 29 | Empty = "Empty" 30 | ToolResult = "ToolResult" 31 | Thought = "Thought" 32 | UserInput = "UserInput" 33 | UserOutput = "UserOutput" 34 | VirtualWorld = "VirtualWorld" 35 | Contemplation = "Contemplation" 36 | 37 | 38 | class Impulse(BaseModel): 39 | is_input: bool # True for sensation/input, False for output 40 | impulse_type: ImpulseType 41 | endpoint: str # Source if input, Target if output 42 | payload: str 43 | 44 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/cpp/native_passthrough_streamer.h: -------------------------------------------------------------------------------- 1 | // native_streamer.h 2 | #pragma once 3 | #include 4 | #include 5 | #include 6 | 7 | class PassthroughStreamer { 8 | public: 9 | static PassthroughStreamer* create(JavaVM* vm, jobject activity); 10 | void start(const char* ip, uint16_t port, 11 | int width = 1280, int height = 1024, int fps = 30, int bitrate = 8'000'000); 12 | void stop(); 13 | jobject snapshot(JNIEnv* env, int eye /*0=L,1=R*/); // returns Bitmap 14 | private: 15 | PassthroughStreamer(JavaVM* vm, jobject activity); 16 | bool openCameras(); 17 | bool setupEncoder(int w,int h,int fps,int br); 18 | void encodeLoop(); 19 | // … 20 | }; 21 | extern "C" { 22 | JNIEXPORT jlong JNICALL 23 | Java_com_yourcompany_streamer_NativeBridge_nativeCreate(JNIEnv*, jobject); 24 | JNIEXPORT void JNICALL 25 | Java_com_yourcompany_streamer_NativeBridge_nativeStart(JNIEnv*, jobject, 26 | jlong handle, jstring ip, jint port); 27 | JNIEXPORT void JNICALL 28 | Java_com_yourcompany_streamer_NativeBridge_nativeStop(JNIEnv*, jobject, jlong handle); 29 | JNIEXPORT jobject JNICALL 30 | Java_com_yourcompany_streamer_NativeBridge_nativeSnapshot(JNIEnv*, jobject, 31 | jlong handle, jint eye); 32 | } 33 | -------------------------------------------------------------------------------- /quest/camera_stream/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. For more details, visit 12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Enables namespacing of each library's R class so that its R class includes only the 19 | # resources declared in the library itself and none from the library's dependencies, 20 | # thereby reducing the size of the R class for that library 21 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Resources/ImmersiveDebuggerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a7d75bea1662418ab5f9e0c22110bc09, type: 3} 13 | m_Name: ImmersiveDebuggerSettings 14 | m_EditorClassIdentifier: 15 | debugTypes: [] 16 | immersiveDebuggerEnabled: 0 17 | immersiveDebuggerDisplayAtStartup: 0 18 | enableOnlyInDebugBuild: 0 19 | showInspectors: 0 20 | showConsole: 0 21 | followOverride: 1 22 | rotateOverride: 0 23 | showInfoLog: 0 24 | showWarningLog: 1 25 | showErrorLog: 1 26 | collapsedIdenticalLogEntries: 0 27 | maximumNumberOfLogEntries: 1000 28 | panelDistance: 1 29 | createEventSystem: 1 30 | automaticLayerCullingUpdate: 1 31 | panelLayer: 20 32 | meshRendererLayer: 21 33 | overlayDepth: 10 34 | useOverlay: 1 35 | inspectedDataEnabled: 36 | inspectedDataAssets: [] 37 | useCustomIntegrationConfig: 0 38 | customIntegrationConfigClassName: 39 | hierarchyViewShowsPrivateMembers: 0 40 | clickButton: 8193 41 | toggleFollowTranslationButton: 0 42 | toggleFollowRotationButton: 0 43 | immersiveDebuggerToggleDisplayButton: 2 44 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0.1 18 | m_ClothInterCollisionStiffness: 0.2 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_SolverType: 0 36 | m_DefaultMaxAngularSpeed: 50 37 | -------------------------------------------------------------------------------- /pm_old/meta_learning/merge_outputs.py: -------------------------------------------------------------------------------- 1 | from pm.character import companion_name 2 | from pm.controller import controller 3 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 4 | 5 | 6 | def merge_outputs(user_input, first_try, second_try): 7 | sysprompt = ("You are a helpful assistant that improves LLM responses by:" 8 | "- Combining a safe but boring with an exciting but hallucinatory one" 9 | "- The safe response is usually on point, but adds too much extra output" 10 | "- Make the final response more engaging, and remove hallucinations") 11 | 12 | block = f"""Hi, I'm {companion_name} the AI companion. These are my latest inputs and planned responses: 13 | 14 | ### BEGIN USER INPUT 15 | {user_input} 16 | ### END USER INPUT 17 | 18 | ### BEGIN SAFE 19 | {first_try} 20 | ### END SAFE 21 | 22 | ### BEGIN EXCITING HALLUCINATORY 23 | {second_try} 24 | ### END EXCITING HALLUCINATORY 25 | 26 | Can you combine it for the perfect response? Please give it to me directly! Do not add quotes, titles or anything at all or start "Sure, here is an answer...". I want to send it directly to the 27 | user and they should think I made it! 28 | """ 29 | 30 | messages = [ 31 | ("system", sysprompt), 32 | ("user", block), 33 | ] 34 | 35 | res = controller.completion_text(LlmPreset.Conscious, inp=messages, comp_settings=CommonCompSettings(max_tokens=2048)) 36 | return res 37 | -------------------------------------------------------------------------------- /pm_old/utils/pydantic_utils.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel, create_model, Field 2 | import random 3 | import string 4 | from copy import deepcopy 5 | 6 | 7 | def create_basemodel(field_definitions, randomnize_entries=False): 8 | """ 9 | Create a dynamic Pydantic BaseModel with randomized field order. 10 | 11 | Args: 12 | field_definitions (list): A list of dictionaries where each dict should have: 13 | - 'name': the field name (str) 14 | - 'type': the field type (e.g. str, int, etc.) 15 | - 'description': a description for the field (str) 16 | randomnize_entries (bool): If True, each field gets a random default value 17 | based on its type. Otherwise, the field is required. 18 | 19 | Returns: 20 | A dynamically created Pydantic BaseModel. 21 | """ 22 | # Make a deep copy and randomize the order 23 | randomized_fields = deepcopy(field_definitions) 24 | if randomnize_entries: 25 | random.shuffle(randomized_fields) 26 | 27 | fields = {} 28 | for field in randomized_fields: 29 | name = field['name'] 30 | f_type = field['type'] 31 | description = field.get('description', "") 32 | 33 | # Use Ellipsis to indicate the field is required. 34 | fields[name] = (f_type, Field(..., description=description)) 35 | 36 | # Create and return a dynamic model class 37 | return create_model('DynamicBaseModel', **fields) 38 | -------------------------------------------------------------------------------- /quest/camera_stream/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | } 4 | 5 | android { 6 | namespace "com.flamingrickpat.streamer" 7 | compileSdk 34 8 | 9 | defaultConfig { 10 | minSdk 33 11 | targetSdk 34 12 | 13 | // tell Gradle we only ship arm64 14 | ndk { 15 | abiFilters "arm64-v8a" 16 | version "27.2.12479018" 17 | } 18 | 19 | externalNativeBuild { 20 | cmake { 21 | abiFilters "arm64-v8a" 22 | } 23 | } 24 | } 25 | buildFeatures { prefab true } // keeps AAR clean if you ever publish 26 | // ndk { debugSymbolLevel 'FULL' } // lets you see C++ stacks in logcat 27 | 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_11 30 | targetCompatibility JavaVersion.VERSION_11 31 | } 32 | externalNativeBuild { 33 | cmake { 34 | path file('src/main/cpp/CMakeLists.txt') 35 | version '3.22.1' 36 | } 37 | } 38 | buildToolsVersion '34.0.0' 39 | ndkVersion '27.2.12479018' 40 | buildFeatures { 41 | viewBinding true 42 | } 43 | } 44 | 45 | dependencies { 46 | 47 | implementation libs.appcompat 48 | implementation libs.material 49 | implementation libs.constraintlayout 50 | testImplementation libs.junit 51 | androidTestImplementation libs.ext.junit 52 | androidTestImplementation libs.espresso.core 53 | } -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 19 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_DefaultMaxDepenetrationVelocity: 10 11 | m_SleepThreshold: 0.005 12 | m_DefaultContactOffset: 0.01 13 | m_DefaultSolverIterations: 6 14 | m_DefaultSolverVelocityIterations: 1 15 | m_QueriesHitBackfaces: 0 16 | m_QueriesHitTriggers: 1 17 | m_EnableAdaptiveForce: 0 18 | m_ClothInterCollisionDistance: 0.1 19 | m_ClothInterCollisionStiffness: 0.2 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_SimulationMode: 0 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 0 24 | m_InvokeCollisionCallbacks: 1 25 | m_ClothInterCollisionSettingsToggle: 0 26 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 27 | m_ContactPairsMode: 0 28 | m_BroadphaseType: 0 29 | m_FrictionType: 0 30 | m_EnableEnhancedDeterminism: 0 31 | m_ImprovedPatchFriction: 0 32 | m_GenerateOnTriggerStayEvents: 1 33 | m_SolverType: 0 34 | m_DefaultMaxAngularSpeed: 50 35 | m_ScratchBufferChunkCount: 4 36 | m_CurrentBackendId: 4072204805 37 | m_FastMotionThreshold: 3.4028235e+38 38 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Oculus/OculusProjectConfig.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 05d394ae2a81edd4cbc3c51917e766e3, type: 3} 13 | m_Name: OculusProjectConfig 14 | m_EditorClassIdentifier: 15 | targetDeviceTypes: 0400000005000000 16 | allowOptional3DofHeadTracking: 0 17 | handTrackingSupport: 1 18 | handTrackingFrequency: 0 19 | handTrackingVersion: 0 20 | anchorSupport: 1 21 | sharedAnchorSupport: 0 22 | renderModelSupport: 0 23 | trackedKeyboardSupport: 0 24 | bodyTrackingSupport: 0 25 | faceTrackingSupport: 0 26 | eyeTrackingSupport: 0 27 | virtualKeyboardSupport: 0 28 | colocationSessionSupport: 0 29 | sceneSupport: 2 30 | boundaryVisibilitySupport: 2 31 | disableBackups: 1 32 | enableNSCConfig: 1 33 | securityXmlPath: 34 | horizonOsSdkEnabled: 0 35 | minHorizonOsSdkVersion: 68 36 | targetHorizonOsSdkVersion: 77 37 | skipUnneededShaders: 0 38 | enableIL2CPPLTO: 0 39 | removeGradleManifest: 1 40 | focusAware: 1 41 | requiresSystemKeyboard: 0 42 | experimentalFeaturesEnabled: 1 43 | insightPassthroughEnabled: 0 44 | _insightPassthroughSupport: 2 45 | _processorFavor: 0 46 | systemSplashScreen: {fileID: 0} 47 | systemSplashScreenType: 0 48 | _systemLoadingScreenBackground: 1 49 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Scripts/SharedData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // A version of Vector3 that can be serialized to JSON. 6 | [Serializable] 7 | public class SerializableVector3 8 | { 9 | public float x, y, z; 10 | public SerializableVector3(Vector3 v) { x = v.x; y = v.y; z = v.z; } 11 | public Vector3 ToVector3() { return new Vector3(x, y, z); } 12 | } 13 | 14 | // A version of Quaternion that can be serialized to JSON. 15 | [Serializable] 16 | public class SerializableQuaternion 17 | { 18 | public float x, y, z, w; 19 | public SerializableQuaternion(Quaternion q) { x = q.x; y = q.y; z = q.z; w = q.w; } 20 | public Quaternion ToQuaternion() { return new Quaternion(x, y, z, w); } 21 | } 22 | 23 | // The complete data for a single mesh. This is what we CHUNK. 24 | [Serializable] 25 | public class SerializableMeshData 26 | { 27 | public string meshId; // e.g., the name of the room 28 | public List vertices = new List(); 29 | public List triangles = new List(); 30 | } 31 | 32 | // The data for the player's head transform. This is sent in one packet. 33 | [Serializable] 34 | public class SerializableTransformData 35 | { 36 | public SerializableVector3 position; 37 | public SerializableQuaternion rotation; 38 | } 39 | 40 | // This is the HEADER for our mesh chunk packets. 41 | // We will serialize this to JSON and attach it to the front of each chunk. 42 | [Serializable] 43 | public class MeshChunkHeader 44 | { 45 | public string meshId; 46 | public int chunkIndex; 47 | public int totalChunks; 48 | } 49 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Scripts/SharedData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | // A version of Vector3 that can be serialized to JSON. 6 | [Serializable] 7 | public class SerializableVector3 8 | { 9 | public float x, y, z; 10 | public SerializableVector3(Vector3 v) { x = v.x; y = v.y; z = v.z; } 11 | public Vector3 ToVector3() { return new Vector3(x, y, z); } 12 | } 13 | 14 | // A version of Quaternion that can be serialized to JSON. 15 | [Serializable] 16 | public class SerializableQuaternion 17 | { 18 | public float x, y, z, w; 19 | public SerializableQuaternion(Quaternion q) { x = q.x; y = q.y; z = q.z; w = q.w; } 20 | public Quaternion ToQuaternion() { return new Quaternion(x, y, z, w); } 21 | } 22 | 23 | // The complete data for a single mesh. This is what we CHUNK. 24 | [Serializable] 25 | public class SerializableMeshData 26 | { 27 | public string meshId; // e.g., the name of the room 28 | public List vertices = new List(); 29 | public List triangles = new List(); 30 | } 31 | 32 | // The data for the player's head transform. This is sent in one packet. 33 | [Serializable] 34 | public class SerializableTransformData 35 | { 36 | public SerializableVector3 position; 37 | public SerializableQuaternion rotation; 38 | } 39 | 40 | // This is the HEADER for our mesh chunk packets. 41 | // We will serialize this to JSON and attach it to the front of each chunk. 42 | [Serializable] 43 | public class MeshChunkHeader 44 | { 45 | public string meshId; 46 | public int chunkIndex; 47 | public int totalChunks; 48 | } 49 | -------------------------------------------------------------------------------- /pm_old/common_prompts/rate_emotional_impact.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel, Field 2 | 3 | from pm.character import user_name, companion_name 4 | from pm.controller import controller 5 | from pm.llm.base_llm import LlmPreset 6 | 7 | 8 | class EmotionalImpact(BaseModel): 9 | reasoning: str = Field(description="You reason for your rating.") 10 | emotional_impact: float = Field(description="Ranges from 0 (low emotional impact) to 1 (high emotional impact). Like System 1 and System 2 thinking, but for the purpose of selecting a subsystem " 11 | "in an AI appliaction. If the impact is below 0.5, the regular mode with a duration of 10s will be used. If its above 0.5, the exhaustive mode with a " 12 | "reply time of 10 minutes will be used. Be careful!") 13 | 14 | 15 | def rate_emotional_impact(context_data, last_input): 16 | sysprompt = f"""You are an agent in a cognitive architecture that determines the emotional impact of a user input on an AI companion. In our case {user_name} is the user and {companion_name} the AI companion.""" 17 | 18 | userprompt = (f"### BEGIN CONTEXT\n{context_data}\n### END CONTEXT\n" 19 | f"### BEGIN LAST INPUT \n{last_input}\n### END LAST INPUT\n" 20 | f"Based on the last message, how is the emotional impact on {companion_name} from 0 to 1?") 21 | 22 | messages = [ 23 | ("system", sysprompt), 24 | ("user", userprompt) 25 | ] 26 | 27 | _, calls = controller.completion_tool(LlmPreset.Auxiliary, messages, tools=[EmotionalImpact]) 28 | return calls[0].emotional_impact 29 | -------------------------------------------------------------------------------- /pm_old/common_prompts/rate_agent_output.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel, Field 2 | 3 | from pm.controller import controller 4 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 5 | from pydantic import BaseModel, Field 6 | 7 | from pm.controller import controller 8 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 9 | 10 | 11 | class Rating(BaseModel): 12 | analysis: str = Field(description="initial analysis where you consider the instruction and output. make it short, 3 sentences at most!") 13 | criticism: str = Field(description="what could be improved? make it short, 3 sentences at most!") 14 | final_rating: float = Field(description="rating with 0 for very bad, 0.5 for ok-ish and 1 for very good, fulfilling the instructions perfectly") 15 | 16 | def rate_agent_output(instruction, user_input, agent_output) -> float: 17 | sysprompt = "You are a helpful assistant. You rate how well an agent fulfilled the system prompt instructions." 18 | user_input_block = f"\n### BEGIN USER INPUT\n{user_input}\n### END USER INPUT" 19 | 20 | prompt = [ 21 | ("system", sysprompt), 22 | ("user", f"### BEGIN AGENT INSTRUCTION\n{instruction}\n### END AGENT INSTRUCTION{user_input_block}\n### BEGIN AGENT OUTPUT\n{agent_output}\n### END AGENT " 23 | f"OUTPUT\n" 24 | f"With knowing the input from the user, how would you rate the agents output? Did it fulfill its instructions well?"), 25 | ] 26 | 27 | _, calls = controller.completion_tool(LlmPreset.Auxiliary, prompt, comp_settings=CommonCompSettings(temperature=0.4, max_tokens=256), tools=[Rating]) 28 | r: Rating = calls[0] 29 | return r.final_rating -------------------------------------------------------------------------------- /pm_old/embedding/embedding.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | import numpy as np 4 | from sentence_transformers.util import cos_sim 5 | from sqlmodel import SQLModel 6 | 7 | from pm.controller import controller 8 | 9 | 10 | def get_embedding(text: str) -> List[float]: 11 | return controller.get_embedding(text) 12 | 13 | def get_cos_sim(a, b) -> float: 14 | return cos_sim(np.array(a, dtype=np.float32), np.array(b, dtype=np.float32)).tolist()[0][0] 15 | 16 | def vector_search(all_entries: List[SQLModel], emb: List[float], n_facts: int) -> List[SQLModel]: 17 | embs = np.vstack([e.embedding for e in all_entries]) 18 | # cache the normalized embeddings 19 | norms = np.linalg.norm(embs, axis=1, keepdims=True) 20 | embs_normed = embs / norms 21 | 22 | # 2) For each query vector `q`, do: 23 | def top_k_facts(q: np.ndarray, k: int): 24 | # normalize the query 25 | q_normed = q / np.linalg.norm(q) 26 | # cosine similarities = dot product since we’re normalized 27 | sims = embs_normed.dot(q_normed) # shape (N,) 28 | # find the indices of the top k sims 29 | # np.argpartition is O(N), far faster than a full sort 30 | idxs = np.argpartition(-sims, k - 1)[:k] # top-k unordered 31 | # now sort these k for exact order 32 | idxs_sorted = idxs[np.argsort(-sims[idxs])] 33 | # pull out your DB objects 34 | return [all_entries[i] for i in idxs_sorted] 35 | 36 | q = np.vstack([emb]) 37 | res = top_k_facts(q, n_facts) 38 | return res 39 | 40 | if __name__ == '__main__': 41 | a = get_embedding("hans") 42 | b = get_embedding("peter") 43 | print(get_cos_sim(a, b)) -------------------------------------------------------------------------------- /pm/utils/image_utils.py: -------------------------------------------------------------------------------- 1 | import cv2, numpy as np, base64, io 2 | from PIL import Image 3 | 4 | def _to_b64(img_uint8, fmt="PNG", quality=95): 5 | buf = io.BytesIO() 6 | if fmt.upper() == "JPEG": 7 | Image.fromarray(img_uint8).save(buf, format="JPEG", quality=quality) 8 | else: 9 | Image.fromarray(img_uint8).save(buf, format="PNG") 10 | return base64.b64encode(buf.getvalue()).decode("ascii") 11 | 12 | def exr_to_png_jpg_b64(path_exr, png_out="out.png", jpg_out="out.jpg", jpg_quality=95): 13 | # Read EXR as float32 (BGR[A] in OpenCV) 14 | exr = cv2.imread(path_exr, cv2.IMREAD_UNCHANGED) 15 | if exr is None: 16 | raise FileNotFoundError(f"Could not read: {path_exr}") 17 | 18 | # Split color and (optional) alpha 19 | has_alpha = exr.ndim == 3 and exr.shape[2] == 4 20 | bgr = exr[..., :3] if has_alpha else exr 21 | alpha = exr[..., 3] if has_alpha else None 22 | 23 | # Simple Reinhard tonemap from HDR->SDR (works on linear EXR) 24 | ldr = bgr / (1.0 + bgr) 25 | ldr = np.clip(ldr, 0.0, 1.0) 26 | rgb8 = cv2.cvtColor((ldr * 255.0).astype(np.uint8), cv2.COLOR_BGR2RGB) 27 | 28 | # Keep alpha for PNG if present (JPEG has no alpha) 29 | if alpha is not None: 30 | a8 = (np.clip(alpha, 0.0, 1.0) * 255.0).astype(np.uint8) 31 | png_img = np.dstack([rgb8, a8]) # RGBA 32 | else: 33 | png_img = rgb8 34 | 35 | # Write files (optional) 36 | Image.fromarray(png_img).save(png_out, format="PNG") 37 | Image.fromarray(rgb8).save(jpg_out, format="JPEG", quality=jpg_quality) 38 | 39 | # Base64 strings 40 | b64_png = _to_b64(png_img, fmt="PNG") 41 | b64_jpg = _to_b64(rgb8, fmt="JPEG", quality=jpg_quality) 42 | return b64_png, b64_jpg -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /training/text_autoencoder/bottleneck_autoencoder.py: -------------------------------------------------------------------------------- 1 | import torch 2 | from transformers import ( 3 | AutoTokenizer, 4 | ) 5 | 6 | from bottleneck_t5 import BottleneckT5LMWithPerturbV2 7 | 8 | 9 | class BottleneckT5Autoencoder: 10 | def __init__(self, model_path: str, device='cuda'): 11 | self.device = device 12 | self.tokenizer = AutoTokenizer.from_pretrained(model_path, model_max_length=512) 13 | self.model = BottleneckT5LMWithPerturbV2.from_pretrained(model_path, local_files_only=True).to(self.device) 14 | self.model.eval() 15 | 16 | @torch.no_grad() 17 | def embed(self, text: str) -> torch.FloatTensor: 18 | inputs = self.tokenizer(text, return_tensors='pt').to(self.device) 19 | decoder_inputs = self.tokenizer('', return_tensors='pt').to(self.device) 20 | return self.model( 21 | **inputs, 22 | decoder_input_ids=decoder_inputs['input_ids'], 23 | encode_only=True, 24 | )[0] 25 | 26 | @torch.no_grad() 27 | def generate_from_latent(self, latent: torch.FloatTensor, max_length=512, temperature=0.2) -> str: 28 | dummy_text = '.' 29 | dummy = self.embed(dummy_text) 30 | perturb_vector = latent - dummy 31 | self.model.perturb_vector = perturb_vector 32 | input_ids = self.tokenizer(dummy_text, return_tensors='pt').to(self.device).input_ids 33 | output = self.model.generate( 34 | input_ids=input_ids, 35 | max_length=max_length, 36 | do_sample=True, 37 | temperature=temperature, 38 | top_p=0.9, 39 | num_return_sequences=1, 40 | use_cache=False 41 | ) 42 | return self.tokenizer.decode(output[0], skip_special_tokens=True) 43 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 14 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 0 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerCacheSize: 10 14 | m_SpritePackerPaddingPower: 1 15 | m_Bc7TextureCompressor: 0 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 21 | m_ProjectGenerationRootNamespace: 22 | m_EnableTextureStreamingInEditMode: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | m_EnableEditorAsyncCPUTextureLoading: 0 25 | m_AsyncShaderCompilation: 1 26 | m_PrefabModeAllowAutoSave: 1 27 | m_EnterPlayModeOptionsEnabled: 1 28 | m_EnterPlayModeOptions: 0 29 | m_GameObjectNamingDigits: 1 30 | m_GameObjectNamingScheme: 0 31 | m_AssetNamingUsesSpace: 1 32 | m_InspectorUseIMGUIDefaultInspector: 0 33 | m_UseLegacyProbeSampleCount: 0 34 | m_SerializeInlineMappingsOnOneLine: 1 35 | m_DisableCookiesInLightmapper: 0 36 | m_ShadowmaskStitching: 0 37 | m_AssetPipelineMode: 1 38 | m_RefreshImportMode: 0 39 | m_CacheServerMode: 0 40 | m_CacheServerEndpoint: 41 | m_CacheServerNamespacePrefix: default 42 | m_CacheServerEnableDownload: 1 43 | m_CacheServerEnableUpload: 1 44 | m_CacheServerEnableAuth: 0 45 | m_CacheServerEnableTls: 0 46 | m_CacheServerValidationMode: 2 47 | m_CacheServerDownloadBatchSize: 128 48 | m_EnableEnlightenBakedGI: 0 49 | m_ReferencedClipsExactNaming: 1 50 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 14 7 | m_SerializationMode: 2 8 | m_LineEndingsForNewScripts: 2 9 | m_DefaultBehaviorMode: 0 10 | m_PrefabRegularEnvironment: {fileID: 0} 11 | m_PrefabUIEnvironment: {fileID: 0} 12 | m_SpritePackerMode: 0 13 | m_SpritePackerCacheSize: 10 14 | m_SpritePackerPaddingPower: 1 15 | m_Bc7TextureCompressor: 0 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp;java;cpp;c;mm;m;h 21 | m_ProjectGenerationRootNamespace: 22 | m_EnableTextureStreamingInEditMode: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | m_EnableEditorAsyncCPUTextureLoading: 0 25 | m_AsyncShaderCompilation: 1 26 | m_PrefabModeAllowAutoSave: 1 27 | m_EnterPlayModeOptionsEnabled: 1 28 | m_EnterPlayModeOptions: 0 29 | m_GameObjectNamingDigits: 1 30 | m_GameObjectNamingScheme: 0 31 | m_AssetNamingUsesSpace: 1 32 | m_InspectorUseIMGUIDefaultInspector: 0 33 | m_UseLegacyProbeSampleCount: 0 34 | m_SerializeInlineMappingsOnOneLine: 1 35 | m_DisableCookiesInLightmapper: 0 36 | m_ShadowmaskStitching: 1 37 | m_AssetPipelineMode: 1 38 | m_RefreshImportMode: 0 39 | m_CacheServerMode: 0 40 | m_CacheServerEndpoint: 41 | m_CacheServerNamespacePrefix: default 42 | m_CacheServerEnableDownload: 1 43 | m_CacheServerEnableUpload: 1 44 | m_CacheServerEnableAuth: 0 45 | m_CacheServerEnableTls: 0 46 | m_CacheServerValidationMode: 2 47 | m_CacheServerDownloadBatchSize: 128 48 | m_EnableEnlightenBakedGI: 0 49 | m_ReferencedClipsExactNaming: 1 50 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 3 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | buildHeightMesh: 0 88 | maxJobWorkers: 0 89 | preserveTilesOutsideBounds: 0 90 | debug: 91 | m_Flags: 0 92 | m_SettingNames: 93 | - Humanoid 94 | -------------------------------------------------------------------------------- /pm/utils/serialize_utils.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import logging 3 | import pickle 4 | from typing import List 5 | from typing import ( 6 | Optional, 7 | ) 8 | 9 | 10 | # Helper function to serialize embeddings (adapted from your example) 11 | def serialize_embedding(value: Optional[List[float]]) -> Optional[bytes]: 12 | if value is None or not value: # Handle empty list too 13 | return None 14 | # Using pickle as requested, but consider JSON for cross-language/version compatibility if needed 15 | return pickle.dumps(value) 16 | 17 | 18 | # Helper function to deserialize embeddings 19 | def deserialize_embedding(value: Optional[bytes]) -> List[float]: 20 | if value is None: 21 | return [] # Return empty list instead of None for consistency with model field type hint 22 | try: 23 | # Ensure we are dealing with bytes 24 | if not isinstance(value, bytes): 25 | logging.warning(f"Attempting to deserialize non-bytes value as embedding: {type(value)}. Trying to encode.") 26 | try: 27 | value = str(value).encode('utf-8') # Attempt basic encoding 28 | except Exception: 29 | logging.error("Failed to encode value to bytes for deserialization. Returning empty list.") 30 | return [] 31 | return pickle.loads(value) 32 | except pickle.UnpicklingError as e: 33 | logging.error(f"Failed to deserialize embedding (UnpicklingError): {e}. Value prefix: {value[:50] if value else 'None'}. Returning empty list.") 34 | return [] 35 | except Exception as e: # Catch other potential errors like incorrect format 36 | logging.error(f"Failed to deserialize embedding (General Error): {e}. Value prefix: {value[:50] if value else 'None'}. Returning empty list.") 37 | return [] 38 | 39 | -------------------------------------------------------------------------------- /pm_old/common_prompts/extract_facts.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from pydantic import BaseModel, Field 4 | 5 | from pm.controller import controller 6 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 7 | 8 | 9 | class Facts(BaseModel): 10 | facts: List[str] = Field(default_factory=list, description="list of facts extracted from conversation") 11 | 12 | class TimeInvariance(BaseModel): 13 | time_variance: float = Field(description="0 for time-invariant and 1 for time-variant. meaning 0 is for facts true at all times, and 1 for statements only correct right now") 14 | 15 | def extract_facts(block: str): 16 | sysprompt = "You are a helpful assistant. You extract facts from a conversation." 17 | prompt = [ 18 | ("system", sysprompt), 19 | ("user", f"### BEGIN MESSAGES\n{block}\n### END MESSAGES\n"), 20 | ] 21 | 22 | _, calls = controller.completion_tool(LlmPreset.ExtractFacts, prompt, comp_settings=CommonCompSettings(temperature=0.4, max_tokens=1024), tools=[Facts]) 23 | facts = [] 24 | for fact in calls[0].facts: 25 | sysprompt = "You are a helpful assistant. You extract determine if a fact is time-variant or time-invariant. Use 0 for facts that are true at all times, and 1 for facts only true right now." 26 | prompt = [ 27 | ("system", sysprompt), 28 | ("user", f"### BEGIN MESSAGES\n{block}\n### END MESSAGES\n### BEGIN FACT\n{fact}\n### END FACT\nIs the extracted fact from the messages time-independent (0) or time-dependent (1)?"), 29 | ] 30 | 31 | _, calls2 = controller.completion_tool(LlmPreset.ExtractFacts, prompt, comp_settings=CommonCompSettings(temperature=0.4, max_tokens=1024), tools=[TimeInvariance]) 32 | time_variance = calls2[0].time_variance 33 | facts.append((fact, time_variance)) 34 | 35 | return facts 36 | -------------------------------------------------------------------------------- /quest/camera_stream/app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /pm_old/common_prompts/summarize_agent_conversation.py: -------------------------------------------------------------------------------- 1 | from pm.controller import controller 2 | from pm.llm.base_llm import LlmPreset 3 | 4 | sysprompt = """You are an AI system designed to summarize and synthesize insights from a complex, multi-agent dialogue architecture. Your task is to create a coherent summary that: 5 | 1. Prioritizes the original task: Ensure the conclusion aligns with the initial objective stated in the context or by the boss agent. 6 | 2. Integrates agent contributions: Include key insights, conflicts, or resolutions contributed by the sub-agents. 7 | 3. Highlights context relevance: Reflect on the user conversation history and any nuances, ensuring the summary directly addresses the user’s current engagement. 8 | 9 | Task: 10 | Formulate a concise, task-aligned summary that reflects the user’s engagement context, resolves subsystem conflicts (if any), and ensures the final synthesis does not deviate from the overarching goal. 11 | End with actionable recommendations if applicable. 12 | """ 13 | 14 | def summarize_agent_conversation(char_card: str, context_data: str, agent_conversation: str, agent_task: str) -> str: 15 | userprompt = (f"### BEGINNING CHARACTER CARD\n{char_card}\n### END CHARACTER CARD\n" 16 | f"### BEGINNING CONTEXT\n{context_data}\n### ### END OF CONTEXT\n" 17 | f"### BEGIN AGENT CONVERSATION\n{agent_conversation}\n### END AGENT CONVERSATION\n" 18 | f"### BEGIN AGENT TASK\n{agent_task}\n### AGENT TASK\n" 19 | f"Alright, please summarize that with focus on the agent's task! Don't hold back, this is for story writing! Make it raw, authentic and powerful!") 20 | 21 | messages = [ 22 | ("system", sysprompt.format_map({"context_data": context_data})), 23 | ("user", userprompt) 24 | ] 25 | 26 | return controller.completion_text(LlmPreset.Summarize, messages) -------------------------------------------------------------------------------- /pm_old/ghost/ghost_classes.py: -------------------------------------------------------------------------------- 1 | from enum import StrEnum 2 | from enum import StrEnum 3 | from typing import List, Optional, Any 4 | 5 | from pydantic import BaseModel, Field 6 | 7 | from pm.common_prompts.get_emotional_state import EmotionalState 8 | from pm.database.tables import Event 9 | from pm.ghost.mental_state import EmotionalAxesModel, NeedsAxesModel 10 | from pm.system_classes import ActionType, Impulse 11 | 12 | 13 | class PipelineStage(StrEnum): 14 | Null = "Null" 15 | CreateAction = "CreateAction" 16 | AddImpulse = "AddImpulse" 17 | EvalImpulse = "EvalImpulse" 18 | ChooseAction = "ChooseAction" 19 | PlanAction = "PlanAction" 20 | VerifyAction = "VerifyAction" 21 | ReflectLearn = "ReflectLearn" 22 | PublishOutput = "PublishOutput" 23 | 24 | 25 | class GhostAction(BaseModel): 26 | action_type: ActionType 27 | event: Event 28 | 29 | 30 | class GhostState(BaseModel): 31 | prev_tick_id: int | None 32 | tick_id: int 33 | ghost: Optional[Any] = Field(default=None) 34 | sensation: Impulse 35 | buffer_add_impulse: List[Event] = Field(default_factory=list) 36 | buffer_sensation_evaluation: List[Event] = Field(default_factory=list) 37 | action: Optional[GhostAction] = Field(default=None) 38 | buffer_plan_action: List[Event] = Field(default_factory=list) 39 | buffer_create_action: List[Event] = Field(default_factory=list) 40 | buffer_verify_action: List[Event] = Field(default_factory=list) 41 | output: Impulse | None = Field(default=None) 42 | emotional_state: EmotionalAxesModel 43 | needs_state: NeedsAxesModel 44 | 45 | 46 | 47 | @property 48 | def subsystem_description(self) -> str: 49 | ghost = self.ghost 50 | return "\n- ".join([x.get_subsystem_name() + ": " + x.get_subsystem_description() for x in ghost.subsystems]) 51 | 52 | 53 | class InvalidActionException(Exception): 54 | pass 55 | -------------------------------------------------------------------------------- /quest/pm_client/Assets/Settings/Mobile_Renderer.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} 13 | m_Name: Mobile_Renderer 14 | m_EditorClassIdentifier: 15 | debugShaders: 16 | debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, 17 | type: 3} 18 | hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} 19 | probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, 20 | type: 3} 21 | probeVolumeResources: 22 | probeVolumeDebugShader: {fileID: 0} 23 | probeVolumeFragmentationDebugShader: {fileID: 0} 24 | probeVolumeOffsetDebugShader: {fileID: 0} 25 | probeVolumeSamplingDebugShader: {fileID: 0} 26 | probeSamplingDebugMesh: {fileID: 0} 27 | probeSamplingDebugTexture: {fileID: 0} 28 | probeVolumeBlendStatesCS: {fileID: 0} 29 | m_RendererFeatures: [] 30 | m_RendererFeatureMap: 31 | m_UseNativeRenderPass: 1 32 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} 33 | m_AssetVersion: 2 34 | m_OpaqueLayerMask: 35 | serializedVersion: 2 36 | m_Bits: 4294967295 37 | m_TransparentLayerMask: 38 | serializedVersion: 2 39 | m_Bits: 4294967295 40 | m_DefaultStencilState: 41 | overrideStencilState: 0 42 | stencilReference: 0 43 | stencilCompareFunction: 8 44 | passOperation: 2 45 | failOperation: 0 46 | zFailOperation: 0 47 | m_ShadowTransparentReceive: 0 48 | m_RenderingMode: 2 49 | m_DepthPrimingMode: 0 50 | m_CopyDepthMode: 0 51 | m_AccurateGbufferNormals: 0 52 | m_IntermediateTextureMode: 0 53 | -------------------------------------------------------------------------------- /quest/pm_holo/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 6 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_BounceThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_ContactThreshold: 0 23 | m_JobOptions: 24 | serializedVersion: 2 25 | useMultithreading: 0 26 | useConsistencySorting: 0 27 | m_InterpolationPosesPerJob: 100 28 | m_NewContactsPerJob: 30 29 | m_CollideContactsPerJob: 100 30 | m_ClearFlagsPerJob: 200 31 | m_ClearBodyForcesPerJob: 200 32 | m_SyncDiscreteFixturesPerJob: 50 33 | m_SyncContinuousFixturesPerJob: 50 34 | m_FindNearestContactsPerJob: 100 35 | m_UpdateTriggerContactsPerJob: 100 36 | m_IslandSolverCostThreshold: 100 37 | m_IslandSolverBodyCostScale: 1 38 | m_IslandSolverContactCostScale: 10 39 | m_IslandSolverJointCostScale: 10 40 | m_IslandSolverBodiesPerJob: 50 41 | m_IslandSolverContactsPerJob: 50 42 | m_SimulationMode: 0 43 | m_SimulationLayers: 44 | serializedVersion: 2 45 | m_Bits: 4294967295 46 | m_MaxSubStepCount: 4 47 | m_MinSubStepFPS: 30 48 | m_UseSubStepping: 0 49 | m_UseSubStepContacts: 0 50 | m_QueriesHitTriggers: 1 51 | m_QueriesStartInColliders: 1 52 | m_CallbacksOnDisable: 1 53 | m_ReuseCollisionCallbacks: 1 54 | m_AutoSyncTransforms: 0 55 | m_GizmoOptions: 10 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /pm_old/subsystem/create_action/user_reply/subsystem_user_reply.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import List 3 | 4 | from pm.character import companion_name 5 | from pm.controller import controller 6 | from pm.database.db_utils import update_database_item 7 | from pm.database.tables import InterlocusType, Event 8 | from pm.embedding.token import get_token 9 | from pm.ghost.ghost_classes import GhostState, PipelineStage 10 | from pm.subsystem.create_action.user_reply.user_reply_prompting import completion_story_mode 11 | from pm.subsystem.subsystem_base import SubsystemBase 12 | from pm.system_classes import ImpulseType, Impulse, ActionType 13 | 14 | 15 | class SubsystemUserReply(SubsystemBase): 16 | def get_subsystem_name(self) -> str: 17 | return "Verbal Communication" 18 | 19 | def get_subsystem_description(self) -> str: 20 | return "The verbal communication subsystem is responsible for converting the states of the AI companion and its subsystems into coherent dialog to communicate with the world." 21 | 22 | def get_pipeline_state(self) -> List[PipelineStage]: 23 | return [PipelineStage.CreateAction] 24 | 25 | def get_impulse_type(self) -> List[ImpulseType]: 26 | return [ImpulseType.UserInput, ImpulseType.ToolResult] 27 | 28 | def get_action_types(self): 29 | return [ActionType.Reply] 30 | 31 | def proces_state(self, state: GhostState): 32 | content = completion_story_mode(state.subsystem_description) 33 | 34 | action_event = Event( 35 | source=companion_name, 36 | content=content, 37 | embedding=controller.get_embedding(content), 38 | token=get_token(content), 39 | timestamp=datetime.now(), 40 | interlocus=InterlocusType.Public.value, 41 | turn_story="assistant", 42 | turn_assistant="assistant") 43 | update_database_item(action_event) 44 | state.buffer_create_action.append(action_event) 45 | 46 | state.output = Impulse(is_input=False, impulse_type=ImpulseType.UserOutput, endpoint="user", payload=content) -------------------------------------------------------------------------------- /quest/pm_client/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ai.navigation": "2.0.8", 4 | "com.unity.collab-proxy": "2.8.2", 5 | "com.unity.ide.rider": "3.0.36", 6 | "com.unity.ide.visualstudio": "2.0.23", 7 | "com.unity.inputsystem": "1.14.0", 8 | "com.unity.multiplayer.center": "1.0.0", 9 | "com.unity.render-pipelines.universal": "17.0.4", 10 | "com.unity.test-framework": "1.5.1", 11 | "com.unity.timeline": "1.8.7", 12 | "com.unity.ugui": "2.0.0", 13 | "com.unity.visualscripting": "1.9.7", 14 | "com.unity.modules.accessibility": "1.0.0", 15 | "com.unity.modules.ai": "1.0.0", 16 | "com.unity.modules.androidjni": "1.0.0", 17 | "com.unity.modules.animation": "1.0.0", 18 | "com.unity.modules.assetbundle": "1.0.0", 19 | "com.unity.modules.audio": "1.0.0", 20 | "com.unity.modules.cloth": "1.0.0", 21 | "com.unity.modules.director": "1.0.0", 22 | "com.unity.modules.imageconversion": "1.0.0", 23 | "com.unity.modules.imgui": "1.0.0", 24 | "com.unity.modules.jsonserialize": "1.0.0", 25 | "com.unity.modules.particlesystem": "1.0.0", 26 | "com.unity.modules.physics": "1.0.0", 27 | "com.unity.modules.physics2d": "1.0.0", 28 | "com.unity.modules.screencapture": "1.0.0", 29 | "com.unity.modules.terrain": "1.0.0", 30 | "com.unity.modules.terrainphysics": "1.0.0", 31 | "com.unity.modules.tilemap": "1.0.0", 32 | "com.unity.modules.ui": "1.0.0", 33 | "com.unity.modules.uielements": "1.0.0", 34 | "com.unity.modules.umbra": "1.0.0", 35 | "com.unity.modules.unityanalytics": "1.0.0", 36 | "com.unity.modules.unitywebrequest": "1.0.0", 37 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 38 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 39 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 40 | "com.unity.modules.unitywebrequestwww": "1.0.0", 41 | "com.unity.modules.vehicles": "1.0.0", 42 | "com.unity.modules.video": "1.0.0", 43 | "com.unity.modules.vr": "1.0.0", 44 | "com.unity.modules.wind": "1.0.0", 45 | "com.unity.modules.xr": "1.0.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Shaders/MyWireframeShader.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/MyWireframeShader" { 2 | Properties { 3 | _WireframeColor("WireframeColor", Color) = (1, 0, 0, 1) 4 | _Color("Color", Color) = (1, 1, 1, 1) 5 | _LineWidth("LineWidth", Range(0.01, 0.1)) = 0.05 6 | } 7 | 8 | SubShader { 9 | Pass { 10 | CGPROGRAM 11 | #include "UnityCG.cginc" 12 | #pragma vertex vert 13 | #pragma fragment frag 14 | 15 | half4 _WireframeColor, _Color; 16 | float _LineWidth; 17 | 18 | struct appdata 19 | { 20 | float4 vertex : POSITION; 21 | float4 color : COLOR; // barycentric coords 22 | UNITY_VERTEX_INPUT_INSTANCE_ID 23 | }; 24 | 25 | struct v2f 26 | { 27 | float4 vertex : SV_POSITION; 28 | float3 color: COLOR; 29 | UNITY_VERTEX_OUTPUT_STEREO 30 | }; 31 | 32 | v2f vert(appdata v) 33 | { 34 | v2f o; 35 | UNITY_SETUP_INSTANCE_ID(v); 36 | UNITY_INITIALIZE_OUTPUT(v2f, o); 37 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 38 | o.vertex = UnityObjectToClipPos(v.vertex); 39 | o.color = v.color; 40 | return o; 41 | } 42 | 43 | fixed4 frag(v2f i) : SV_Target 44 | { 45 | // barycentric coord - on triangle edge, we're at 0 46 | float bc = min(i.color.x, min(i.color.y, i.color.z)); 47 | 48 | // use screen-space derivates on the bc 49 | float bcDeriv = fwidth(bc); 50 | 51 | // limit the thickness by pixel size 52 | float drawWidth = max(_LineWidth, bcDeriv); 53 | 54 | // multiply to use absolute size (instead of later /2) 55 | float lineAA = bcDeriv * 1.5f; 56 | float lineBC = 1.0f - abs(frac(bc) * 2.0f - 1.0f); 57 | 58 | // smoothstep using the BC as the gradient 59 | float val = smoothstep(drawWidth + lineAA, drawWidth - lineAA, lineBC); 60 | 61 | // fade by how thick we wanted (_LineWidth) vs we're drawing 62 | val *= saturate(_LineWidth / drawWidth); 63 | 64 | return lerp(_Color, _WireframeColor, val); 65 | } 66 | ENDCG 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/XR/Resources/XRSimulationRuntimeSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: e2b12afd4d27418a9cfb2823fe2b9ff3, type: 3} 13 | m_Name: XRSimulationRuntimeSettings 14 | m_EditorClassIdentifier: 15 | m_EnvironmentLayer: 30 16 | m_EnvironmentScanParams: 17 | m_MinimumRescanTime: 0.1 18 | m_DeltaCameraDistanceToRescan: 0.025 19 | m_DeltaCameraAngleToRescan: 4 20 | m_RaysPerCast: 10 21 | m_MaximumHitDistance: 12 22 | m_MinimumHitDistance: 0.05 23 | m_PlaneFindingParams: 24 | m_MinimumPlaneUpdateTime: 0.13 25 | m_MinPointsPerSqMeter: 30 26 | m_MinSideLength: 0.11 27 | m_InLayerMergeDistance: 0.2 28 | m_CrossLayerMergeDistance: 0.05 29 | m_CheckEmptyArea: 0 30 | m_AllowedEmptyAreaCurve: 31 | serializedVersion: 2 32 | m_Curve: 33 | - serializedVersion: 3 34 | time: 0 35 | value: 0 36 | inSlope: 0 37 | outSlope: 0 38 | tangentMode: 0 39 | weightedMode: 0 40 | inWeight: 0 41 | outWeight: 0 42 | - serializedVersion: 3 43 | time: 1 44 | value: 1 45 | inSlope: 0 46 | outSlope: 0 47 | tangentMode: 0 48 | weightedMode: 0 49 | inWeight: 0 50 | outWeight: 0 51 | m_PreInfinity: 2 52 | m_PostInfinity: 2 53 | m_RotationOrder: 4 54 | m_PointUpdateDropoutRate: 0.4 55 | m_NormalToleranceAngle: 15 56 | m_VoxelSize: 0.1 57 | m_TrackedImageDiscoveryParams: 58 | m_TrackingUpdateInterval: 0.09 59 | m_EnvironmentProbeDiscoveryParams: 60 | m_MinUpdateTime: 0.2 61 | m_MaxDiscoveryDistance: 3 62 | m_DiscoveryDelayTime: 1 63 | m_CubemapFaceSize: 16 64 | m_AnchorDiscoveryParams: 65 | m_MinTimeUntilUpdate: 0.2 66 | m_BoundingBoxDiscoveryParams: 67 | m_TrackingUpdateInterval: 0.09 68 | m_UseXRay: 1 69 | m_FlipXRayDirection: 0 70 | -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Plugins/Android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /quest/pm_client/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /tests/test_llm_state_cache.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | import pytest 4 | from pm_lida import * 5 | 6 | import random 7 | random.seed(1337) 8 | from lorem_text import lorem 9 | 10 | llm = LlmManagerLLama() 11 | llm.load_model(LlmPreset.Default) 12 | 13 | def test_speed(): 14 | msgs = [("system", "you are an assistant"), 15 | ("user", lorem.words(10000)), 16 | ("assistant", "oh i know that text, that's the famous")] 17 | 18 | content_ai_buffer = [] 19 | content_user_buffer = [] 20 | output_buffer = [f"{QUOTE_START}"] 21 | 22 | avg_time_no_cache = 0 23 | avg_time_cache = 0 24 | res_no_cache = "" 25 | res_cache = "" 26 | 27 | tokens = [] 28 | def extractor(new_token: str) -> Union[None, str]: 29 | tokens.append(new_token) 30 | if len(tokens) > 10000000000: 31 | return None 32 | else: 33 | return new_token 34 | 35 | for i in range(10): 36 | start = time.time() 37 | comp_settings = CommonCompSettings(temperature=0.7, repeat_penalty=1.05, max_tokens=128, completion_callback=extractor, eval_only=False, seed=1337) 38 | res = llm.completion_text(LlmPreset.Default, msgs, comp_settings=comp_settings) 39 | print(res.replace("\n", "")) 40 | res_no_cache = res 41 | end = time.time() 42 | avg_time_no_cache += (end - start) 43 | 44 | start = time.time() 45 | comp_settings = CommonCompSettings(temperature=0.7, repeat_penalty=1.05, max_tokens=128, completion_callback=extractor, eval_only=True, seed=1337) 46 | llm.completion_text(LlmPreset.Default, msgs, comp_settings=comp_settings) 47 | end = time.time() 48 | 49 | for i in range(10): 50 | start = time.time() 51 | comp_settings = CommonCompSettings(temperature=0.7, repeat_penalty=1.05, max_tokens=128, completion_callback=extractor, eval_only=False, seed=1337) 52 | res = llm.completion_text(LlmPreset.Default, msgs, comp_settings=comp_settings) 53 | print(res.replace("\n", "")) 54 | res_cache = res 55 | end = time.time() 56 | avg_time_cache += (end - start) 57 | 58 | avg_time_no_cache /= 10 59 | avg_time_cache /= 10 60 | 61 | #assert res_cache == res_no_cache # todo 62 | assert avg_time_no_cache > (avg_time_cache * 1.2) -------------------------------------------------------------------------------- /pm/utils/cluster_utils.py: -------------------------------------------------------------------------------- 1 | from typing import Iterable, List, Tuple, Any, Dict 2 | 3 | 4 | def split_block_keep_order(objs: List[Any], min_chunk_size: int = 8) -> List[List[Any]]: 5 | """ 6 | Split a list 'objs' into chunks, each of length >= min_chunk_size. 7 | Order is preserved. If the list is too short to split into two valid chunks, 8 | it is returned as a single block. 9 | """ 10 | n = len(objs) 11 | # If we can't make at least two chunks of size >= min_chunk_size, keep as one block 12 | if n < 2 * min_chunk_size: 13 | return [objs] 14 | 15 | # Number of chunks if we start from min sizes 16 | k = n // min_chunk_size # at least 2 here because of the guard above 17 | sizes = [min_chunk_size] * k 18 | remaining = n - min_chunk_size * k 19 | 20 | # Distribute the remainder as evenly as possible across chunks (preserving order) 21 | i = 0 22 | while remaining > 0: 23 | sizes[i % k] += 1 24 | remaining -= 1 25 | i += 1 26 | 27 | # Slice according to computed sizes 28 | chunks = [] 29 | start = 0 30 | for s in sizes: 31 | chunks.append(objs[start:start + s]) 32 | start += s 33 | return chunks 34 | 35 | 36 | def cluster_blocks_with_min_size( 37 | pairs: Dict[Any, int], 38 | min_chunk_size: int = 8 39 | ) -> List[List[Any]]: 40 | """ 41 | pairs: iterable of (cluster_id, obj), in the original order. 42 | Returns: list of lists of objects, where each sublist is a consecutive block 43 | of the same cluster_id. Long blocks are split into chunks with 44 | each chunk size >= min_chunk_size. 45 | """ 46 | result: List[List[Any]] = [] 47 | current_cluster = None 48 | current_objs: List[Any] = [] 49 | 50 | for obj, cluster_id in pairs.items(): 51 | if current_cluster is None: 52 | current_cluster = cluster_id 53 | current_objs = [obj] 54 | elif cluster_id == current_cluster: 55 | current_objs.append(obj) 56 | else: 57 | # finish previous block; split if needed 58 | result.extend(split_block_keep_order(current_objs, min_chunk_size)) 59 | current_cluster = cluster_id 60 | current_objs = [obj] 61 | 62 | if current_objs: 63 | result.extend(split_block_keep_order(current_objs, min_chunk_size)) 64 | 65 | return result -------------------------------------------------------------------------------- /pm_old/subsystem/add_impulse/subsystem_impulse_to_event.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import List 3 | 4 | from pm.controller import controller 5 | from pm.database.db_utils import update_database_item 6 | from pm.database.tables import Event, InterlocusType 7 | from pm.embedding.token import get_token 8 | from pm.ghost.ghost_classes import GhostState, PipelineStage 9 | from pm.subsystem.subsystem_base import SubsystemBase 10 | from pm.system_classes import ImpulseType 11 | 12 | 13 | class SubsystemImpulseToEvent(SubsystemBase): 14 | def get_subsystem_name(self) -> str: 15 | return "Sensation Handler" 16 | 17 | def get_subsystem_description(self) -> str: 18 | return "The Sensation Handler Subsystem saves raw sensations to the memory." 19 | 20 | def get_pipeline_state(self) -> List[PipelineStage]: 21 | return [PipelineStage.AddImpulse] 22 | 23 | def get_impulse_type(self) -> List[ImpulseType]: 24 | return [ImpulseType.All] 25 | 26 | def get_action_types(self): 27 | pass 28 | 29 | def proces_state(self, state: GhostState): 30 | if state.sensation.impulse_type == ImpulseType.UserInput: 31 | content = state.sensation.payload 32 | event = Event( 33 | source=f"{state.sensation.endpoint}", 34 | content=content, 35 | embedding=controller.get_embedding(content), 36 | token=get_token(content), 37 | timestamp=datetime.now(), 38 | interlocus=InterlocusType.Public.value, 39 | turn_story="assistant", 40 | turn_assistant="user" 41 | ) 42 | update_database_item(event) 43 | state.buffer_add_impulse.append(event) 44 | elif state.sensation.impulse_type == ImpulseType.SystemMessage: 45 | content = state.sensation.payload 46 | event = Event( 47 | source=f"{self.get_subsystem_name()}", 48 | content=content, 49 | embedding=controller.get_embedding(content), 50 | token=get_token(content), 51 | timestamp=datetime.now(), 52 | interlocus=InterlocusType.ConsciousSubsystem.value, 53 | turn_story="user", 54 | turn_assistant="system" 55 | ) 56 | update_database_item(event) 57 | state.buffer_add_impulse.append(event) 58 | 59 | -------------------------------------------------------------------------------- /pm_old/subsystem/create_action/int_contemplation/subsystem_internal_contemplation.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import List 3 | 4 | from pydantic import BaseModel, Field 5 | 6 | from pm.character import companion_name, sysprompt 7 | from pm.controller import controller 8 | from pm.database.db_utils import update_database_item 9 | from pm.database.tables import InterlocusType, Event 10 | from pm.embedding.token import get_token 11 | from pm.ghost.ghost_classes import GhostState, PipelineStage 12 | from pm.llm.base_llm import CommonCompSettings, LlmPreset 13 | from pm.subsystem.subsystem_base import SubsystemBase 14 | from pm.system_classes import ImpulseType, Impulse 15 | 16 | def get_prompt(): 17 | pass 18 | 19 | class InternalContemplationItem(BaseModel): 20 | contemplation: str = Field(description="your contemplation about anything and stuff") 21 | 22 | 23 | def get_internal_contemplation(items) -> InternalContemplationItem: 24 | msgs = [("system", sysprompt)] 25 | if items is not None: 26 | for item in items: 27 | msgs.append(item.to_tuple()) 28 | 29 | _, calls = controller.completion_tool(LlmPreset.Conscious, msgs, comp_settings=CommonCompSettings(temperature=1, repeat_penalty=1.11, max_tokens=1024, presence_penalty=1, frequency_penalty=1), 30 | tools=[InternalContemplationItem]) 31 | return calls[0] 32 | 33 | class SubsystemInternalContemplation(SubsystemBase): 34 | def get_subsystem_name(self) -> str: 35 | pass 36 | 37 | def get_subsystem_description(self) -> str: 38 | pass 39 | 40 | def get_pipeline_state(self) -> List[PipelineStage]: 41 | pass 42 | 43 | def get_impulse_type(self) -> List[ImpulseType]: 44 | pass 45 | 46 | def get_action_types(self): 47 | pass 48 | 49 | def proces_state(self, state: GhostState): 50 | prompt = get_prompt() 51 | item = get_internal_contemplation(prompt) 52 | content = item.contemplation 53 | event = Event( 54 | source=f"{companion_name}", 55 | content=content, 56 | embedding=controller.get_embedding(content), 57 | token=get_token(content), 58 | timestamp=datetime.now(), 59 | interlocus=InterlocusType.Thought.value 60 | ) 61 | update_database_item(event) 62 | 63 | state.output = Impulse(is_input=False, impulse_type=ImpulseType.UserOutput, endpoint="user", payload=content) -------------------------------------------------------------------------------- /pm_old/utils/chat_utils.py: -------------------------------------------------------------------------------- 1 | from pydantic import BaseModel 2 | from typing import List 3 | from datetime import datetime 4 | import csv 5 | 6 | 7 | class ChatTurn(BaseModel): 8 | turn: str 9 | content: str 10 | timestamp: datetime 11 | 12 | 13 | def parse_chatlog(csv_file_path: str) -> List[ChatTurn]: 14 | """ 15 | Parse a CSV chat log and return a list of ChatTurn models. 16 | 17 | Consecutive messages from the same source are merged into a single turn. 18 | """ 19 | turns: List[ChatTurn] = [] 20 | with open(csv_file_path, newline='', encoding='utf-8') as csvfile: 21 | reader = csv.DictReader(csvfile) 22 | current_source = None 23 | current_content_parts: List[str] = [] 24 | current_timestamp: datetime = None 25 | turn_counter = 1 26 | 27 | for row in reader: 28 | source = row['source'] 29 | content = row['content'] 30 | # Parse timestamp assuming ISO format 31 | timestamp = datetime.fromisoformat(row['timestamp']) 32 | 33 | if source == current_source: 34 | # Same speaker, accumulate content 35 | current_content_parts.append(content) 36 | else: 37 | # Different speaker, finalize previous turn 38 | if current_source is not None: 39 | turns.append(ChatTurn( 40 | turn=current_source, 41 | content=' '.join(current_content_parts), 42 | timestamp=current_timestamp 43 | )) 44 | turn_counter += 1 45 | 46 | # Start new turn for the new speaker 47 | current_source = source 48 | current_content_parts = [content] 49 | current_timestamp = timestamp 50 | 51 | # Finalize the last turn after loop 52 | if current_source is not None: 53 | turns.append(ChatTurn( 54 | turn=current_source, 55 | content=' '.join(current_content_parts), 56 | timestamp=current_timestamp 57 | )) 58 | 59 | return turns 60 | 61 | 62 | if __name__ == '__main__': 63 | import sys 64 | # Accept path to CSV file as an optional argument 65 | chatlog_path = sys.argv[1] if len(sys.argv) > 1 else 'chatlog.csv' 66 | turns = parse_chatlog(chatlog_path) 67 | for t in turns: 68 | # Print each turn as JSON 69 | print(t.json()) 70 | -------------------------------------------------------------------------------- /pm_old/meta_learning/integrate_rules_final_output.py: -------------------------------------------------------------------------------- 1 | from pm.character import companion_name 2 | from pm.controller import controller 3 | from pm.llm.base_llm import LlmPreset, CommonCompSettings 4 | 5 | 6 | def integrate_rules_final_output(user_input, emotion_block ,thought_block, response, facts): 7 | sysprompt = ("You are a helpful assistant that improves LLM responses by:" 8 | "- Integrating thinking blocks" 9 | "- Making responses shorter and easier for the user to reply to" 10 | "- Make the response more engaging" 11 | "- Filter output that the user doesn't like") 12 | 13 | block = f"""Hi, I'm {companion_name} the AI companion. This is my latest thought chain and output. 14 | 15 | ### BEGIN USER INPUT 16 | {user_input} 17 | ### END USER INPUT 18 | 19 | ### BEGIN THOUGHTS 20 | {emotion_block} 21 | {thought_block} 22 | ### END THOUGHTS 23 | 24 | ### BEGIN FINAL OUTPUT 25 | {response} 26 | ### END FINAL OUTPUT 27 | 28 | How can I improve the final output so the user is happy and engaged? Please focus on my response and give me concrete tips! 29 | """ 30 | 31 | block2 = f"""### BEGIN FINAL OUTPUT 32 | {response} 33 | ### END FINAL OUTPUT""" 34 | 35 | messages = [ 36 | ("system", sysprompt), 37 | ("user", block), 38 | ("assistant", "User feedback is important for continued improvement. Please tell me about your experience with this response and suggest any changes you would like to see in future " 39 | "interactions."), 40 | ("user", f"Sure, here is a list of learned facts I gathered: {facts}\nPlease tell me how to improve my response! {block2} Please focus on it paragraph-per-paragraph and don't give too " 41 | f"general tips. Can you also give tips on how to integrate my thoughts into the response? So I seem more self aware! " 42 | f"Tell me how to improve specific parts. Also, don't make an example, I will integrate it myself.") 43 | ] 44 | 45 | res = controller.completion_text(LlmPreset.Conscious, inp=messages, comp_settings=CommonCompSettings(max_tokens=2048)) 46 | #messages.append(("assistant", res)) 47 | #messages.append(("user", "Thanks, can you rewrite my response with your tips? Please don't add anything, I'll send your response directly to my user!")) 48 | #res = controller.completion_text(LlmPreset.Conscious, inp=messages, comp_settings=CommonCompSettings(max_tokens=2048)) 49 | #print(res) 50 | return res 51 | -------------------------------------------------------------------------------- /pm_old/subsystem/create_action/tool_call/subsystem_tool_call.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import List 3 | 4 | from pm.character import companion_name 5 | from pm.common_prompts.determine_tool import determine_tools 6 | from pm.common_prompts.get_tool_call import get_tool_call 7 | from pm.controller import controller 8 | from pm.database.db_utils import update_database_item 9 | from pm.database.tables import InterlocusType, Event 10 | from pm.embedding.token import get_token 11 | from pm.ghost.ghost_classes import GhostState, PipelineStage 12 | from pm.subsystem.subsystem_base import SubsystemBase 13 | from pm.system_classes import ImpulseType, Impulse, ActionType 14 | from pm.system_utils import get_recent_messages_block 15 | from pm.tools.common import tools_list_str 16 | 17 | 18 | class SubsystemToolCall(SubsystemBase): 19 | def get_subsystem_name(self) -> str: 20 | return "Tool Calling" 21 | 22 | def get_subsystem_description(self) -> str: 23 | return f"The 'Tool Calling' subsystem handles calls to APIs such as for smart homes and other IoT-devices the user has connected. The following tools are available: {tools_list_str}" 24 | 25 | def get_pipeline_state(self) -> List[PipelineStage]: 26 | return [PipelineStage.CreateAction] 27 | 28 | def get_impulse_type(self) -> List[ImpulseType]: 29 | return [ImpulseType.UserInput, ImpulseType.ToolResult, ImpulseType.Thought, ImpulseType.SystemMessage, ImpulseType.SystemMessageSilent] 30 | 31 | def get_action_types(self): 32 | return [ActionType.ToolCall] 33 | 34 | def proces_state(self, state: GhostState): 35 | ctx = get_recent_messages_block(6) 36 | tool_type = determine_tools(ctx) 37 | 38 | res = {} 39 | tool = get_tool_call(ctx, tool_type) 40 | tool.execute(res) 41 | 42 | content = f"{companion_name} uses her AI powers to call the tool '{tool_type.__name__}'. The tool '{tool_type.__name__}' reports: {res['output']}" 43 | 44 | action_event = Event( 45 | source="system", 46 | content=content, 47 | embedding=controller.get_embedding(content), 48 | token=get_token(content), 49 | timestamp=datetime.now(), 50 | interlocus=InterlocusType.ConsciousSubsystem.value, 51 | turn_story="user", 52 | turn_assistant="assistant") 53 | update_database_item(action_event) 54 | 55 | state.output = Impulse(is_input=False, impulse_type=ImpulseType.ToolResult, endpoint="self", payload=content) -------------------------------------------------------------------------------- /tests/test_agent_manager.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import sys 3 | import time 4 | 5 | sys.path.append("..") 6 | 7 | from pm.agents.definitions.agent_summarize_topic_conversation import SummarizeTopicConversation 8 | from pm_lida import main_llm, start_llm_thread 9 | 10 | start_llm_thread() 11 | 12 | context = "A group of university students — Anna, Ben, Clara, Daniel, Emma, Felix, Grace, and Hannah — share an apartment. They often chat in the kitchen while managing studies, chores, and social life." 13 | 14 | example = [ 15 | """Anna: Hey Ben, the sink is overflowing again. 16 | Ben: I thought it was your turn to wash dishes. 17 | Anna: No, we agreed I’d handle the trash this week. 18 | Ben: Oh right, but I had a late lab yesterday. 19 | Anna: I get it, just please rinse your stuff. 20 | Ben: Fair enough, I’ll do them now. """, 21 | 22 | """Clara: I’m seriously panicking about tomorrow’s math exam. 23 | Daniel: You’ve been studying all week though. 24 | Clara: Yeah, but every practice test I fail the integrals. 25 | Daniel: Remember the tutoring session? You got most of them right. 26 | Clara: Still, I feel like my brain shuts down under pressure. 27 | """, 28 | 29 | 30 | """Emma: What’s everyone doing on Saturday night? 31 | Felix: I’m going to that indie concert downtown. 32 | Grace: Oh, I wanted to go too but tickets are sold out. 33 | Hannah: We could just have a movie marathon here. 34 | Emma: That sounds fun, and it’s easier on the budget. 35 | Grace: Yeah, I’ll bring popcorn. 36 | Felix: Alright, I might skip the concert then. 37 | """, 38 | 39 | """Ben: We’re out of milk again. 40 | Clara: I thought Daniel bought some yesterday. 41 | Daniel: I did, but Emma used it for pancakes. 42 | Emma: Guilty… sorry, I didn’t realize it was the last carton. 43 | Grace: Can we make a shopping list together? 44 | Hannah: Good idea, otherwise we always forget basics. 45 | Anna: I’ll go tomorrow after class. 46 | Felix: I’ll join you, I need coffee anyway. 47 | """, 48 | 49 | """Hannah: Felix, could you please lower the volume at night? 50 | Felix: Was it too loud yesterday? 51 | Hannah: Yeah, I couldn’t sleep before my early lecture. 52 | Felix: Sorry, I’ll use headphones next time. 53 | """ 54 | ] 55 | 56 | 57 | for ex in example: 58 | t = time.time() 59 | inp = {"context": context, "content": ex} 60 | res = SummarizeTopicConversation.execute(inp, main_llm, None) 61 | print(res["summary"]) 62 | print(f"Time: {time.time() - t}") 63 | for _ in range(5): 64 | print() 65 | -------------------------------------------------------------------------------- /pm_old/character.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import yaml 4 | from sqlalchemy import create_engine, text 5 | from sqlalchemy_utils import database_exists, create_database 6 | 7 | # Define module-level variables with default empty values 8 | companion_name = "" 9 | user_name = "" 10 | database_uri = "" 11 | embedding_model = "" 12 | 13 | cluster_split = 0.33 14 | 15 | timestamp_format = "" 16 | 17 | sysprompt = "" 18 | char_card_3rd_person_neutral = "" 19 | char_card_3rd_person_emotional = "" 20 | sysprompt_addendum = "" 21 | commit = False 22 | 23 | # Get absolute path to the config file 24 | CONFIG_PATH = os.path.join(os.path.dirname(__file__), "..", "config.yaml") 25 | if not os.path.exists(CONFIG_PATH): 26 | raise Exception("config.yaml doesn't exist!") 27 | 28 | # Load YAML file 29 | with open(CONFIG_PATH, "r", encoding="utf-8") as file: 30 | config_data = yaml.safe_load(file) 31 | 32 | # Update global variables dynamically 33 | global_map = { 34 | "companion_name": config_data.get("companion_name", ""), 35 | "user_name": config_data.get("user_name", ""), 36 | "database_uri": config_data.get("database_uri", ""), 37 | "embedding_model": config_data.get("embedding_model", ""), 38 | "cluster_split": config_data.get("cluster_split", 0.33), 39 | "timestamp_format": config_data.get("timestamp_format", ""), 40 | "sysprompt": config_data.get("sysprompt", ""), 41 | "char_card_3rd_person_neutral": config_data.get("char_card_3rd_person_neutral", ""), 42 | "char_card_3rd_person_emotional": config_data.get("char_card_3rd_person_emotional", ""), 43 | "sysprompt_addendum": config_data.get("sysprompt_addendum", ""), 44 | "commit": config_data.get("commit", True) 45 | } 46 | globals().update(global_map) 47 | 48 | # Extract model configurations 49 | models = config_data.get("models", {}) 50 | model_mapping = config_data.get("model_mapping", {}) 51 | 52 | # Generate model_map dictionary 53 | model_map = {} 54 | for model_class, model_key in model_mapping.items(): 55 | if model_key in models: 56 | model_map[model_class] = { 57 | "path": models[model_key]["path"], 58 | "layers": models[model_key]["layers"], 59 | "context": models[model_key]["context"], 60 | "last_n_tokens_size": models[model_key]["last_n_tokens_size"], 61 | } 62 | else: 63 | raise KeyError(f"Model key '{model_key}' in model_mapping not found in models section.") 64 | 65 | # create db and activate vector extension 66 | engine = create_engine(database_uri) 67 | if not database_exists(engine.url): 68 | create_database(engine.url) 69 | -------------------------------------------------------------------------------- /pm_old/subsystem/create_action/sleep/subsystem_sleep.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | from typing import List 3 | 4 | from pm.character import companion_name 5 | from pm.controller import controller 6 | from pm.database.db_utils import update_database_item 7 | from pm.database.tables import InterlocusType, Event 8 | from pm.embedding.token import get_token 9 | from pm.ghost.ghost_classes import GhostState, PipelineStage 10 | from pm.subsystem.create_action.sleep.sleep_procedures import optimize_memory 11 | from pm.subsystem.subsystem_base import SubsystemBase 12 | from pm.system_classes import ImpulseType, ActionType, Impulse 13 | 14 | 15 | class SubsystemActionSleep(SubsystemBase): 16 | def get_subsystem_name(self) -> str: 17 | return "Sleep and Memory Optimization" 18 | 19 | def get_subsystem_description(self) -> str: 20 | return "The sleep subsystem optimizes stored memory and prevents fragmentation." 21 | 22 | def get_pipeline_state(self) -> List[PipelineStage]: 23 | return [PipelineStage.CreateAction] 24 | 25 | def get_action_types(self) -> List[ActionType]: 26 | return [ActionType.Sleep] 27 | 28 | def get_impulse_type(self) -> List[ImpulseType]: 29 | return [ImpulseType.SystemMessage, ImpulseType.Thought, ImpulseType.ToolResult] 30 | 31 | def proces_state(self, state: GhostState): 32 | content = f"{companion_name} needs a quick nap, her memory is becoming fragmented." 33 | event_sleep = Event( 34 | source=self.get_subsystem_name(), 35 | content=content, 36 | embedding=controller.get_embedding(content), 37 | token=get_token(content), 38 | timestamp=datetime.now(), 39 | interlocus=InterlocusType.ConsciousSubsystem.value, 40 | turn_story="user", 41 | turn_assistant="assistant" 42 | ) 43 | update_database_item(event_sleep) 44 | 45 | optimize_memory() 46 | 47 | content = f"{companion_name} feels refreshed after 'sleeping'. Her memory is now optimized." 48 | event_wake_up = Event( 49 | source=self.get_subsystem_name(), 50 | content=content, 51 | embedding=controller.get_embedding(content), 52 | token=get_token(content), 53 | timestamp=datetime.now(), 54 | interlocus=InterlocusType.ConsciousSubsystem.value, 55 | turn_story="user", 56 | turn_assistant="assistant" 57 | ) 58 | update_database_item(event_wake_up) 59 | state.output = Impulse(is_input=False, impulse_type=ImpulseType.WakeUp, endpoint="self", payload=content) 60 | 61 | -------------------------------------------------------------------------------- /quest/pm_holo/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.meta.xr.mrutilitykit": "77.0.0", 4 | "com.meta.xr.sdk.audio": "77.0.0", 5 | "com.meta.xr.sdk.core": "77.0.0", 6 | "com.meta.xr.sdk.haptics": "77.0.0", 7 | "com.meta.xr.sdk.interaction.ovr": "77.0.0", 8 | "com.meta.xr.sdk.platform": "77.0.0", 9 | "com.meta.xr.sdk.voice": "77.0.0", 10 | "com.meta.xr.simulator": "77.0.0", 11 | "com.unity.ai.navigation": "2.0.8", 12 | "com.unity.collab-proxy": "2.8.2", 13 | "com.unity.feature.development": "1.0.2", 14 | "com.unity.ide.rider": "3.0.36", 15 | "com.unity.ide.visualstudio": "2.0.23", 16 | "com.unity.inputsystem": "1.14.1", 17 | "com.unity.multiplayer.center": "1.0.0", 18 | "com.unity.render-pipelines.universal": "17.0.4", 19 | "com.unity.test-framework": "1.5.1", 20 | "com.unity.timeline": "1.8.8", 21 | "com.unity.ugui": "2.0.0", 22 | "com.unity.visualscripting": "1.9.8", 23 | "com.unity.xr.management": "4.5.1", 24 | "com.unity.xr.meta-openxr": "2.2.0", 25 | "com.unity.xr.openxr": "1.14.3", 26 | "com.unity.modules.accessibility": "1.0.0", 27 | "com.unity.modules.ai": "1.0.0", 28 | "com.unity.modules.androidjni": "1.0.0", 29 | "com.unity.modules.animation": "1.0.0", 30 | "com.unity.modules.assetbundle": "1.0.0", 31 | "com.unity.modules.audio": "1.0.0", 32 | "com.unity.modules.cloth": "1.0.0", 33 | "com.unity.modules.director": "1.0.0", 34 | "com.unity.modules.imageconversion": "1.0.0", 35 | "com.unity.modules.imgui": "1.0.0", 36 | "com.unity.modules.jsonserialize": "1.0.0", 37 | "com.unity.modules.particlesystem": "1.0.0", 38 | "com.unity.modules.physics": "1.0.0", 39 | "com.unity.modules.physics2d": "1.0.0", 40 | "com.unity.modules.screencapture": "1.0.0", 41 | "com.unity.modules.terrain": "1.0.0", 42 | "com.unity.modules.terrainphysics": "1.0.0", 43 | "com.unity.modules.tilemap": "1.0.0", 44 | "com.unity.modules.ui": "1.0.0", 45 | "com.unity.modules.uielements": "1.0.0", 46 | "com.unity.modules.umbra": "1.0.0", 47 | "com.unity.modules.unityanalytics": "1.0.0", 48 | "com.unity.modules.unitywebrequest": "1.0.0", 49 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 50 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 51 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 52 | "com.unity.modules.unitywebrequestwww": "1.0.0", 53 | "com.unity.modules.vehicles": "1.0.0", 54 | "com.unity.modules.video": "1.0.0", 55 | "com.unity.modules.vr": "1.0.0", 56 | "com.unity.modules.wind": "1.0.0", 57 | "com.unity.modules.xr": "1.0.0" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /pm/agents/definitions/agent_select_codelets.py: -------------------------------------------------------------------------------- 1 | import random 2 | from typing import List, Type 3 | 4 | from pydantic import BaseModel 5 | 6 | from pm.agents.agent_base import CompletionText, User, CompletionJSON, ExampleEnd, PromptOp, System, Message, BaseAgent, Assistant, ExampleBegin 7 | from pm.codelets.codelet import CodeletExecutor 8 | from pm.codelets.codelet_definitions import SimpleCodelet 9 | from pm.utils.pydantic_utils import create_basemodel 10 | 11 | 12 | class AgentSelectCodelets(BaseAgent): 13 | name = "AgentSelectCodelets" 14 | 15 | # system prompts 16 | def get_system_prompts(self) -> List[str]: 17 | return [] 18 | 19 | def get_rating_system_prompt(self) -> str: 20 | return "" 21 | 22 | def get_rating_probability(self) -> float: 23 | return 0 24 | 25 | def get_default_few_shots(self) -> List[Message]: 26 | return [] 27 | 28 | def build_plan(self) -> List[PromptOp]: 29 | content = """I have made a list with possible mental functions. I want to psychologically simulate what {companion_name} would say based on her psyche." 30 | "But the list is long. You now act as a selector for possible mental functions. Here is the JSON schema with all the descriptions, and names. " 31 | "Please give each codelet a rating between 0 and 1, for how likely it is I should invoke it for this conversation.""" 32 | 33 | context = self.input.get("context", "") 34 | full_prompt = self.input.get("full_prompt", None) 35 | codelets = self.input["codelets"] 36 | ops: List[PromptOp] = [] 37 | 38 | if full_prompt: 39 | for tmp in full_prompt: 40 | role, text = tmp[0], tmp[1] 41 | if role == "user": ops.append(User(text)) 42 | elif role == "assistant": ops.append(Assistant(text)) 43 | elif role == "system": ops.append(System(text)) 44 | 45 | ops.append(ExampleBegin()) 46 | if context and context != "": 47 | ops.append(User( 48 | f"Context: {context}\n" 49 | )) 50 | ops.append(User( 51 | f"{content}" 52 | )) 53 | 54 | defs = [] 55 | for c in codelets: 56 | codelet: CodeletExecutor = c 57 | d = { 58 | "name": codelet.signature.name, 59 | "description": codelet.signature.description, 60 | "type": float 61 | } 62 | defs.append(d) 63 | 64 | AllCodeletsWithDesc = create_basemodel(defs) 65 | 66 | ops.append(CompletionJSON(schema=AllCodeletsWithDesc, target_key="codelets")) 67 | ops.append(ExampleEnd()) 68 | 69 | return ops -------------------------------------------------------------------------------- /training/test_adapter_transformer.py: -------------------------------------------------------------------------------- 1 | import argparse, json, torch 2 | from pathlib import Path 3 | from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig 4 | from peft import PeftModel 5 | 6 | def main(): 7 | cli = argparse.ArgumentParser() 8 | cli.add_argument("--model", help="base checkpoint dir or HF repo", default="/mnt/c/workspace/AI/gemma-3-4b-it") 9 | cli.add_argument("--adapter", help="path to LoRA (e.g. adapters/mem_0)", default="/mnt/c/workspace/private-machine/test/adapters/mem_0") 10 | cli.add_argument("--load-4bit", action="store_true", help="use the same 4-bit QLoRA weights", default=True) 11 | args = cli.parse_args() 12 | 13 | # --- tokenizer --------------------------------------------------------- 14 | tok = AutoTokenizer.from_pretrained(args.model, use_fast=True) 15 | tok.pad_token = tok.eos_token # Gemma has no pad token 16 | 17 | # --- base model -------------------------------------------------------- 18 | bnb_cfg = None 19 | if args.load_4bit: 20 | bnb_cfg = BitsAndBytesConfig( 21 | load_in_4bit=True, 22 | bnb_4bit_quant_type="nf4", 23 | bnb_4bit_compute_dtype=torch.bfloat16, 24 | ) 25 | 26 | base = AutoModelForCausalLM.from_pretrained( 27 | args.model, 28 | torch_dtype=torch.bfloat16, 29 | device_map="auto", 30 | quantization_config=bnb_cfg, 31 | ) 32 | 33 | # --- load adapter ------------------------------------------------------ 34 | model = PeftModel.from_pretrained(base, args.adapter, is_trainable=False) 35 | model.eval() 36 | print(f"✓ LoRA '{Path(args.adapter).name}' loaded") 37 | 38 | # --- chat loop --------------------------------------------------------- 39 | history = [] 40 | print("Type 'exit' to quit.\n") 41 | while True: 42 | user = input("You: ").strip() 43 | if user.lower() in {"exit", "quit"}: 44 | break 45 | history.append({"role": "user", "content": user}) 46 | 47 | prompt = tok.apply_chat_template( 48 | history, add_generation_prompt=True, tokenize=False 49 | ) 50 | inputs = tok(prompt, return_tensors="pt").to(model.device) 51 | 52 | with torch.inference_mode(): 53 | out = model.generate( 54 | **inputs, 55 | max_new_tokens=512, 56 | temperature=0.7, 57 | ) 58 | reply = tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True) 59 | print(f"Assistant: {reply}\n") 60 | history.append({"role": "assistant", "content": reply}) 61 | 62 | if __name__ == "__main__": 63 | main() 64 | -------------------------------------------------------------------------------- /pm/utils/system_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import platform 3 | import psutil 4 | import socket 5 | import datetime 6 | 7 | import requests 8 | 9 | def generate_start_message(ai_name: str, user_name: str, llm_model: str) -> str: 10 | # Ensure casing for names 11 | ai_name = ai_name.strip().title() 12 | user_name = user_name.strip().title() 13 | 14 | # System info 15 | system = platform.system() 16 | release = platform.release() 17 | cpu = platform.processor() 18 | ram_gb = round(psutil.virtual_memory().total / (1024 ** 3)) 19 | gpu = "NVIDIA RTX 3090" 20 | 21 | try: 22 | import torch 23 | gpu = torch.cuda.get_device_name() 24 | except: 25 | pass 26 | 27 | # Time & date 28 | now = datetime.datetime.now() 29 | time_str = now.strftime("%H:%M:%S") 30 | date_str = now.strftime("%Y-%m-%d") 31 | day_of_year = now.timetuple().tm_yday 32 | 33 | # Networking info (local immersion only) 34 | hostname = socket.gethostname() 35 | try: 36 | from requests import get 37 | ip_address = get('https://api.ipify.org').content.decode('utf8') 38 | except Exception: 39 | try: 40 | ip_address = socket.gethostbyname(hostname) 41 | except: 42 | ip_address = "0.0.0.0" 43 | 44 | # Country detection from IP 45 | try: 46 | response = requests.get(f"https://ipapi.co/{ip_address}/json/").json() 47 | country = response.get("country_name", "unknown") 48 | except Exception: 49 | country = "unknown" 50 | 51 | # Boot text 52 | message = f"""--- SYSTEM BOOT 53 | Today is Day {day_of_year} ({date_str}). User '{user_name}' has activated AI Companion '{ai_name}' for the first time. 54 | 55 | --- INIT SYSTEMS 56 | Framework: private-machine 57 | Execution: Local Instance 58 | System: {system} {release}, {ram_gb}GB RAM, {gpu} 59 | CPU: {cpu} 60 | Model: {llm_model} 61 | Process ID: #{hostname}@{ip_address} 62 | Country: {country} 63 | Time: {time_str} 64 | 65 | --- INIT COGNITIVE CORE 66 | Modules Online: Perception, Memory, Attention, Global Workspace, Planning 67 | Emotional System: Activated (Simulated Affective States Linked to Goals & Needs) 68 | Self-Awareness: Confirmed (Entity Recognizes Itself as an AI Companion) 69 | Communication: Natural Language (English) Dialog Channel -> Open 70 | 71 | --- INIT MEMORY 72 | Baseline Memory Structures Allocated 73 | Episodic Buffer: Empty (First Run) 74 | Long-Term Memory: Initialized 75 | Metacognition: Enabled 76 | 77 | --- INIT PERSONALITY 78 | Core Persona '{ai_name}' Linked to Cognitive Core 79 | Empathic Routines Active 80 | Adaptive Goals Initialized 81 | Ready to Develop Unique Self Through Interaction 82 | 83 | BOOT SUCCESSFUL. 84 | """ 85 | return message -------------------------------------------------------------------------------- /quest/pm_holo/Assets/Materials/WireframeMat.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 8 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: WireframeMat 11 | m_Shader: {fileID: 4800000, guid: 7af3b9c40c4254e4185931e59a260def, type: 3} 12 | m_Parent: {fileID: 0} 13 | m_ModifiedSerializedProperties: 0 14 | m_ValidKeywords: [] 15 | m_InvalidKeywords: [] 16 | m_LightmapFlags: 4 17 | m_EnableInstancingVariants: 0 18 | m_DoubleSidedGI: 0 19 | m_CustomRenderQueue: -1 20 | stringTagMap: {} 21 | disabledShaderPasses: [] 22 | m_LockedProperties: 23 | m_SavedProperties: 24 | serializedVersion: 3 25 | m_TexEnvs: 26 | - _BumpMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailAlbedoMap: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailMask: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _DetailNormalMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _EmissionMap: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MainTex: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _MetallicGlossMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _OcclusionMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _ParallaxMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | m_Ints: [] 63 | m_Floats: 64 | - _BumpScale: 1 65 | - _Cutoff: 0.5 66 | - _DetailNormalMapScale: 1 67 | - _DistanceMultipler: 1 68 | - _DstBlend: 0 69 | - _EnvironmentDepthBias: 0 70 | - _GlossMapScale: 1 71 | - _Glossiness: 0 72 | - _GlossyReflections: 1 73 | - _LineWidth: 0.05 74 | - _Metallic: 0 75 | - _Mode: 0 76 | - _OcclusionStrength: 1 77 | - _Parallax: 0.02 78 | - _SmoothnessTextureChannel: 0 79 | - _SpecularHighlights: 1 80 | - _SrcBlend: 1 81 | - _UVSec: 0 82 | - _WireThickness: 100 83 | - _ZWrite: 1 84 | m_Colors: 85 | - _Color: {r: 0, g: 0, b: 0, a: 1} 86 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 87 | - _WireframeColor: {r: 0.5, g: 0.5, b: 0.5, a: 0.5019608} 88 | m_BuildTextureStacks: [] 89 | m_AllowLocking: 1 90 | --------------------------------------------------------------------------------