INNER CODE UNIT · TypeScript

fetchTitleGenerationData

google-marketing-solutions/feedgen · src/app.ts:675

function fetchTitleGenerationData(
  data: Record<string, unknown>,
  imageUrl: string | null
): string {
  // Extra lines (\n) instruct LLM to comlpete what is missing. Don't remove.
  const dataContext = `Context: ${JSON.stringify(data)}\n\n`;
  const landingPageInfo = fetchLandingPageInfo(
    data,
    getConfigSheetValue(CONFIG.userSettings.title.usePageLinkData)
  );
  let prompt =
    getConfigSheetValue(CONFIG.userSettings.title.fullPrompt) + dataContext;
  if (landingPageInfo) {
    prompt += landingPageInfo;
  }

  if (isErroneousPrompt(prompt)) {
    throw new Error(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…