瀏覽代碼

updated prompt

Mish Ushakov 1 年之前
父節點
當前提交
4e601130c6
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      package.json
  2. 2 2
      src/models.ts

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "type": "module",
   "name": "llm-scraper",
-  "version": "1.5.0",
+  "version": "1.5.1",
   "description": "Turn any webpage intro structured data using LLMs",
   "main": "dist/index.js",
   "scripts": {

+ 2 - 2
src/models.ts

@@ -19,8 +19,8 @@ export type ScraperCompletionResult<T extends z.ZodSchema<any>> = {
 const defaultPrompt =
   'You are a sophisticated web scraper. Extract the contents of the webpage'
 
-const defaultCodePrompt = `Provide a scraping function (extract) in JavaScript that extracts and formats data according to a schema from the current page.
-Use const syntax. Call the function. No comments or imports. The code you generate will be executed straight away, you shouldn't output anything besides runnable code.`
+const defaultCodePrompt = `Provide a scraping function in JavaScript that extracts and formats data according to a schema from the current page.
+The function must be IIFE. No comments or imports. The code you generate will be executed straight away, you shouldn't output anything besides runnable code.`
 
 function prepareAISDKPage(page: ScraperLoadResult): UserContent {
   if (page.format === 'image') {