Merge pull request #872 from mendableai/nsc/exec-js
Some checks failed
Deploy Images to GHCR / push-app-image (push) Has been cancelled

Exec js - actions
This commit is contained in:
Nicolas 2024-11-08 22:02:01 -05:00 committed by GitHub
commit 84ad45c01f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 0 deletions

View File

@ -93,6 +93,10 @@ export const actionsSchema = z.array(z.union([
z.object({
type: z.literal("scrape"),
}),
z.object({
type: z.literal("executeJavascript"),
script: z.string()
}),
]));
export const scrapeOptions = z.object({

View File

@ -33,6 +33,9 @@ export type Action = {
direction: "up" | "down"
} | {
type: "scrape",
} | {
type: "executeJavascript",
script: string,
}
export type PageOptions = {

View File

@ -109,6 +109,9 @@ export type Action = {
direction: "up" | "down",
} | {
type: "scrape",
} | {
type: "executeJavascript",
script: string,
};
export interface ScrapeParams<LLMSchema extends zt.ZodSchema = any, ActionsSchema extends (Action[] | undefined) = undefined> extends CrawlScrapeOptions {