export async function generateContent()

in src/methods/generate-content.ts [46:65]


export async function generateContent(
  apiKey: string,
  model: string,
  params: GenerateContentRequest,
  requestOptions?: SingleRequestOptions,
): Promise<GenerateContentResult> {
  const response = await makeModelRequest(
    model,
    Task.GENERATE_CONTENT,
    apiKey,
    /* stream */ false,
    JSON.stringify(params),
    requestOptions,
  );
  const responseJson: GenerateContentResponse = await response.json();
  const enhancedResponse = addHelpers(responseJson);
  return {
    response: enhancedResponse,
  };
}