@graphext/cuery 0.10.1 → 0.10.2
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/src/apis/brightdata/llmScraper/index.d.ts +2 -1
- package/esm/src/apis/brightdata/llmScraper/index.d.ts.map +1 -1
- package/esm/src/apis/brightdata/llmScraper/index.js +19 -6
- package/package.json +1 -1
- package/script/src/apis/brightdata/llmScraper/index.d.ts +2 -1
- package/script/src/apis/brightdata/llmScraper/index.d.ts.map +1 -1
- package/script/src/apis/brightdata/llmScraper/index.js +20 -6
|
@@ -2,7 +2,7 @@ import type { ModelResult } from '../../../schemas/models.schema.js';
|
|
|
2
2
|
import { type BatchOptions } from './scrape.js';
|
|
3
3
|
export type { BatchOptions };
|
|
4
4
|
export type JobId = string | null;
|
|
5
|
-
export type ScraperTarget = 'chatgpt' | 'aim';
|
|
5
|
+
export type ScraperTarget = 'chatgpt' | 'aim' | 'generic';
|
|
6
6
|
export declare function getMaxConcurrency(target?: ScraperTarget): number;
|
|
7
7
|
export declare function getMaxPromptsPerRequest(target?: ScraperTarget): number;
|
|
8
8
|
export declare function scrapeGPTBatch(options: BatchOptions): Promise<Array<ModelResult>>;
|
|
@@ -11,4 +11,5 @@ export declare function downloadGPTSnapshots(jobIds: Array<string | null>): Prom
|
|
|
11
11
|
export declare function scrapeAIMBatch(options: BatchOptions): Promise<Array<ModelResult>>;
|
|
12
12
|
export declare function triggerAIMBatch(options: BatchOptions): Promise<Array<string | null>>;
|
|
13
13
|
export declare function downloadAIMSnapshots(jobIds: Array<string | null>): Promise<Array<ModelResult>>;
|
|
14
|
+
export declare function downloadSnapshots(jobIds: Array<string | null>): Promise<Array<ModelResult>>;
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/apis/brightdata/llmScraper/index.ts"],"names":[],"mappings":"AAYA,OAAO,K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Y,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,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAEjG"}
|
|
@@ -57,10 +57,19 @@ function getLLMScraper(target = 'chatgpt') {
|
|
|
57
57
|
return existingScraper;
|
|
58
58
|
}
|
|
59
59
|
const providerName = getProviderName();
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
let provider;
|
|
61
|
+
if (target === 'generic') {
|
|
62
|
+
// Generic instance: only used for download/monitor, no target-specific config needed
|
|
63
|
+
provider = providerName === 'brightdata'
|
|
64
|
+
? createBrightdataProvider()
|
|
65
|
+
: createOxylabsProvider();
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const targetOptions = getTargetOptions(target);
|
|
69
|
+
provider = providerName === 'brightdata'
|
|
70
|
+
? createBrightdataProvider(targetOptions.brightdata)
|
|
71
|
+
: createOxylabsProvider(targetOptions.oxylabs);
|
|
72
|
+
}
|
|
64
73
|
const scraper = createLLMScraper(provider);
|
|
65
74
|
scrapers.set(target, scraper);
|
|
66
75
|
return scraper;
|
|
@@ -83,7 +92,7 @@ export async function triggerGPTBatch(options) {
|
|
|
83
92
|
return getLLMScraper('chatgpt').triggerLLMBatch(options);
|
|
84
93
|
}
|
|
85
94
|
export async function downloadGPTSnapshots(jobIds) {
|
|
86
|
-
return
|
|
95
|
+
return downloadSnapshots(jobIds);
|
|
87
96
|
}
|
|
88
97
|
// AIM scraper methods
|
|
89
98
|
export async function scrapeAIMBatch(options) {
|
|
@@ -93,5 +102,9 @@ export async function triggerAIMBatch(options) {
|
|
|
93
102
|
return getLLMScraper('aim').triggerLLMBatch(options);
|
|
94
103
|
}
|
|
95
104
|
export async function downloadAIMSnapshots(jobIds) {
|
|
96
|
-
return
|
|
105
|
+
return downloadSnapshots(jobIds);
|
|
106
|
+
}
|
|
107
|
+
// Generic download — target-agnostic, works with any job IDs
|
|
108
|
+
export async function downloadSnapshots(jobIds) {
|
|
109
|
+
return getLLMScraper('generic').downloadLLMSnapshots(jobIds);
|
|
97
110
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import type { ModelResult } from '../../../schemas/models.schema.js';
|
|
|
2
2
|
import { type BatchOptions } from './scrape.js';
|
|
3
3
|
export type { BatchOptions };
|
|
4
4
|
export type JobId = string | null;
|
|
5
|
-
export type ScraperTarget = 'chatgpt' | 'aim';
|
|
5
|
+
export type ScraperTarget = 'chatgpt' | 'aim' | 'generic';
|
|
6
6
|
export declare function getMaxConcurrency(target?: ScraperTarget): number;
|
|
7
7
|
export declare function getMaxPromptsPerRequest(target?: ScraperTarget): number;
|
|
8
8
|
export declare function scrapeGPTBatch(options: BatchOptions): Promise<Array<ModelResult>>;
|
|
@@ -11,4 +11,5 @@ export declare function downloadGPTSnapshots(jobIds: Array<string | null>): Prom
|
|
|
11
11
|
export declare function scrapeAIMBatch(options: BatchOptions): Promise<Array<ModelResult>>;
|
|
12
12
|
export declare function triggerAIMBatch(options: BatchOptions): Promise<Array<string | null>>;
|
|
13
13
|
export declare function downloadAIMSnapshots(jobIds: Array<string | null>): Promise<Array<ModelResult>>;
|
|
14
|
+
export declare function downloadSnapshots(jobIds: Array<string | null>): Promise<Array<ModelResult>>;
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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;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,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,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAEjG"}
|
|
@@ -41,6 +41,7 @@ exports.downloadGPTSnapshots = downloadGPTSnapshots;
|
|
|
41
41
|
exports.scrapeAIMBatch = scrapeAIMBatch;
|
|
42
42
|
exports.triggerAIMBatch = triggerAIMBatch;
|
|
43
43
|
exports.downloadAIMSnapshots = downloadAIMSnapshots;
|
|
44
|
+
exports.downloadSnapshots = downloadSnapshots;
|
|
44
45
|
/* eslint no-console: ["warn", { allow: ["log", "warn", "error"] }] */
|
|
45
46
|
/**
|
|
46
47
|
* LLM Scraper - Public API
|
|
@@ -100,10 +101,19 @@ function getLLMScraper(target = 'chatgpt') {
|
|
|
100
101
|
return existingScraper;
|
|
101
102
|
}
|
|
102
103
|
const providerName = getProviderName();
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
let provider;
|
|
105
|
+
if (target === 'generic') {
|
|
106
|
+
// Generic instance: only used for download/monitor, no target-specific config needed
|
|
107
|
+
provider = providerName === 'brightdata'
|
|
108
|
+
? (0, brightdata_js_1.createBrightdataProvider)()
|
|
109
|
+
: (0, oxy_js_1.createOxylabsProvider)();
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
const targetOptions = getTargetOptions(target);
|
|
113
|
+
provider = providerName === 'brightdata'
|
|
114
|
+
? (0, brightdata_js_1.createBrightdataProvider)(targetOptions.brightdata)
|
|
115
|
+
: (0, oxy_js_1.createOxylabsProvider)(targetOptions.oxylabs);
|
|
116
|
+
}
|
|
107
117
|
const scraper = (0, scrape_js_1.createLLMScraper)(provider);
|
|
108
118
|
scrapers.set(target, scraper);
|
|
109
119
|
return scraper;
|
|
@@ -126,7 +136,7 @@ async function triggerGPTBatch(options) {
|
|
|
126
136
|
return getLLMScraper('chatgpt').triggerLLMBatch(options);
|
|
127
137
|
}
|
|
128
138
|
async function downloadGPTSnapshots(jobIds) {
|
|
129
|
-
return
|
|
139
|
+
return downloadSnapshots(jobIds);
|
|
130
140
|
}
|
|
131
141
|
// AIM scraper methods
|
|
132
142
|
async function scrapeAIMBatch(options) {
|
|
@@ -136,5 +146,9 @@ async function triggerAIMBatch(options) {
|
|
|
136
146
|
return getLLMScraper('aim').triggerLLMBatch(options);
|
|
137
147
|
}
|
|
138
148
|
async function downloadAIMSnapshots(jobIds) {
|
|
139
|
-
return
|
|
149
|
+
return downloadSnapshots(jobIds);
|
|
150
|
+
}
|
|
151
|
+
// Generic download — target-agnostic, works with any job IDs
|
|
152
|
+
async function downloadSnapshots(jobIds) {
|
|
153
|
+
return getLLMScraper('generic').downloadLLMSnapshots(jobIds);
|
|
140
154
|
}
|