> ## Documentation Index
> Fetch the complete documentation index at: https://docs.navtalk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Virtual Interviewer

> Use Lauren as a virtual interviewer to conduct engaging candidate screening at scale

![Lauren - Virtual Interviewer](https://navtalk.s3.us-east-2.amazonaws.com/uploadFiles/navtalk.Lauren.png)

## Overview

The **Virtual Interviewer** use case leverages **Lauren** to conduct engaging and scalable candidate screening. This digital human can ask relevant interview questions, assess candidate responses, and provide a consistent interview experience for all applicants.

## Use Case Benefits

* **Scalable Screening**: Interview multiple candidates simultaneously without scheduling constraints
* **Consistent Experience**: Every candidate receives the same professional interview format
* **Time Efficiency**: Automate initial screening rounds, allowing HR teams to focus on top candidates
* **24/7 Availability**: Candidates can interview at their convenience

## Implementation

<CodeGroup>
  ```javascript JavaScript theme={null}
  const NavTalkMessageType = Object.freeze({
      CONNECTED_SUCCESS: "conversation.connected.success",
      REALTIME_SESSION_CREATED: "realtime.session.created",
      REALTIME_SESSION_UPDATED: "realtime.session.updated",
      // ... other event types
  });

  const websocketUrl = 'wss://transfer.navtalk.ai/wss/v2/realtime-chat';
  const license = 'your-license-key';
  const characterName = 'navtalk.Lauren';

  const websocketUrlWithParams = `${websocketUrl}?license=${encodeURIComponent(license)}&name=${encodeURIComponent(characterName)}`;
  const socket = new WebSocket(websocketUrlWithParams);

  // Configure Lauren as a professional interviewer
  socket.onmessage = (event) => {
    if (typeof event.data === 'string') {
      const data = JSON.parse(event.data);
      const nav_data = data.data;
      
      if (data.type === NavTalkMessageType.REALTIME_SESSION_CREATED) {
        // Send conversation history if needed
        // Session configuration (instructions, voice, model) is sent via realtime.input_config
      }
      
      if (data.type === NavTalkMessageType.REALTIME_SESSION_UPDATED) {
        // Session ready, start sending audio input
      }
    }
  };
  ```

  ```python Python theme={null}
  import asyncio
  import websockets
  import json
  from urllib.parse import quote

  NAV_TALK_MESSAGE_TYPE = {
      'CONNECTED_SUCCESS': 'conversation.connected.success',
      'REALTIME_SESSION_CREATED': 'realtime.session.created',
      'REALTIME_SESSION_UPDATED': 'realtime.session.updated',
      # ... other event types
  }

  async def connect_virtual_interviewer():
      websocket_url = 'wss://transfer.navtalk.ai/wss/v2/realtime-chat'
      license = 'your-license-key'
      character_name = 'navtalk.Lauren'
      
      websocket_url_with_params = f'{websocket_url}?license={quote(license)}&name={quote(character_name)}'
      
      async with websockets.connect(websocket_url_with_params) as websocket:
          async for message in websocket:
              if isinstance(message, str):
                  data = json.loads(message)
                  nav_data = data.get('data')
                  
                  if data.get('type') == NAV_TALK_MESSAGE_TYPE['REALTIME_SESSION_CREATED']:
                      # Send conversation history if needed
                      # Session configuration (instructions, voice, model) is sent via realtime.input_config
                      pass
                  
                  if data.get('type') == NAV_TALK_MESSAGE_TYPE['REALTIME_SESSION_UPDATED']:
                      # Session ready, start sending audio input
                      pass

  asyncio.run(connect_virtual_interviewer())
  ```
</CodeGroup>

<Note>
  Customize the interview questions by adjusting the `instructions` field to match specific job requirements and company culture.
</Note>
