mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-13 18:08:58 +08:00
fix typing
This commit is contained in:
parent
edb40d75c1
commit
9400b1423a
@ -379,11 +379,14 @@ export const scrapeOptions = baseScrapeOptions
|
|||||||
.object({
|
.object({
|
||||||
model: z.string().default(agentExtractModelValue),
|
model: z.string().default(agentExtractModelValue),
|
||||||
prompt: z.string().optional(),
|
prompt: z.string().optional(),
|
||||||
|
sessionId: z.string().optional(),
|
||||||
|
waitBeforeClosingMs: z.number().optional(),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
extract: extractOptionsWithAgent.optional(),
|
extract: extractOptionsWithAgent.optional(),
|
||||||
jsonOptions: extractOptionsWithAgent.optional(),
|
jsonOptions: extractOptionsWithAgent.optional(),
|
||||||
})
|
})
|
||||||
|
.strict(strictMessage)
|
||||||
.refine(
|
.refine(
|
||||||
(obj) => {
|
(obj) => {
|
||||||
if (!obj.actions) return true;
|
if (!obj.actions) return true;
|
||||||
@ -400,7 +403,16 @@ export const scrapeOptions = baseScrapeOptions
|
|||||||
.refine(fire1Refine, fire1RefineOpts)
|
.refine(fire1Refine, fire1RefineOpts)
|
||||||
.transform(extractTransform);
|
.transform(extractTransform);
|
||||||
|
|
||||||
export type ScrapeOptions = z.infer<typeof scrapeOptions>;
|
export type ScrapeOptions = z.infer<typeof baseScrapeOptions> & {
|
||||||
|
extract: z.infer<typeof extractOptionsWithAgent>,
|
||||||
|
jsonOptions: z.infer<typeof extractOptionsWithAgent>,
|
||||||
|
agent: {
|
||||||
|
model: string,
|
||||||
|
prompt: string,
|
||||||
|
sessionId?: string,
|
||||||
|
waitBeforeClosingMs?: number,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
import Ajv from "ajv";
|
import Ajv from "ajv";
|
||||||
import type { CostTracking } from "../../lib/extract/extraction-service";
|
import type { CostTracking } from "../../lib/extract/extraction-service";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user