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

@ -9,13 +9,12 @@ import { scrapeQueueEvents } from '../../services/queue-service';
import { logJob } from "../../services/logging/log_job";
export async function scrapeController(req: RequestWithAuth<{}, ScrapeResponse, ScrapeRequest>, res: Response<ScrapeResponse>) {
req.body = scrapeRequestSchema.parse(req.body);
req.body = scrapeRequestSchema.parse(req.body);
let earlyReturn = false;
const origin = req.body.origin;
const timeout = req.body.timeout;
const pageOptions = legacyScrapeOptions(req.body);
const jobId = uuidv4();
const startTime = new Date().getTime();

View File

@ -293,7 +293,10 @@ export class WebScraperDataProvider {
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);
if (
(this.extractorOptions.mode === "llm-extraction" ||

View File

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