Skip to content

Commit 2ab20f7

Browse files
Fix Oxylabs documentloader API calls (#5162)
1 parent b026671 commit 2ab20f7

File tree

1 file changed

+10
-4
lines changed
  • packages/components/nodes/documentloaders/Oxylabs

1 file changed

+10
-4
lines changed

packages/components/nodes/documentloaders/Oxylabs/Oxylabs.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ export class OxylabsLoader extends BaseDocumentLoader {
9595
}
9696

9797
public async load(): Promise<DocumentInterface[]> {
98-
const response = await this.sendAPIRequest<OxylabsResponse>({
99-
url: this.params.query,
98+
let isUrlSource = this.params.source == 'universal'
99+
100+
const params = {
100101
source: this.params.source,
101102
geo_location: this.params.geo_location,
102103
render: this.params.render,
103104
parse: this.params.parse,
104-
user_agent_type: this.params.user_agent_type
105-
})
105+
user_agent_type: this.params.user_agent_type,
106+
markdown: !this.params.parse,
107+
url: isUrlSource ? this.params.query : null,
108+
query: !isUrlSource ? this.params.query : null
109+
}
110+
111+
const response = await this.sendAPIRequest<OxylabsResponse>(params)
106112

107113
const docs: OxylabsDocument[] = response.data.results.map((result, index) => ({
108114
id: `${response.data.job.id.toString()}-${index}`,

0 commit comments

Comments
 (0)