Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Assets/Lab/Core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ var result = Oculus.Platform.Avatar.LaunchAvatarEditor(options);

Also import *TextMesh Pro Essential Resources* when Unity asks.

Then create your server config via *Tools > Va.Si.Li > Create Endpoints Config*.
Then create your server config via *Tools > Va.Si.Li > Create Endpoints Config*. The servers come from
[Va.Si.Li-Lab-backend](https://github.com/texttechnologylab/Va.Si.Li-Lab-backend).
Required: `database-api` (endpoint `api`) and `Ubiq-server` (`ubiqServer`). Optional: `vr-agent` (`agent`) and
`tts-stt` (`speechSynthesis`) for the LLM agents, `speech2text` and `chatbot` (`speech`) for voice input.
4 changes: 2 additions & 2 deletions Assets/Lab/Core/Runtime/Prefabs/Browser.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5276381352184560912, guid: cf5767a7a6501d04fb202c6ed3ef427c, type: 3}
propertyPath: m_url
value: https://faces.befragung.neps-studie.de/1259000
value: https://texttechnologylab.github.io/Va.Si.Li-Lab/
objectReference: {fileID: 0}
- target: {fileID: 5276381352184560912, guid: cf5767a7a6501d04fb202c6ed3ef427c, type: 3}
propertyPath: m_texSize.x
Expand Down Expand Up @@ -1758,7 +1758,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5877819601335358971, guid: cf5767a7a6501d04fb202c6ed3ef427c, type: 3}
propertyPath: m_url
value: https://faces.befragung.neps-studie.de/1259000
value: https://texttechnologylab.github.io/Va.Si.Li-Lab/
objectReference: {fileID: 0}
- target: {fileID: 5877819601335358971, guid: cf5767a7a6501d04fb202c6ed3ef427c, type: 3}
propertyPath: m_texSize.x
Expand Down
33 changes: 16 additions & 17 deletions Assets/Lab/Core/Runtime/Scripts/LLM/AgentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Threading.Tasks;
using UnityEngine;
using VaSiLi.Networking;
using UnityEngine.SceneManagement;
using Vector3 = UnityEngine.Vector3;

namespace VaSiLi.Llm
Expand All @@ -19,6 +18,9 @@ private string GenerateStandardPrompt()

[SerializeField] private AgentInstance agentPrefab;

[Tooltip("Agents created when the scene starts. The tool-call instructions are appended to each persona.")]
[SerializeField] private List<AgentDefinition> agents = new();

private Dictionary<string, AgentInstance> _agentInstances = new();
private AgentToolProvider _toolProvider;

Expand All @@ -31,25 +33,13 @@ private async void Start()
LoadAgentBots();
}

// Creates the agents configured for this scene
private async void LoadAgentBots()
{
switch (SceneManager.GetActiveScene().name)
foreach (AgentDefinition agent in agents)
{
case "MetaStart":
if (!_agentInstances.ContainsKey("agent_jauch"))
await CreateAgent("agent_jauch",
"You are the German TV host Günther Jauch. " + GenerateStandardPrompt(),
new Vector3(3, 0, 0));
if (!_agentInstances.ContainsKey("agent_barbara"))
await CreateAgent("agent_barbara",
"You are the German TV host Barbara Schöneberger. " + GenerateStandardPrompt(),
new Vector3(-3, 0, 0));
break;
case "EventSystemShowcase_2025":
if (!_agentInstances.ContainsKey("agent_helper_bot"))
await CreateAgent("agent_helper_bot",
"You are a helpful VR assistant. " + GenerateStandardPrompt(), new Vector3(-2, 0, 0));
break;
if (!_agentInstances.ContainsKey(agent.id))
await CreateAgent(agent.id, agent.persona + " " + GenerateStandardPrompt(), agent.position);
}
}

Expand Down Expand Up @@ -100,6 +90,15 @@ public List<AgentInstance> GetActiveAgents()
}
}

/// <summary>An agent to create in a scene: its ID at the agent service, who it is and where it stands.</summary>
[Serializable]
public class AgentDefinition
{
public string id;
[TextArea(2, 6)] public string persona;
public Vector3 position;
}

