fixed markdown format

This commit is contained in:
rafaelsideguide 2024-08-16 18:39:13 -03:00
parent aabfaf0ac5
commit 086ba6280b
3 changed files with 8 additions and 6 deletions

View File

@ -15,7 +15,6 @@ export async function scrapeController(req: RequestWithAuth<{}, ScrapeResponse,
const origin = req.body.origin; const origin = req.body.origin;
const timeout = req.body.timeout; const timeout = req.body.timeout;
const pageOptions = legacyScrapeOptions(req.body); const pageOptions = legacyScrapeOptions(req.body);
const jobId = uuidv4(); const jobId = uuidv4();
const startTime = new Date().getTime(); const startTime = new Date().getTime();

View File

@ -293,7 +293,10 @@ export class WebScraperDataProvider {
documents = await this.getSitemapData(this.urls[0], documents); documents = await this.getSitemapData(this.urls[0], documents);
} }
documents = this.applyPathReplacements(documents); if (this.pageOptions.includeMarkdown) {
documents = this.applyPathReplacements(documents);
}
// documents = await this.applyImgAltText(documents); // documents = await this.applyImgAltText(documents);
if ( if (
(this.extractorOptions.mode === "llm-extraction" || (this.extractorOptions.mode === "llm-extraction" ||

View File

@ -14,12 +14,12 @@ export async function fireEngineSearch(q: string, options: {
page?: number; page?: number;
}): Promise<SearchResult[]> { }): Promise<SearchResult[]> {
let data = JSON.stringify({ let data = JSON.stringify({
q: q, query: q,
lang: options.lang, lang: options.lang,
country: options.country, country: options.country,
location: options.location, location: options.location,
tbs: options.tbs, tbs: options.tbs,
num: options.numResults, numResults: options.numResults,
page: options.page ?? 1, page: options.page ?? 1,
}); });
@ -36,7 +36,7 @@ export async function fireEngineSearch(q: string, options: {
data: data, data: data,
}; };
const response = await axios(config); const response = await axios(config);
if (response && response.data) { if (response && response) {
return response.data return response.data
} else { } else {
return []; return [];