mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-15 00:15:52 +08:00
added agent options types
This commit is contained in:
parent
c67425ad8b
commit
22cfdd6ae3
@ -76,6 +76,15 @@ class FirecrawlDocumentMetadata(pydantic.BaseModel):
|
|||||||
statusCode: Optional[int] = None
|
statusCode: Optional[int] = None
|
||||||
error: Optional[str] = None
|
error: Optional[str] = None
|
||||||
|
|
||||||
|
class AgentOptions(pydantic.BaseModel):
|
||||||
|
"""Configuration for the agent."""
|
||||||
|
model: Literal["FIRE-1"] = "FIRE-1"
|
||||||
|
prompt: Optional[str] = None
|
||||||
|
|
||||||
|
class AgentOptionsExtract(pydantic.BaseModel):
|
||||||
|
"""Configuration for the agent in extract operations."""
|
||||||
|
model: Literal["FIRE-1"] = "FIRE-1"
|
||||||
|
|
||||||
class ActionsResult(pydantic.BaseModel):
|
class ActionsResult(pydantic.BaseModel):
|
||||||
"""Result of actions performed during scraping."""
|
"""Result of actions performed during scraping."""
|
||||||
screenshots: List[str]
|
screenshots: List[str]
|
||||||
@ -164,17 +173,24 @@ class ExecuteJavascriptAction(pydantic.BaseModel):
|
|||||||
type: Literal["executeJavascript"]
|
type: Literal["executeJavascript"]
|
||||||
script: str
|
script: str
|
||||||
|
|
||||||
|
|
||||||
|
class ExtractAgent(pydantic.BaseModel):
|
||||||
|
"""Configuration for the agent in extract operations."""
|
||||||
|
model: Literal["FIRE-1"] = "FIRE-1"
|
||||||
|
|
||||||
class ExtractConfig(pydantic.BaseModel):
|
class ExtractConfig(pydantic.BaseModel):
|
||||||
"""Configuration for extraction."""
|
"""Configuration for extraction."""
|
||||||
prompt: Optional[str] = None
|
prompt: Optional[str] = None
|
||||||
schema: Optional[Any] = None
|
schema: Optional[Any] = None
|
||||||
systemPrompt: Optional[str] = None
|
systemPrompt: Optional[str] = None
|
||||||
|
agent: Optional[ExtractAgent] = None
|
||||||
|
|
||||||
class ScrapeParams(CrawlScrapeOptions):
|
class ScrapeParams(CrawlScrapeOptions):
|
||||||
"""Parameters for scraping operations."""
|
"""Parameters for scraping operations."""
|
||||||
extract: Optional[ExtractConfig] = None
|
extract: Optional[ExtractConfig] = None
|
||||||
jsonOptions: Optional[ExtractConfig] = None
|
jsonOptions: Optional[ExtractConfig] = None
|
||||||
actions: Optional[List[Union[WaitAction, ScreenshotAction, ClickAction, WriteAction, PressAction, ScrollAction, ScrapeAction, ExecuteJavascriptAction]]] = None
|
actions: Optional[List[Union[WaitAction, ScreenshotAction, ClickAction, WriteAction, PressAction, ScrollAction, ScrapeAction, ExecuteJavascriptAction]]] = None
|
||||||
|
agent: Optional[AgentOptions] = None
|
||||||
|
|
||||||
class ScrapeResponse(FirecrawlDocument[T], Generic[T]):
|
class ScrapeResponse(FirecrawlDocument[T], Generic[T]):
|
||||||
"""Response from scraping operations."""
|
"""Response from scraping operations."""
|
||||||
@ -363,7 +379,7 @@ class ChangeTrackingData(pydantic.BaseModel):
|
|||||||
visibility: str # "visible" | "hidden"
|
visibility: str # "visible" | "hidden"
|
||||||
diff: Optional[Dict[str, Any]] = None
|
diff: Optional[Dict[str, Any]] = None
|
||||||
json: Optional[Any] = None
|
json: Optional[Any] = None
|
||||||
|
|
||||||
class FirecrawlApp:
|
class FirecrawlApp:
|
||||||
class SearchResponse(pydantic.BaseModel):
|
class SearchResponse(pydantic.BaseModel):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user