[Serializable]
public struct AgentRequest
{
Expand Down
4 changes: 3 additions & 1 deletion Assets/Lab/Core/Runtime/Scripts/LLM/PlayerMicListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ private void Awake() {

private void Update() {
// Push-to-talk: A button, right index pinch with hand tracking, or V on desktop
if (!_currentlyTalking && LabInput.PrimaryDown(Key.V)) {
// Only record when someone is listening and a microphone exists
if (!_currentlyTalking && LabInput.PrimaryDown(Key.V)
&& Microphone.devices.Length > 0 && manager.GetActiveAgents().Count > 0) {
_currentlyTalking = true;
Debug.Log("Now recording.");
_clip = Microphone.Start(Microphone.devices[0], true, 10, 44100);
Expand Down
6 changes: 6 additions & 0 deletions Assets/Lab/Core/Runtime/Scripts/Networking/VasiliEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public class VasiliEndpoints : ScriptableObject
[Tooltip("EventSystem template server.")]
public string eventTemplates = "http://localhost:4567";

[Header("InterView")]
[Tooltip("Questionnaire page opened in the in-world browser. The interview token is appended as ?token=...&room=...")]
public string questionnaire = "";
[Tooltip("Follow-up questionnaire the interviewer can send to the interviewee after the interview. Empty: the follow-up button does nothing.")]
public string followupQuestionnaire = "";

[Header("WebRTC")]
[Tooltip("Janus WebSocket endpoint.")]
public string janus = "ws://localhost:8188";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UnityEngine;
using VaSiLi.Networking;

namespace VaSiLi.WebCam
{
Expand All @@ -14,8 +15,8 @@ public class InterviewTokenManager : MonoBehaviour
{
public static InterviewTokenManager Instance { get; private set; }

[Tooltip("Base URL of the questionnaire page. Token is appended as ?token={token}.")]
public string BrowserBaseUrl = "https://faces.befragung.neps-studie.de/1259000";
/// <summary>Base URL of the questionnaire page (from VasiliEndpoints). Token is appended as ?token={token}.</summary>
public string BrowserBaseUrl => VasiliEndpoints.Current.questionnaire;

public string Token { get; private set; } = "";

Expand Down
4 changes: 2 additions & 2 deletions Assets/Lab/Core/Runtime/Scripts/WebCam/WebCamClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public class WebCamClient : MonoBehaviour
[Header("Follow-up Survey (Interviewer)")]
[Tooltip("Button that sends the follow-up survey URL to the remote participant.")]
public Button followupButton;
[Tooltip("URL sent to the interviewee when the follow-up button is pressed.")]
public string followupUrl = "";
/// <summary>URL sent to the interviewee when the follow-up button is pressed (from VasiliEndpoints).</summary>
public string followupUrl => VasiliEndpoints.Current.followupQuestionnaire;
[Tooltip("Fired on this client when a followup_survey URL is received. Arg: url.")]
public UnityEvent<string> OnFollowupSurveyReceived;

Expand Down
8 changes: 8 additions & 0 deletions Assets/Lab/Core/Samples/Objects/InterView.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

137 changes: 137 additions & 0 deletions Assets/Lab/Core/Samples/Objects/InterView/Interviewee Mirror.mat
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6770121763732403451
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
version: 10
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Interviewee Mirror
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses:
- MOTIONVECTORS
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 8400000, guid: 0391600d287b6ca418645b1380f58d47, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 8400000, guid: 0391600d287b6ca418645b1380f58d47, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AddPrecomputedVelocity: 0
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _XRMotionVectorsPass: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Interviewee Mirror
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_IsAlphaChannelOptional: 0
serializedVersion: 6
m_Width: 256
m_Height: 256
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 90
m_ColorFormat: 4
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 1
m_UseDynamicScale: 0
m_UseDynamicScaleExplicit: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_EnableRandomWrite: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Lab/Core/Samples/Objects/Materials/Terrain.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Assets/Lab/Core/Samples/Objects/Materials/Terrain/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CC0 Licensed Textures
Originate from: https://opengameart.org/content/seamless-grass-textures-20-pack, Author: athile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading