code: protected function renderV1()
      {
          $out = ['messages' => []];
  
          $messages = [];
  
          foreach ($this->messages as $message) {
              if ($message instanceof Payload) {
                  $out['data'] = $message->render();
              } else {
                  $messages[] = $message->render();
              }
          }
  
          $out['messages'] = $messages;
  
          if ($this->text) {
              $out['speech'] = $this->text;
          }
  
          $outgoingContexts = [];
          foreach ($this->outgoingContexts as $outgoingContext) {
              $outContexts = ['name' => $outgoingContext->getName()];
  
              if ($outgoingContext->getLifespan()) {
                  $outContexts['lifespan'] = $outgoingContext->getLifespan();
              }
  
              if ($outgoingContext->getParameters()) {
                  $outContexts['parameters'] = $outgoingContext->getParameters();
              }
  
              $outgoingContexts[] = $outContexts;
          }
          $out['contextOut'] = $outgoingContexts;
  
          return $out;
      }
docs: Render response as array for API V1.
  
  @return array