spectrawl 0.3.8 → 0.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spectrawl",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "The unified web layer for AI agents. Search (6 engines), stealth browse (Camoufox + Playwright), auth (cookies, multi-account), act (24 adapters, 30+ platforms), proxy rotation. Self-hosted, free.",
5
5
  "main": "src/index.js",
6
6
  "types": "index.d.ts",
@@ -7,11 +7,23 @@ const https = require('https')
7
7
  class Summarizer {
8
8
  constructor(config = {}) {
9
9
  this.provider = config.provider || 'openai'
10
- this.model = config.model || 'gpt-4o-mini'
10
+ this.model = config.model || this._defaultModel()
11
11
  this.apiKey = config.apiKey || process.env[this._envKey()]
12
12
  this.baseUrl = config.baseUrl || null
13
13
  }
14
14
 
15
+ _defaultModel() {
16
+ const defaults = {
17
+ openai: 'gpt-4o-mini',
18
+ anthropic: 'claude-3-5-haiku-20241022',
19
+ gemini: 'gemini-2.5-flash',
20
+ minimax: 'MiniMax-Text-01',
21
+ xai: 'grok-3-mini-fast',
22
+ ollama: 'llama3'
23
+ }
24
+ return defaults[this.provider] || 'gpt-4o-mini'
25
+ }
26
+
15
27
  _envKey() {
16
28
  const keys = {
17
29
  openai: 'OPENAI_API_KEY',
@@ -119,7 +131,7 @@ Answer:`
119
131
  const url = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${this.apiKey}`
120
132
  const body = JSON.stringify({
121
133
  contents: [{ parts: [{ text: prompt }] }],
122
- generationConfig: { temperature: 0.3, maxOutputTokens: 500 }
134
+ generationConfig: { temperature: 0.3, maxOutputTokens: 2048 }
123
135
  })
124
136
 
125
137
  const data = await postJson(url, body, { 'Content-Type': 'application/json' })