Merge pull request #1623 from unclecode/fix/deprecated_pydantic
Refactor Pydantic model configuration to use ConfigDict for arbitrary…
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from pydantic import BaseModel, HttpUrl, PrivateAttr, Field
|
from pydantic import BaseModel, HttpUrl, PrivateAttr, Field, ConfigDict
|
||||||
from typing import List, Dict, Optional, Callable, Awaitable, Union, Any
|
from typing import List, Dict, Optional, Callable, Awaitable, Union, Any
|
||||||
from typing import AsyncGenerator
|
from typing import AsyncGenerator
|
||||||
from typing import Generic, TypeVar
|
from typing import Generic, TypeVar
|
||||||
@@ -153,8 +153,7 @@ class CrawlResult(BaseModel):
|
|||||||
console_messages: Optional[List[Dict[str, Any]]] = None
|
console_messages: Optional[List[Dict[str, Any]]] = None
|
||||||
tables: List[Dict] = Field(default_factory=list) # NEW – [{headers,rows,caption,summary}]
|
tables: List[Dict] = Field(default_factory=list) # NEW – [{headers,rows,caption,summary}]
|
||||||
|
|
||||||
class Config:
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||||
arbitrary_types_allowed = True
|
|
||||||
|
|
||||||
# NOTE: The StringCompatibleMarkdown class, custom __init__ method, property getters/setters,
|
# NOTE: The StringCompatibleMarkdown class, custom __init__ method, property getters/setters,
|
||||||
# and model_dump override all exist to support a smooth transition from markdown as a string
|
# and model_dump override all exist to support a smooth transition from markdown as a string
|
||||||
@@ -332,8 +331,7 @@ class AsyncCrawlResponse(BaseModel):
|
|||||||
network_requests: Optional[List[Dict[str, Any]]] = None
|
network_requests: Optional[List[Dict[str, Any]]] = None
|
||||||
console_messages: Optional[List[Dict[str, Any]]] = None
|
console_messages: Optional[List[Dict[str, Any]]] = None
|
||||||
|
|
||||||
class Config:
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||||
arbitrary_types_allowed = True
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Scraping Models
|
# Scraping Models
|
||||||
|
|||||||
Reference in New Issue
Block a user