From 42332d4da8a148448c6c286025b42d9d07fbe0b6 Mon Sep 17 00:00:00 2001 From: Mike Plachta Date: Sat, 16 Aug 2025 19:56:40 +0900 Subject: [PATCH] fix: replace deprecated class Config with model_config in Bright Data tools Replaced deprecated Pydantic v1 class-based Config with ConfigDict in three Bright Data tools to fix deprecation warnings: - brightdata_dataset.py - brightdata_serp.py - brightdata_unlocker.py --- crewai_tools/tools/brightdata_tool/brightdata_dataset.py | 7 +++---- crewai_tools/tools/brightdata_tool/brightdata_serp.py | 8 ++++---- crewai_tools/tools/brightdata_tool/brightdata_unlocker.py | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/crewai_tools/tools/brightdata_tool/brightdata_dataset.py b/crewai_tools/tools/brightdata_tool/brightdata_dataset.py index bd0dcc1c..6a3ab5af 100644 --- a/crewai_tools/tools/brightdata_tool/brightdata_dataset.py +++ b/crewai_tools/tools/brightdata_tool/brightdata_dataset.py @@ -4,16 +4,15 @@ import aiohttp from crewai.tools import BaseTool -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from pydantic_settings import BaseSettings class BrightDataConfig(BaseSettings): + model_config = ConfigDict(env_prefix="BRIGHTDATA_") + API_URL: str = "https://api.brightdata.com" DEFAULT_TIMEOUT: int = 600 DEFAULT_POLLING_INTERVAL: int = 1 - - class Config: - env_prefix = "BRIGHTDATA_" class BrightDataDatasetToolException(Exception): """Exception raised for custom error in the application.""" diff --git a/crewai_tools/tools/brightdata_tool/brightdata_serp.py b/crewai_tools/tools/brightdata_tool/brightdata_serp.py index 3b117071..fe3df564 100644 --- a/crewai_tools/tools/brightdata_tool/brightdata_serp.py +++ b/crewai_tools/tools/brightdata_tool/brightdata_serp.py @@ -4,13 +4,13 @@ import requests from crewai.tools import BaseTool -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from pydantic_settings import BaseSettings class BrightDataConfig(BaseSettings): - API_URL: str = "https://api.brightdata.com/request" - class Config: - env_prefix = "BRIGHTDATA_" + model_config = ConfigDict(env_prefix="BRIGHTDATA_") + + API_URL: str = "https://api.brightdata.com/request" class BrightDataSearchToolSchema(BaseModel): """ diff --git a/crewai_tools/tools/brightdata_tool/brightdata_unlocker.py b/crewai_tools/tools/brightdata_tool/brightdata_unlocker.py index fb8c2fb0..7b76b4c6 100644 --- a/crewai_tools/tools/brightdata_tool/brightdata_unlocker.py +++ b/crewai_tools/tools/brightdata_tool/brightdata_unlocker.py @@ -3,13 +3,13 @@ import requests from crewai.tools import BaseTool -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from pydantic_settings import BaseSettings class BrightDataConfig(BaseSettings): - API_URL: str = "https://api.brightdata.com/request" - class Config: - env_prefix = "BRIGHTDATA_" + model_config = ConfigDict(env_prefix="BRIGHTDATA_") + + API_URL: str = "https://api.brightdata.com/request" class BrightDataUnlockerToolSchema(BaseModel): """