More explicit model config

This commit is contained in:
Carlos Souza
2024-11-29 05:57:09 -05:00
parent 49ad43ff08
commit e677a271e5

View File

@@ -24,7 +24,11 @@ class FirecrawlScrapeWebsiteToolSchema(BaseModel):
class FirecrawlScrapeWebsiteTool(BaseTool):
model_config = ConfigDict(arbitrary_types_allowed=True)
model_config = ConfigDict(
arbitrary_types_allowed=True,
validate_assignment=True,
frozen=False
)
name: str = "Firecrawl web scrape tool"
description: str = "Scrape webpages url using Firecrawl and return the contents"
args_schema: Type[BaseModel] = FirecrawlScrapeWebsiteToolSchema
@@ -63,6 +67,7 @@ class FirecrawlScrapeWebsiteTool(BaseTool):
}
return self.firecrawl.scrape_url(url, options)
try:
from firecrawl import FirecrawlApp
# Must rebuild model after class is defined
@@ -71,4 +76,4 @@ except ImportError:
"""
When this tool is not used, then exception can be ignored.
"""
pass
pass