@graphext/cuery 0.9.5 → 0.10.1
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/esm/browser.d.ts +1 -1
- package/esm/browser.js +1 -1
- package/esm/mod.d.ts +3 -3
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +3 -3
- package/esm/src/apis/brightdata/contentScraper/index.d.ts.map +1 -0
- package/{script/src/apis/brightdata → esm/src/apis/brightdata/contentScraper}/scrape.d.ts +1 -1
- package/esm/src/apis/brightdata/contentScraper/scrape.d.ts.map +1 -0
- package/esm/src/apis/brightdata/{scrape.js → contentScraper/scrape.js} +2 -2
- package/esm/src/apis/brightdata/llmScraper/brightdata.d.ts +20 -0
- package/esm/src/apis/brightdata/llmScraper/brightdata.d.ts.map +1 -0
- package/esm/src/apis/brightdata/llmScraper/brightdata.js +182 -0
- package/esm/src/apis/brightdata/llmScraper/index.d.ts +14 -0
- package/esm/src/apis/brightdata/llmScraper/index.d.ts.map +1 -0
- package/esm/src/apis/brightdata/llmScraper/index.js +97 -0
- package/esm/src/apis/brightdata/llmScraper/oxy.d.ts +16 -0
- package/esm/src/apis/brightdata/llmScraper/oxy.d.ts.map +1 -0
- package/esm/src/apis/brightdata/llmScraper/oxy.js +171 -0
- package/{script/src/apis/chatgptScraper/scraper.d.ts → esm/src/apis/brightdata/llmScraper/scrape.d.ts} +12 -15
- package/esm/src/apis/brightdata/llmScraper/scrape.d.ts.map +1 -0
- package/esm/src/apis/brightdata/llmScraper/scrape.js +184 -0
- package/esm/src/apis/hasdata/helpers.d.ts.map +1 -1
- package/esm/src/apis/hasdata/helpers.js +56 -18
- package/esm/src/schemas/search.schema.d.ts +2 -2
- package/esm/src/schemas/search.schema.d.ts.map +1 -1
- package/esm/src/schemas/sources.schema.d.ts +1 -4
- package/esm/src/schemas/sources.schema.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/browser.d.ts +1 -1
- package/script/browser.js +1 -1
- package/script/mod.d.ts +3 -3
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +6 -6
- package/script/src/apis/brightdata/contentScraper/index.d.ts.map +1 -0
- package/{esm/src/apis/brightdata → script/src/apis/brightdata/contentScraper}/scrape.d.ts +1 -1
- package/script/src/apis/brightdata/contentScraper/scrape.d.ts.map +1 -0
- package/script/src/apis/brightdata/{scrape.js → contentScraper/scrape.js} +2 -2
- package/script/src/apis/brightdata/llmScraper/brightdata.d.ts +20 -0
- package/script/src/apis/brightdata/llmScraper/brightdata.d.ts.map +1 -0
- package/script/src/apis/brightdata/llmScraper/brightdata.js +219 -0
- package/script/src/apis/brightdata/llmScraper/index.d.ts +14 -0
- package/script/src/apis/brightdata/llmScraper/index.d.ts.map +1 -0
- package/script/src/apis/brightdata/llmScraper/index.js +140 -0
- package/script/src/apis/brightdata/llmScraper/oxy.d.ts +16 -0
- package/script/src/apis/brightdata/llmScraper/oxy.d.ts.map +1 -0
- package/script/src/apis/brightdata/llmScraper/oxy.js +208 -0
- package/{esm/src/apis/chatgptScraper/scraper.d.ts → script/src/apis/brightdata/llmScraper/scrape.d.ts} +12 -15
- package/script/src/apis/brightdata/llmScraper/scrape.d.ts.map +1 -0
- package/script/src/apis/brightdata/llmScraper/scrape.js +224 -0
- package/script/src/apis/hasdata/helpers.d.ts.map +1 -1
- package/script/src/apis/hasdata/helpers.js +56 -18
- package/script/src/schemas/search.schema.d.ts +2 -2
- package/script/src/schemas/search.schema.d.ts.map +1 -1
- package/script/src/schemas/sources.schema.d.ts +1 -4
- package/script/src/schemas/sources.schema.d.ts.map +1 -1
- package/esm/src/apis/brightdata/index.d.ts.map +0 -1
- package/esm/src/apis/brightdata/scrape.d.ts.map +0 -1
- package/esm/src/apis/chatgptScraper/brightdata.d.ts +0 -3
- package/esm/src/apis/chatgptScraper/brightdata.d.ts.map +0 -1
- package/esm/src/apis/chatgptScraper/brightdata.js +0 -172
- package/esm/src/apis/chatgptScraper/index.d.ts +0 -10
- package/esm/src/apis/chatgptScraper/index.d.ts.map +0 -1
- package/esm/src/apis/chatgptScraper/index.js +0 -41
- package/esm/src/apis/chatgptScraper/oxy.d.ts +0 -3
- package/esm/src/apis/chatgptScraper/oxy.d.ts.map +0 -1
- package/esm/src/apis/chatgptScraper/oxy.js +0 -156
- package/esm/src/apis/chatgptScraper/scraper.d.ts.map +0 -1
- package/esm/src/apis/chatgptScraper/scraper.js +0 -98
- package/script/src/apis/brightdata/index.d.ts.map +0 -1
- package/script/src/apis/brightdata/scrape.d.ts.map +0 -1
- package/script/src/apis/chatgptScraper/brightdata.d.ts +0 -3
- package/script/src/apis/chatgptScraper/brightdata.d.ts.map +0 -1
- package/script/src/apis/chatgptScraper/brightdata.js +0 -208
- package/script/src/apis/chatgptScraper/index.d.ts +0 -10
- package/script/src/apis/chatgptScraper/index.d.ts.map +0 -1
- package/script/src/apis/chatgptScraper/index.js +0 -81
- package/script/src/apis/chatgptScraper/oxy.d.ts +0 -3
- package/script/src/apis/chatgptScraper/oxy.d.ts.map +0 -1
- package/script/src/apis/chatgptScraper/oxy.js +0 -192
- package/script/src/apis/chatgptScraper/scraper.d.ts.map +0 -1
- package/script/src/apis/chatgptScraper/scraper.js +0 -139
- /package/esm/src/apis/brightdata/{index.d.ts → contentScraper/index.d.ts} +0 -0
- /package/esm/src/apis/brightdata/{index.js → contentScraper/index.js} +0 -0
- /package/script/src/apis/brightdata/{index.d.ts → contentScraper/index.d.ts} +0 -0
- /package/script/src/apis/brightdata/{index.js → contentScraper/index.js} +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.brightdataProvider = void 0;
|
|
37
|
+
exports.createBrightdataProvider = createBrightdataProvider;
|
|
38
|
+
/* eslint no-console: ["warn", { allow: ["log", "warn", "error"] }] */
|
|
39
|
+
/**
|
|
40
|
+
* Brightdata LLM Scraper Provider.
|
|
41
|
+
*
|
|
42
|
+
* API Flow:
|
|
43
|
+
* 1. Trigger: POST to /datasets/v3/trigger → returns snapshot_id
|
|
44
|
+
* 2. Monitor: GET /datasets/v3/progress/{snapshot_id} until ready
|
|
45
|
+
* 3. Download: GET /datasets/v3/snapshot/{snapshot_id}
|
|
46
|
+
*/
|
|
47
|
+
const dntShim = __importStar(require("../../../../_dnt.shims.js"));
|
|
48
|
+
const async_js_1 = require("../../../helpers/async.js");
|
|
49
|
+
const scrape_js_1 = require("./scrape.js");
|
|
50
|
+
const DEFAULT_BRIGHTDATA_PROVIDER_CONFIG = {
|
|
51
|
+
apiBase: 'https://api.brightdata.com',
|
|
52
|
+
datasetId: 'gd_m7aof0k82r803d5bjm',
|
|
53
|
+
outputFields: [
|
|
54
|
+
'url',
|
|
55
|
+
'prompt',
|
|
56
|
+
'answer_text',
|
|
57
|
+
'answer_text_markdown',
|
|
58
|
+
'citations',
|
|
59
|
+
'links_attached',
|
|
60
|
+
'country',
|
|
61
|
+
'index',
|
|
62
|
+
],
|
|
63
|
+
targetUrl: 'http://chatgpt.com/',
|
|
64
|
+
providerName: 'Brightdata',
|
|
65
|
+
maxConcurrency: 50,
|
|
66
|
+
maxPromptsPerRequest: 1,
|
|
67
|
+
};
|
|
68
|
+
const TRIGGER_RETRY = {
|
|
69
|
+
maxRetries: 3,
|
|
70
|
+
initialDelay: 0,
|
|
71
|
+
statusCodes: [429, 500, 502, 503, 504],
|
|
72
|
+
};
|
|
73
|
+
const DOWNLOAD_RETRY = {
|
|
74
|
+
maxRetries: 5,
|
|
75
|
+
initialDelay: 2000,
|
|
76
|
+
statusCodes: [202, 500, 502, 503, 504],
|
|
77
|
+
};
|
|
78
|
+
const MONITOR_RETRY = {
|
|
79
|
+
maxRetries: 4,
|
|
80
|
+
initialDelay: 1000,
|
|
81
|
+
statusCodes: [408, 425, 429, 500, 502, 503, 504],
|
|
82
|
+
};
|
|
83
|
+
const MONITOR_RETRIABLE = new Set(MONITOR_RETRY.statusCodes ?? []);
|
|
84
|
+
const MAX_WAIT_MS = 600_000; // 10 minutes
|
|
85
|
+
const POLL_INTERVAL_MS = 5_000;
|
|
86
|
+
// ============================================================================
|
|
87
|
+
// API Key
|
|
88
|
+
// ============================================================================
|
|
89
|
+
function getApiKey() {
|
|
90
|
+
const apiKey = dntShim.Deno.env.get('BRIGHTDATA_API_KEY');
|
|
91
|
+
if (!apiKey) {
|
|
92
|
+
throw new Error('BRIGHTDATA_API_KEY environment variable is required');
|
|
93
|
+
}
|
|
94
|
+
return apiKey;
|
|
95
|
+
}
|
|
96
|
+
// ============================================================================
|
|
97
|
+
// Provider Functions
|
|
98
|
+
// ============================================================================
|
|
99
|
+
function createBrightdataProvider(overrides = {}) {
|
|
100
|
+
const config = { ...DEFAULT_BRIGHTDATA_PROVIDER_CONFIG, ...overrides };
|
|
101
|
+
const customOutputFields = [...new Set([...(config.outputFields ?? []), ...(config.extraFields ?? [])])].join('|');
|
|
102
|
+
async function triggerJob(prompt, useSearch, countryISOCode) {
|
|
103
|
+
const apiKey = getApiKey();
|
|
104
|
+
const url = `${config.apiBase}/datasets/v3/trigger?dataset_id=${config.datasetId}&include_errors=true`;
|
|
105
|
+
const input = {
|
|
106
|
+
url: config.targetUrl,
|
|
107
|
+
prompt,
|
|
108
|
+
country: countryISOCode || '',
|
|
109
|
+
index: 0,
|
|
110
|
+
};
|
|
111
|
+
Object.assign(input, config.extraInputs?.({ prompt, useSearch, countryISOCode }) ?? {});
|
|
112
|
+
const body = {
|
|
113
|
+
custom_output_fields: customOutputFields,
|
|
114
|
+
input: [input],
|
|
115
|
+
};
|
|
116
|
+
try {
|
|
117
|
+
const response = await (0, async_js_1.withRetries)(() => fetch(url, {
|
|
118
|
+
method: 'POST',
|
|
119
|
+
headers: {
|
|
120
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
121
|
+
'Content-Type': 'application/json',
|
|
122
|
+
},
|
|
123
|
+
body: JSON.stringify(body),
|
|
124
|
+
signal: (0, scrape_js_1.getAbortSignal)(),
|
|
125
|
+
}), TRIGGER_RETRY);
|
|
126
|
+
if (!response.ok) {
|
|
127
|
+
console.error(`[${config.providerName}] Trigger error: ${response.status}`);
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const data = await response.json();
|
|
131
|
+
return data?.snapshot_id || null;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
console.error(`[${config.providerName}] Trigger failed:`, error);
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function monitorJob(snapshotId) {
|
|
139
|
+
const apiKey = getApiKey();
|
|
140
|
+
const url = `${config.apiBase}/datasets/v3/progress/${snapshotId}`;
|
|
141
|
+
const startTime = Date.now();
|
|
142
|
+
const abortSignal = (0, scrape_js_1.getAbortSignal)();
|
|
143
|
+
while (Date.now() - startTime < MAX_WAIT_MS) {
|
|
144
|
+
if (abortSignal?.aborted)
|
|
145
|
+
return false;
|
|
146
|
+
try {
|
|
147
|
+
const response = await (0, async_js_1.withRetries)(() => fetch(url, {
|
|
148
|
+
headers: { 'Authorization': `Bearer ${apiKey}` },
|
|
149
|
+
signal: abortSignal,
|
|
150
|
+
}), MONITOR_RETRY);
|
|
151
|
+
if (!response.ok) {
|
|
152
|
+
if (!MONITOR_RETRIABLE.has(response.status))
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
const status = await response.json();
|
|
157
|
+
if (status.status === 'ready' || status.status === 'complete')
|
|
158
|
+
return true;
|
|
159
|
+
if (status.status === 'failed' || status.status === 'error')
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
console.error(`[${config.providerName}] Monitor error:`, error);
|
|
165
|
+
}
|
|
166
|
+
await (0, async_js_1.sleep)(POLL_INTERVAL_MS, abortSignal);
|
|
167
|
+
}
|
|
168
|
+
console.error(`[${config.providerName}] Monitor timeout after ${MAX_WAIT_MS / 1000}s`);
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
async function downloadJob(snapshotId) {
|
|
172
|
+
const apiKey = getApiKey();
|
|
173
|
+
const url = `${config.apiBase}/datasets/v3/snapshot/${snapshotId}?format=json`;
|
|
174
|
+
try {
|
|
175
|
+
const response = await (0, async_js_1.withRetries)(() => fetch(url, {
|
|
176
|
+
headers: { 'Authorization': `Bearer ${apiKey}` },
|
|
177
|
+
signal: (0, scrape_js_1.getAbortSignal)(),
|
|
178
|
+
}), DOWNLOAD_RETRY);
|
|
179
|
+
if (!response.ok) {
|
|
180
|
+
console.error(`[${config.providerName}] Download error: ${response.status}`);
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
const data = await response.json();
|
|
184
|
+
return Array.isArray(data) ? data : null;
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
console.error(`[${config.providerName}] Download failed:`, error);
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function transformResponse(raw) {
|
|
192
|
+
const responses = raw;
|
|
193
|
+
if (!responses || responses.length === 0)
|
|
194
|
+
return null;
|
|
195
|
+
const response = responses[0];
|
|
196
|
+
const answerText = (0, scrape_js_1.cleanAnswer)(response.answer_text || '');
|
|
197
|
+
const answerTextMarkdown = (0, scrape_js_1.cleanAnswer)(response.answer_text_markdown || '');
|
|
198
|
+
return {
|
|
199
|
+
prompt: response.prompt,
|
|
200
|
+
answer: answerText,
|
|
201
|
+
answer_text_markdown: answerTextMarkdown,
|
|
202
|
+
sources: (0, scrape_js_1.buildSources)(response.citations ?? [], response.links_attached ?? []),
|
|
203
|
+
searchQueries: response.web_search_query || [],
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
name: config.providerName,
|
|
208
|
+
maxConcurrency: config.maxConcurrency,
|
|
209
|
+
maxPromptsPerRequest: config.maxPromptsPerRequest,
|
|
210
|
+
triggerJob,
|
|
211
|
+
monitorJob,
|
|
212
|
+
downloadJob,
|
|
213
|
+
transformResponse,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
// ============================================================================
|
|
217
|
+
// Export
|
|
218
|
+
// ============================================================================
|
|
219
|
+
exports.brightdataProvider = createBrightdataProvider();
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ModelResult } from '../../../schemas/models.schema.js';
|
|
2
|
+
import { type BatchOptions } from './scrape.js';
|
|
3
|
+
export type { BatchOptions };
|
|
4
|
+
export type JobId = string | null;
|
|
5
|
+
export type ScraperTarget = 'chatgpt' | 'aim';
|
|
6
|
+
export declare function getMaxConcurrency(target?: ScraperTarget): number;
|
|
7
|
+
export declare function getMaxPromptsPerRequest(target?: ScraperTarget): number;
|
|
8
|
+
export declare function scrapeGPTBatch(options: BatchOptions): Promise<Array<ModelResult>>;
|
|
9
|
+
export declare function triggerGPTBatch(options: BatchOptions): Promise<Array<string | null>>;
|
|
10
|
+
export declare function downloadGPTSnapshots(jobIds: Array<string | null>): Promise<Array<ModelResult>>;
|
|
11
|
+
export declare function scrapeAIMBatch(options: BatchOptions): Promise<Array<ModelResult>>;
|
|
12
|
+
export declare function triggerAIMBatch(options: BatchOptions): Promise<Array<string | null>>;
|
|
13
|
+
export declare function downloadAIMSnapshots(jobIds: Array<string | null>): Promise<Array<ModelResult>>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/apis/brightdata/llmScraper/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,KAAK,YAAY,EAAqC,MAAM,aAAa,CAAC;AAKnF,YAAY,EAAE,YAAY,EAAE,CAAC;AAC7B,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;AAClC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,KAAK,CAAC;AAuE9C,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,aAAyB,GAAG,MAAM,CAE3E;AAED,wBAAgB,uBAAuB,CAAC,MAAM,GAAE,aAAyB,GAAG,MAAM,CAEjF;AAGD,wBAAsB,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAEvF;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAE1F;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAEpG;AAGD,wBAAsB,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAEvF;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAE1F;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAEpG"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getMaxConcurrency = getMaxConcurrency;
|
|
37
|
+
exports.getMaxPromptsPerRequest = getMaxPromptsPerRequest;
|
|
38
|
+
exports.scrapeGPTBatch = scrapeGPTBatch;
|
|
39
|
+
exports.triggerGPTBatch = triggerGPTBatch;
|
|
40
|
+
exports.downloadGPTSnapshots = downloadGPTSnapshots;
|
|
41
|
+
exports.scrapeAIMBatch = scrapeAIMBatch;
|
|
42
|
+
exports.triggerAIMBatch = triggerAIMBatch;
|
|
43
|
+
exports.downloadAIMSnapshots = downloadAIMSnapshots;
|
|
44
|
+
/* eslint no-console: ["warn", { allow: ["log", "warn", "error"] }] */
|
|
45
|
+
/**
|
|
46
|
+
* LLM Scraper - Public API
|
|
47
|
+
*
|
|
48
|
+
* Selects between Brightdata and Oxylabs based on LLM_SCRAPER_PROVIDER env var.
|
|
49
|
+
* Falls back to CHATGPT_SCRAPER_PROVIDER for backward compatibility.
|
|
50
|
+
* Exposes ChatGPT and AIM variants while preserving the legacy GPT method names.
|
|
51
|
+
* Default: oxylabs
|
|
52
|
+
*/
|
|
53
|
+
const dntShim = __importStar(require("../../../../_dnt.shims.js"));
|
|
54
|
+
const scrape_js_1 = require("./scrape.js");
|
|
55
|
+
const brightdata_js_1 = require("./brightdata.js");
|
|
56
|
+
const oxy_js_1 = require("./oxy.js");
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// Scraper Instance (lazy singleton)
|
|
59
|
+
// ============================================================================
|
|
60
|
+
const scrapers = new Map();
|
|
61
|
+
const CHATGPT_BRIGHTDATA_OPTIONS = {
|
|
62
|
+
datasetId: 'gd_m7aof0k82r803d5bjm',
|
|
63
|
+
extraFields: ['web_search_triggered', 'web_search_query'],
|
|
64
|
+
extraInputs: ({ useSearch }) => ({
|
|
65
|
+
web_search: useSearch,
|
|
66
|
+
}),
|
|
67
|
+
targetUrl: 'http://chatgpt.com/',
|
|
68
|
+
};
|
|
69
|
+
const CHATGPT_OXYLABS_OPTIONS = {
|
|
70
|
+
source: 'chatgpt',
|
|
71
|
+
};
|
|
72
|
+
const AIM_BRIGHTDATA_OPTIONS = {
|
|
73
|
+
datasetId: 'gd_mcswdt6z2elth3zqr2',
|
|
74
|
+
targetUrl: 'https://google.com/aimode',
|
|
75
|
+
};
|
|
76
|
+
const AIM_OXYLABS_OPTIONS = {
|
|
77
|
+
source: 'google_ai_mode',
|
|
78
|
+
inputKey: 'query',
|
|
79
|
+
render: 'html',
|
|
80
|
+
search: undefined,
|
|
81
|
+
};
|
|
82
|
+
function getProviderName() {
|
|
83
|
+
return dntShim.Deno.env.get('LLM_SCRAPER_PROVIDER')?.toLowerCase() ??
|
|
84
|
+
dntShim.Deno.env.get('CHATGPT_SCRAPER_PROVIDER')?.toLowerCase();
|
|
85
|
+
}
|
|
86
|
+
function getTargetOptions(target) {
|
|
87
|
+
return target === 'aim'
|
|
88
|
+
? {
|
|
89
|
+
brightdata: AIM_BRIGHTDATA_OPTIONS,
|
|
90
|
+
oxylabs: AIM_OXYLABS_OPTIONS,
|
|
91
|
+
}
|
|
92
|
+
: {
|
|
93
|
+
brightdata: CHATGPT_BRIGHTDATA_OPTIONS,
|
|
94
|
+
oxylabs: CHATGPT_OXYLABS_OPTIONS,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function getLLMScraper(target = 'chatgpt') {
|
|
98
|
+
const existingScraper = scrapers.get(target);
|
|
99
|
+
if (existingScraper) {
|
|
100
|
+
return existingScraper;
|
|
101
|
+
}
|
|
102
|
+
const providerName = getProviderName();
|
|
103
|
+
const targetOptions = getTargetOptions(target);
|
|
104
|
+
const provider = providerName === 'brightdata'
|
|
105
|
+
? (0, brightdata_js_1.createBrightdataProvider)(targetOptions.brightdata)
|
|
106
|
+
: (0, oxy_js_1.createOxylabsProvider)(targetOptions.oxylabs);
|
|
107
|
+
const scraper = (0, scrape_js_1.createLLMScraper)(provider);
|
|
108
|
+
scrapers.set(target, scraper);
|
|
109
|
+
return scraper;
|
|
110
|
+
}
|
|
111
|
+
// ============================================================================
|
|
112
|
+
// Public API
|
|
113
|
+
// ============================================================================
|
|
114
|
+
// Shared scraper metadata
|
|
115
|
+
function getMaxConcurrency(target = 'chatgpt') {
|
|
116
|
+
return getLLMScraper(target).maxConcurrency;
|
|
117
|
+
}
|
|
118
|
+
function getMaxPromptsPerRequest(target = 'chatgpt') {
|
|
119
|
+
return getLLMScraper(target).maxPromptsPerRequest;
|
|
120
|
+
}
|
|
121
|
+
// ChatGPT scraper methods
|
|
122
|
+
async function scrapeGPTBatch(options) {
|
|
123
|
+
return getLLMScraper('chatgpt').scrapeLLMBatch(options);
|
|
124
|
+
}
|
|
125
|
+
async function triggerGPTBatch(options) {
|
|
126
|
+
return getLLMScraper('chatgpt').triggerLLMBatch(options);
|
|
127
|
+
}
|
|
128
|
+
async function downloadGPTSnapshots(jobIds) {
|
|
129
|
+
return getLLMScraper('chatgpt').downloadLLMSnapshots(jobIds);
|
|
130
|
+
}
|
|
131
|
+
// AIM scraper methods
|
|
132
|
+
async function scrapeAIMBatch(options) {
|
|
133
|
+
return getLLMScraper('aim').scrapeLLMBatch(options);
|
|
134
|
+
}
|
|
135
|
+
async function triggerAIMBatch(options) {
|
|
136
|
+
return getLLMScraper('aim').triggerLLMBatch(options);
|
|
137
|
+
}
|
|
138
|
+
async function downloadAIMSnapshots(jobIds) {
|
|
139
|
+
return getLLMScraper('aim').downloadLLMSnapshots(jobIds);
|
|
140
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ProviderFunctions } from './scrape.js';
|
|
2
|
+
interface OxylabsProviderConfig {
|
|
3
|
+
apiBase: string;
|
|
4
|
+
source: string;
|
|
5
|
+
inputKey: 'prompt' | 'query';
|
|
6
|
+
parse: boolean;
|
|
7
|
+
search?: boolean;
|
|
8
|
+
render?: 'html';
|
|
9
|
+
providerName: string;
|
|
10
|
+
maxConcurrency: number;
|
|
11
|
+
maxPromptsPerRequest: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function createOxylabsProvider(overrides?: Partial<OxylabsProviderConfig>): ProviderFunctions;
|
|
14
|
+
export declare const oxylabsProvider: ProviderFunctions;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=oxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oxy.d.ts","sourceRoot":"","sources":["../../../../../src/src/apis/brightdata/llmScraper/oxy.ts"],"names":[],"mappings":"AAeA,OAAO,EAA6C,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA2BhG,UAAU,qBAAqB;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;CAC7B;AAyCD,wBAAgB,qBAAqB,CAAC,SAAS,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAAG,iBAAiB,CAyJvG;AAMD,eAAO,MAAM,eAAe,EAAE,iBAA2C,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.oxylabsProvider = void 0;
|
|
37
|
+
exports.createOxylabsProvider = createOxylabsProvider;
|
|
38
|
+
/* eslint no-console: ["warn", { allow: ["log", "warn", "error"] }] */
|
|
39
|
+
/**
|
|
40
|
+
* Oxylabs LLM Scraper Provider.
|
|
41
|
+
*
|
|
42
|
+
* API Flow (Async Push-Pull):
|
|
43
|
+
* 1. Trigger: POST to /v1/queries → returns job id
|
|
44
|
+
* 2. Monitor: GET /v1/queries/{id} until status is 'done'
|
|
45
|
+
* 3. Download: GET /v1/queries/{id}/results
|
|
46
|
+
*/
|
|
47
|
+
const dntShim = __importStar(require("../../../../_dnt.shims.js"));
|
|
48
|
+
const async_js_1 = require("../../../helpers/async.js");
|
|
49
|
+
const scrape_js_1 = require("./scrape.js");
|
|
50
|
+
const DEFAULT_OXYLABS_PROVIDER_CONFIG = {
|
|
51
|
+
apiBase: 'https://data.oxylabs.io/v1',
|
|
52
|
+
source: 'chatgpt',
|
|
53
|
+
inputKey: 'prompt',
|
|
54
|
+
parse: true,
|
|
55
|
+
search: true,
|
|
56
|
+
providerName: 'Oxylabs',
|
|
57
|
+
maxConcurrency: 10,
|
|
58
|
+
maxPromptsPerRequest: 1,
|
|
59
|
+
};
|
|
60
|
+
const RETRY_CONFIG = {
|
|
61
|
+
maxRetries: 3,
|
|
62
|
+
initialDelay: 1000,
|
|
63
|
+
statusCodes: [429, 500, 502, 503, 504, 524, 612, 613],
|
|
64
|
+
};
|
|
65
|
+
const MAX_WAIT_MS = 600_000; // 10 minutes
|
|
66
|
+
const POLL_INTERVAL_MS = 5_000;
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// Auth
|
|
69
|
+
// ============================================================================
|
|
70
|
+
function getAuthHeader() {
|
|
71
|
+
const username = dntShim.Deno.env.get('OXYLABS_USERNAME');
|
|
72
|
+
const password = dntShim.Deno.env.get('OXYLABS_PASSWORD');
|
|
73
|
+
if (!username || !password) {
|
|
74
|
+
throw new Error('OXYLABS_USERNAME and OXYLABS_PASSWORD environment variables are required');
|
|
75
|
+
}
|
|
76
|
+
return `Basic ${btoa(`${username}:${password}`)}`;
|
|
77
|
+
}
|
|
78
|
+
// ============================================================================
|
|
79
|
+
// Provider Functions
|
|
80
|
+
// ============================================================================
|
|
81
|
+
function createOxylabsProvider(overrides = {}) {
|
|
82
|
+
const config = { ...DEFAULT_OXYLABS_PROVIDER_CONFIG, ...overrides };
|
|
83
|
+
async function triggerJob(prompt, _useSearch, countryISOCode) {
|
|
84
|
+
const authHeader = getAuthHeader();
|
|
85
|
+
const url = `${config.apiBase}/queries`;
|
|
86
|
+
const body = {
|
|
87
|
+
source: config.source,
|
|
88
|
+
parse: config.parse,
|
|
89
|
+
[config.inputKey]: prompt,
|
|
90
|
+
};
|
|
91
|
+
if (config.search != null) {
|
|
92
|
+
body.search = config.search;
|
|
93
|
+
}
|
|
94
|
+
if (config.render != null) {
|
|
95
|
+
body.render = config.render;
|
|
96
|
+
}
|
|
97
|
+
if (countryISOCode) {
|
|
98
|
+
body.geo_location = countryISOCode;
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
const response = await (0, async_js_1.withRetries)(() => fetch(url, {
|
|
102
|
+
method: 'POST',
|
|
103
|
+
headers: {
|
|
104
|
+
'Authorization': authHeader,
|
|
105
|
+
'Content-Type': 'application/json',
|
|
106
|
+
},
|
|
107
|
+
body: JSON.stringify(body),
|
|
108
|
+
signal: (0, scrape_js_1.getAbortSignal)(),
|
|
109
|
+
}), RETRY_CONFIG);
|
|
110
|
+
if (!response.ok) {
|
|
111
|
+
console.error(`[${config.providerName}] Trigger error: ${response.status}`);
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
const data = await response.json();
|
|
115
|
+
return data?.id || null;
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
console.error(`[${config.providerName}] Trigger failed:`, error);
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function monitorJob(jobId) {
|
|
123
|
+
const authHeader = getAuthHeader();
|
|
124
|
+
const url = `${config.apiBase}/queries/${jobId}`;
|
|
125
|
+
const startTime = Date.now();
|
|
126
|
+
const abortSignal = (0, scrape_js_1.getAbortSignal)();
|
|
127
|
+
while (Date.now() - startTime < MAX_WAIT_MS) {
|
|
128
|
+
if (abortSignal?.aborted)
|
|
129
|
+
return false;
|
|
130
|
+
try {
|
|
131
|
+
const response = await fetch(url, {
|
|
132
|
+
headers: { 'Authorization': authHeader },
|
|
133
|
+
signal: abortSignal,
|
|
134
|
+
});
|
|
135
|
+
// 204 = job not completed yet, continue polling
|
|
136
|
+
if (response.status === 204) {
|
|
137
|
+
await (0, async_js_1.sleep)(POLL_INTERVAL_MS, abortSignal);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (response.ok) {
|
|
141
|
+
const status = await response.json();
|
|
142
|
+
if (status.status === 'done')
|
|
143
|
+
return true;
|
|
144
|
+
if (status.status === 'faulted' || status.status === 'failed')
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
console.error(`[${config.providerName}] Monitor error:`, error);
|
|
150
|
+
}
|
|
151
|
+
await (0, async_js_1.sleep)(POLL_INTERVAL_MS, abortSignal);
|
|
152
|
+
}
|
|
153
|
+
console.error(`[${config.providerName}] Monitor timeout after ${MAX_WAIT_MS / 1000}s`);
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
async function downloadJob(jobId) {
|
|
157
|
+
const authHeader = getAuthHeader();
|
|
158
|
+
const url = `${config.apiBase}/queries/${jobId}/results`;
|
|
159
|
+
try {
|
|
160
|
+
const response = await (0, async_js_1.withRetries)(() => fetch(url, {
|
|
161
|
+
headers: { 'Authorization': authHeader },
|
|
162
|
+
signal: (0, scrape_js_1.getAbortSignal)(),
|
|
163
|
+
}), RETRY_CONFIG);
|
|
164
|
+
if (!response.ok) {
|
|
165
|
+
console.error(`[${config.providerName}] Download error: ${response.status}`);
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
return await response.json();
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
console.error(`[${config.providerName}] Download failed:`, error);
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function transformResponse(raw) {
|
|
176
|
+
const response = raw;
|
|
177
|
+
const content = response?.results?.[0]?.content;
|
|
178
|
+
if (!content)
|
|
179
|
+
return null;
|
|
180
|
+
const answerText = (0, scrape_js_1.cleanAnswer)(content.response_text || '');
|
|
181
|
+
const answerTextMarkdown = (0, scrape_js_1.cleanAnswer)(content.markdown_text || '');
|
|
182
|
+
// Map section='citations' to cited=true (like Brightdata's cited field)
|
|
183
|
+
const citations = (content.citations ?? []).map((c) => ({
|
|
184
|
+
...c,
|
|
185
|
+
cited: c.section === 'citations',
|
|
186
|
+
}));
|
|
187
|
+
return {
|
|
188
|
+
prompt: content.prompt || '',
|
|
189
|
+
answer: answerText,
|
|
190
|
+
answer_text_markdown: answerTextMarkdown,
|
|
191
|
+
sources: (0, scrape_js_1.buildSources)(citations),
|
|
192
|
+
searchQueries: [],
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
name: config.providerName,
|
|
197
|
+
maxConcurrency: config.maxConcurrency,
|
|
198
|
+
maxPromptsPerRequest: config.maxPromptsPerRequest,
|
|
199
|
+
triggerJob,
|
|
200
|
+
monitorJob,
|
|
201
|
+
downloadJob,
|
|
202
|
+
transformResponse,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
// ============================================================================
|
|
206
|
+
// Export
|
|
207
|
+
// ============================================================================
|
|
208
|
+
exports.oxylabsProvider = createOxylabsProvider();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ModelResult } from '
|
|
2
|
-
import type { Source
|
|
1
|
+
import type { ModelResult } from '../../../schemas/models.schema.js';
|
|
2
|
+
import type { Source } from '../../../schemas/sources.schema.js';
|
|
3
3
|
export interface BatchOptions {
|
|
4
4
|
prompts: Array<string>;
|
|
5
5
|
useSearch?: boolean;
|
|
@@ -14,12 +14,12 @@ export interface ProviderFunctions {
|
|
|
14
14
|
downloadJob: (jobId: string) => Promise<unknown>;
|
|
15
15
|
transformResponse: (raw: unknown) => ModelResult | null;
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface LLMScraper {
|
|
18
18
|
maxConcurrency: number;
|
|
19
19
|
maxPromptsPerRequest: number;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
scrapeLLMBatch: (options: BatchOptions) => Promise<Array<ModelResult>>;
|
|
21
|
+
triggerLLMBatch: (options: BatchOptions) => Promise<Array<string | null>>;
|
|
22
|
+
downloadLLMSnapshots: (jobIds: Array<string | null>) => Promise<Array<ModelResult>>;
|
|
23
23
|
}
|
|
24
24
|
export declare function getAbortSignal(): AbortSignal | undefined;
|
|
25
25
|
export declare function cleanAnswer(answer: string): string;
|
|
@@ -29,18 +29,15 @@ export declare function buildSources(citations: Array<{
|
|
|
29
29
|
description?: string;
|
|
30
30
|
text?: string;
|
|
31
31
|
cited?: boolean;
|
|
32
|
-
}>,
|
|
33
|
-
export declare function buildSearchSources(sources: Array<{
|
|
32
|
+
}>, linksAttached?: Array<{
|
|
34
33
|
url?: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
date_published?: string;
|
|
39
|
-
}>): Array<SearchSource>;
|
|
34
|
+
text?: string;
|
|
35
|
+
position?: number;
|
|
36
|
+
}>): Array<Source>;
|
|
40
37
|
/**
|
|
41
38
|
* Creates an empty model result for failed jobs.
|
|
42
39
|
* This ensures we always return the same number of rows as input.
|
|
43
40
|
*/
|
|
44
41
|
export declare function emptyModelResult(providerName: string, errorMessage?: string, context?: unknown): ModelResult;
|
|
45
|
-
export declare function
|
|
46
|
-
//# sourceMappingURL=
|
|
42
|
+
export declare function createLLMScraper(provider: ProviderFunctions): LLMScraper;
|
|
43
|
+
//# sourceMappingURL=scrape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrape.d.ts","sourceRoot":"","sources":["../../../../../src/src/apis/brightdata/llmScraper/scrape.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAOjE,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1G,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACjD,iBAAiB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,WAAW,GAAG,IAAI,CAAC;CACxD;AAED,MAAM,WAAW,UAAU;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IACvE,eAAe,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAC1E,oBAAoB,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;CACpF;AAMD,wBAAgB,cAAc,IAAI,WAAW,GAAG,SAAS,CAExD;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAMlD;AA+BD,wBAAgB,YAAY,CAC3B,SAAS,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,EACvG,aAAa,GAAE,KAAK,CAAC;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAM,GAC3E,KAAK,CAAC,MAAM,CAAC,CAoFf;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,CAU5G;AAMD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,UAAU,CAkExE"}
|