Skip to content

Commit 365378a

Browse files
committed
fix: fixed schema example
1 parent 514ba6f commit 365378a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scrapegraph-js/examples/schema_smartScraper_example.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ const apiKey = process.env.SGAI_APIKEY;
66
const url = 'https://scrapegraphai.com/';
77
const prompt = 'What does the company do? and ';
88

9-
const schema = 2;
9+
const schema = z.object({
10+
title: z.string().describe('The title of the webpage'),
11+
description: z.string().describe('The description of the webpage'),
12+
summary: z.string().describe('A brief summary of the webpage'),
13+
});
1014

1115
try {
1216
const response = await smartScraper(apiKey, url, prompt, schema);
1317
console.log(response.result);
1418
} catch (error) {
1519
console.error(error);
16-
}
20+
}

0 commit comments

Comments
 (0)