mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 07:01:07 +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[]> {
|
||||
const response = await this.sendAPIRequest<OxylabsResponse>({
|
||||
url: this.params.query,
|
||||
let isUrlSource = this.params.source == 'universal'
|
||||
|
||||
const params = {
|
||||
source: this.params.source,
|
||||
geo_location: this.params.geo_location,
|
||||
render: this.params.render,
|
||||
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) => ({
|
||||
id: `${response.data.job.id.toString()}-${index}`,
|
||||
|
||||
Reference in New Issue
Block a user