function getAiSummary(prompt) {

  const request = {
    "contents": [{
      "role": "user",
      "parts": [{
        "text": prompt
      }]
    }],
    "generationConfig": {
      "temperature": 0.1,
      "maxOutputTokens": 2048,
    },
    "safetySettings": [
      {
        "category": "HARM_CATEGORY_HARASSMENT",
        "threshold": "BLOCK_NONE"
      },
      {
        "category": "HARM_CATEGORY_HATE_SPEECH",
        "threshold": "BLOCK_NONE"
      },
      {
        "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
        "threshold": "BLOCK_NONE"
      },
      {
        "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
        "threshold": "BLOCK_NONE"
      }
    ]
  };

  const credentials = credentialsForVertexAI();

  const fetchOptions = {
    method: 'post',
    headers: {
      'Authorization': `Bearer ${credentials.accessToken}`
    },
    contentType: 'application/json',
    muteHttpExceptions: true,
    payload: JSON.stringify(request)
  }

  const url = `https://${VERTEX_AI_LOCATION}-aiplatform.googleapis.com/v1/projects/${credentials.projectId}/`
  + `locations/${VERTEX_AI_LOCATION}/publishers/google/models/${MODEL_ID}:generateContent`

  const response = UrlFetchApp.fetch(url, fetchOptions);

  const payload = JSON.parse(response);
  const text = payload.candidates[0].content.parts[0].text

  return text
}
Packages prompt and necessary settings, then sends a request to
Vertex API. Returns the response as an JSON object extracted from the
Vertex API response object.

@param prompt - String representing your prompt for Gemini AI.