> ## 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.

# Sales Coach

> Use Luke as a sales coach to provide scalable one-on-one sales training and guidance

![Luke - Sales Coach](https://navtalk.s3.us-east-2.amazonaws.com/uploadFiles/navtalk.Luke.png)

## Overview

The **Sales Coach** use case leverages **Luke** to provide personalized sales training and coaching. This digital coach can role-play sales scenarios, provide feedback on sales techniques, and help sales teams improve their performance through interactive practice sessions.

## Use Case Benefits

* **Practice Anytime**: Sales teams can practice scenarios without scheduling constraints
* **Consistent Training**: Ensure all team members receive the same high-quality coaching
* **Risk-Free Practice**: Role-play difficult situations in a safe environment
* **Scalable Coaching**: Train entire sales teams simultaneously

## 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.Luke';

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

  // Configure Luke as a sales coach
  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_sales_coach():
      websocket_url = 'wss://transfer.navtalk.ai/wss/v2/realtime-chat'
      license = 'your-license-key'
      character_name = 'navtalk.Luke'
      
      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_sales_coach())
  ```
</CodeGroup>

<Note>
  Create scenario-specific coaching sessions by customizing the instructions to simulate different customer types or sales situations.
</Note>
