feat(extractSmartScrape): better pagination handling

This commit is contained in:
Gergő Móricz 2025-04-16 16:23:12 -07:00
parent 509e6e658c
commit 751c30f139
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ const commonSmartScrapeProperties = {
shouldUseSmartscrape: {
type: "boolean",
description:
"Set to `true` if any of the extractedData is null and you think you can find the information by performing user-like interactions (e.g., clicking buttons/accordions to reveal hidden text, login, inputs etc.). SmartScrape can perform these actions to access the data.",
"Set to `true` if any of the extractedData is null and you think you can find the information by performing user-like interactions (e.g., clicking buttons/accordions to reveal hidden text, login, inputs, pagination etc.). SmartScrape can perform these actions to access the data.",
},
// Note: extractedData is added dynamically in prepareSmartScrapeSchema
};

View File

@ -386,7 +386,7 @@ export async function generateCompletions({
const repairConfig = {
experimental_repairText: async ({ text, error }) => {
// AI may output a markdown JSON code block. Remove it - mogery
logger.debug("Repairing text", { textType: typeof text, error });
logger.debug("Repairing text", { textType: typeof text, textPeek: JSON.stringify(text).slice(0, 100) + "...", error });
if (typeof text === "string" && text.trim().startsWith("```")) {
if (text.trim().startsWith("```json")) {