spectrawl 0.3.3 → 0.3.4
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.
|
|
3
|
+
"version": "0.3.4",
|
|
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",
|
package/src/search/index.js
CHANGED
|
@@ -167,7 +167,7 @@ class SearchEngine {
|
|
|
167
167
|
let answer = null
|
|
168
168
|
const summarizer = this.summarizer || (this.reranker ? new Summarizer({
|
|
169
169
|
provider: 'gemini',
|
|
170
|
-
model: 'gemini-2.
|
|
170
|
+
model: 'gemini-2.5-flash',
|
|
171
171
|
apiKey: process.env.GEMINI_API_KEY
|
|
172
172
|
}) : null)
|
|
173
173
|
|
|
@@ -177,12 +177,12 @@ class SearchEngine {
|
|
|
177
177
|
|
|
178
178
|
const response = {
|
|
179
179
|
answer,
|
|
180
|
-
sources: results.map(r => ({
|
|
180
|
+
sources: results.map((r, i) => ({
|
|
181
181
|
title: r.title,
|
|
182
182
|
url: r.url,
|
|
183
183
|
snippet: r.snippet,
|
|
184
184
|
content: r.fullContent?.slice(0, 2000) || r.snippet || '',
|
|
185
|
-
score: r.score ||
|
|
185
|
+
score: r.score || r.confidence || Math.max(0.5, 1 - (i * 0.05))
|
|
186
186
|
})),
|
|
187
187
|
queries, // show which queries were used
|
|
188
188
|
cached: false
|
|
@@ -8,7 +8,7 @@ const https = require('https')
|
|
|
8
8
|
class QueryExpander {
|
|
9
9
|
constructor(config = {}) {
|
|
10
10
|
this.provider = config.provider || 'gemini'
|
|
11
|
-
this.model = config.model || 'gemini-2.
|
|
11
|
+
this.model = config.model || 'gemini-2.5-flash'
|
|
12
12
|
this.apiKey = config.apiKey || process.env.GEMINI_API_KEY
|
|
13
13
|
this.variants = config.variants || 3
|
|
14
14
|
}
|
|
@@ -69,7 +69,7 @@ Example: ["alternative query 1", "alternative query 2", "alternative query 3"]`
|
|
|
69
69
|
|
|
70
70
|
async _call(prompt) {
|
|
71
71
|
if (this.provider === 'gemini') {
|
|
72
|
-
const model = this.model || 'gemini-2.
|
|
72
|
+
const model = this.model || 'gemini-2.5-flash'
|
|
73
73
|
const url = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${this.apiKey}`
|
|
74
74
|
const body = JSON.stringify({
|
|
75
75
|
contents: [{ parts: [{ text: prompt }] }],
|
package/src/search/reranker.js
CHANGED
|
@@ -8,7 +8,7 @@ const https = require('https')
|
|
|
8
8
|
class Reranker {
|
|
9
9
|
constructor(config = {}) {
|
|
10
10
|
this.provider = config.provider || 'gemini'
|
|
11
|
-
this.model = config.model || 'gemini-2.
|
|
11
|
+
this.model = config.model || 'gemini-2.5-flash'
|
|
12
12
|
this.apiKey = config.apiKey || process.env.GEMINI_API_KEY
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -55,7 +55,7 @@ No explanation, just the array.`
|
|
|
55
55
|
|
|
56
56
|
async _call(prompt) {
|
|
57
57
|
if (this.provider === 'gemini') {
|
|
58
|
-
const model = this.model || 'gemini-2.
|
|
58
|
+
const model = this.model || 'gemini-2.5-flash'
|
|
59
59
|
const url = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${this.apiKey}`
|
|
60
60
|
const body = JSON.stringify({
|
|
61
61
|
contents: [{ parts: [{ text: prompt }] }],
|
package/src/search/summarizer.js
CHANGED
|
@@ -110,7 +110,7 @@ Answer:`
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
async _gemini(prompt) {
|
|
113
|
-
const model = this.model || 'gemini-2.
|
|
113
|
+
const model = this.model || 'gemini-2.5-flash'
|
|
114
114
|
const url = `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${this.apiKey}`
|
|
115
115
|
const body = JSON.stringify({
|
|
116
116
|
contents: [{ parts: [{ text: prompt }] }],
|