mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Fix Oxylabs documentloader API calls (#5162)
This commit is contained in:
committed by
GitHub
parent
b026671887
commit
2ab20f71d9
@@ -95,14 +95,20 @@ export class OxylabsLoader extends BaseDocumentLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async load(): Promise<DocumentInterface[]> {
|
public async load(): Promise<DocumentInterface[]> {
|
||||||
const response = await this.sendAPIRequest<OxylabsResponse>({
|
let isUrlSource = this.params.source == 'universal'
|
||||||
url: this.params.query,
|
|
||||||
|
const params = {
|
||||||
source: this.params.source,
|
source: this.params.source,
|
||||||
geo_location: this.params.geo_location,
|
geo_location: this.params.geo_location,
|
||||||
render: this.params.render,
|
render: this.params.render,
|
||||||
parse: this.params.parse,
|
parse: this.params.parse,
|
||||||
user_agent_type: this.params.user_agent_type
|
user_agent_type: this.params.user_agent_type,
|
||||||
})
|
markdown: !this.params.parse,
|
||||||
|
url: isUrlSource ? this.params.query : null,
|
||||||
|
query: !isUrlSource ? this.params.query : null
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await this.sendAPIRequest<OxylabsResponse>(params)
|
||||||
|
|
||||||
const docs: OxylabsDocument[] = response.data.results.map((result, index) => ({
|
const docs: OxylabsDocument[] = response.data.results.map((result, index) => ({
|
||||||
id: `${response.data.job.id.toString()}-${index}`,
|
id: `${response.data.job.id.toString()}-${index}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user