mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-12 11:49:07 +08:00
fix(extract/oldExtract): do if for old/new extract
This commit is contained in:
parent
1afc6258bd
commit
f47d8779f5
@ -10,6 +10,7 @@ import * as Sentry from "@sentry/node";
|
|||||||
import { saveExtract } from "../../lib/extract/extract-redis";
|
import { saveExtract } from "../../lib/extract/extract-redis";
|
||||||
import { getTeamIdSyncB } from "../../lib/extract/team-id-sync";
|
import { getTeamIdSyncB } from "../../lib/extract/team-id-sync";
|
||||||
import { performExtraction } from "../../lib/extract/extraction-service";
|
import { performExtraction } from "../../lib/extract/extraction-service";
|
||||||
|
import { performExtraction_F0 } from "../../lib/extract/fire-0/extraction-service-f0";
|
||||||
|
|
||||||
export async function oldExtract(
|
export async function oldExtract(
|
||||||
req: RequestWithAuth<{}, ExtractResponse, ExtractRequest>,
|
req: RequestWithAuth<{}, ExtractResponse, ExtractRequest>,
|
||||||
@ -19,11 +20,21 @@ export async function oldExtract(
|
|||||||
// Means that are in the non-queue system
|
// Means that are in the non-queue system
|
||||||
// TODO: Remove this once all teams have transitioned to the new system
|
// TODO: Remove this once all teams have transitioned to the new system
|
||||||
try {
|
try {
|
||||||
const result = await performExtraction(extractId, {
|
let result;
|
||||||
|
const model = req.body.agent?.model
|
||||||
|
if (req.body.agent && model && model.toLowerCase().includes("fire-1")) {
|
||||||
|
result = await performExtraction(extractId, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
teamId: req.auth.team_id,
|
teamId: req.auth.team_id,
|
||||||
subId: req.acuc?.sub_id ?? undefined,
|
subId: req.acuc?.sub_id ?? undefined,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
result = await performExtraction_F0(extractId, {
|
||||||
|
request: req.body,
|
||||||
|
teamId: req.auth.team_id,
|
||||||
|
subId: req.acuc?.sub_id ?? undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return res.status(200).json(result);
|
return res.status(200).json(result);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user