소스 검색

added different modes

Mish Ushakov 1 년 전
부모
커밋
726bf987db
3개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      package.json
  2. 1 0
      src/index.ts
  3. 1 0
      src/models.ts

+ 1 - 1
package.json

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

+ 1 - 0
src/index.ts

@@ -33,6 +33,7 @@ export type ScraperLLMOptions = {
   temperature?: number
   maxTokens?: number
   topP?: number
+  mode?: 'auto' | 'json' | 'tool' | 'grammar'
 }
 
 export type ScraperRunOptions = ScraperLLMOptions & ScraperLoadOptions

+ 1 - 0
src/models.ts

@@ -53,6 +53,7 @@ export async function generateAISDKCompletions<T extends z.ZodSchema<any>>(
     temperature: options.temperature,
     maxTokens: options.maxTokens,
     topP: options.topP,
+    mode: options.mode,
   })
 
   return {