Skip to content

Python scraper based on AI

changed pydantic with langchain_pydantic

Marco Vinciguerraa96617d6f88f
diff --git a/examples/anthropic/search_graph_schema_haiku.py b/examples/anthropic/search_graph_schema_haiku.py
index 1158d58a..0ccafa79 100644
--- a/examples/anthropic/search_graph_schema_haiku.py
+++ b/examples/anthropic/search_graph_schema_haiku.py
@@ -5,7 +5,7 @@ Example of Search Graph
import os
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SearchGraph
load_dotenv()
diff --git a/examples/anthropic/smart_scraper_schema_haiku.py b/examples/anthropic/smart_scraper_schema_haiku.py
index bd447a06..0e70aeb5 100644
--- a/examples/anthropic/smart_scraper_schema_haiku.py
+++ b/examples/anthropic/smart_scraper_schema_haiku.py
@@ -4,7 +4,7 @@ Basic example of scraping pipeline using SmartScraper using Azure OpenAI Key
import os
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from dotenv import load_dotenv
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info
diff --git a/examples/azure/search_graph_schema_azure.py b/examples/azure/search_graph_schema_azure.py
index 629c92ab..ba80b373 100644
--- a/examples/azure/search_graph_schema_azure.py
+++ b/examples/azure/search_graph_schema_azure.py
@@ -9,7 +9,7 @@ load_dotenv()
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/azure/smart_scraper_schema_azure.py b/examples/azure/smart_scraper_schema_azure.py
index d0816bf5..5c882c46 100644
--- a/examples/azure/smart_scraper_schema_azure.py
+++ b/examples/azure/smart_scraper_schema_azure.py
@@ -5,7 +5,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os
import json
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from dotenv import load_dotenv
from scrapegraphai.graphs import SmartScraperGraph
diff --git a/examples/bedrock/search_graph_schema_bedrock.py b/examples/bedrock/search_graph_schema_bedrock.py
index a49ba730..ad2cadab 100644
--- a/examples/bedrock/search_graph_schema_bedrock.py
+++ b/examples/bedrock/search_graph_schema_bedrock.py
@@ -4,7 +4,7 @@ Example of Search Graph
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/bedrock/smart_scraper_schema_bedrock.py b/examples/bedrock/smart_scraper_schema_bedrock.py
index 2829efec..02f83029 100644
--- a/examples/bedrock/smart_scraper_schema_bedrock.py
+++ b/examples/bedrock/smart_scraper_schema_bedrock.py
@@ -2,7 +2,7 @@
Basic example of scraping pipeline using SmartScraper
"""
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info
diff --git a/examples/deepseek/search_graph_schema_deepseek.py b/examples/deepseek/search_graph_schema_deepseek.py
index 1471ede1..9966602d 100644
--- a/examples/deepseek/search_graph_schema_deepseek.py
+++ b/examples/deepseek/search_graph_schema_deepseek.py
@@ -9,7 +9,7 @@ load_dotenv()
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/deepseek/smart_scraper_schema_deepseek.py b/examples/deepseek/smart_scraper_schema_deepseek.py
index 722e02bf..6d924b71 100644
--- a/examples/deepseek/smart_scraper_schema_deepseek.py
+++ b/examples/deepseek/smart_scraper_schema_deepseek.py
@@ -4,7 +4,7 @@ Basic example of scraping pipeline using SmartScraper
import os
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from dotenv import load_dotenv
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info
diff --git a/examples/extras/serch_graph_scehma.py b/examples/extras/serch_graph_scehma.py
index 493a4367..fe66530d 100644
--- a/examples/extras/serch_graph_scehma.py
+++ b/examples/extras/serch_graph_scehma.py
@@ -5,7 +5,7 @@ Example of Search Graph
import os
from dotenv import load_dotenv
from scrapegraphai.graphs import SearchGraph
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
load_dotenv()
diff --git a/examples/fireworks/pdf_scraper_multi_fireworks.py b/examples/fireworks/pdf_scraper_multi_fireworks.py
index c1077061..bbf3808a 100644
--- a/examples/fireworks/pdf_scraper_multi_fireworks.py
+++ b/examples/fireworks/pdf_scraper_multi_fireworks.py
@@ -5,7 +5,7 @@ import os
import json
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import PdfScraperMultiGraph
load_dotenv()
diff --git a/examples/fireworks/script_generator_schema_fireworks.py b/examples/fireworks/script_generator_schema_fireworks.py
index 6355a4e8..f6f90ddf 100644
--- a/examples/fireworks/script_generator_schema_fireworks.py
+++ b/examples/fireworks/script_generator_schema_fireworks.py
@@ -5,7 +5,7 @@ Basic example of scraping pipeline using ScriptCreatorGraph
import os
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import ScriptCreatorGraph
from scrapegraphai.utils import prettify_exec_info
diff --git a/examples/fireworks/search_graph_schema_fireworks.py b/examples/fireworks/search_graph_schema_fireworks.py
index d88d991e..a16d3ae2 100644
--- a/examples/fireworks/search_graph_schema_fireworks.py
+++ b/examples/fireworks/search_graph_schema_fireworks.py
@@ -9,7 +9,7 @@ load_dotenv()
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/fireworks/smart_scraper_schema_fireworks.py b/examples/fireworks/smart_scraper_schema_fireworks.py
index d71593f3..cefb4d7d 100644
--- a/examples/fireworks/smart_scraper_schema_fireworks.py
+++ b/examples/fireworks/smart_scraper_schema_fireworks.py
@@ -5,7 +5,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os, json
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
load_dotenv()
diff --git a/examples/google_genai/search_graph_schema_gemini.py b/examples/google_genai/search_graph_schema_gemini.py
index e4b7983d..3c44dd2d 100644
--- a/examples/google_genai/search_graph_schema_gemini.py
+++ b/examples/google_genai/search_graph_schema_gemini.py
@@ -9,7 +9,7 @@ load_dotenv()
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/google_genai/smart_scraper_schema_gemini.py b/examples/google_genai/smart_scraper_schema_gemini.py
index 6c817e20..8096c466 100644
--- a/examples/google_genai/smart_scraper_schema_gemini.py
+++ b/examples/google_genai/smart_scraper_schema_gemini.py
@@ -4,7 +4,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from dotenv import load_dotenv
from scrapegraphai.utils import prettify_exec_info
from scrapegraphai.graphs import SmartScraperGraph
diff --git a/examples/google_vertexai/search_graph_schema_gemini.py b/examples/google_vertexai/search_graph_schema_gemini.py
index 54586c7e..7e73c584 100644
--- a/examples/google_vertexai/search_graph_schema_gemini.py
+++ b/examples/google_vertexai/search_graph_schema_gemini.py
@@ -9,7 +9,7 @@ load_dotenv()
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/google_vertexai/smart_scraper_schema_gemini.py b/examples/google_vertexai/smart_scraper_schema_gemini.py
index 541ce9aa..18e0ef5b 100644
--- a/examples/google_vertexai/smart_scraper_schema_gemini.py
+++ b/examples/google_vertexai/smart_scraper_schema_gemini.py
@@ -4,7 +4,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from dotenv import load_dotenv
from scrapegraphai.utils import prettify_exec_info
from scrapegraphai.graphs import SmartScraperGraph
diff --git a/examples/groq/search_graph_schema_groq.py b/examples/groq/search_graph_schema_groq.py
index 4cc2209d..d5253f2c 100644
--- a/examples/groq/search_graph_schema_groq.py
+++ b/examples/groq/search_graph_schema_groq.py
@@ -9,7 +9,7 @@ load_dotenv()
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/groq/smart_scraper_schema_groq.py b/examples/groq/smart_scraper_schema_groq.py
index f9c1a40b..b2b377b3 100644
--- a/examples/groq/smart_scraper_schema_groq.py
+++ b/examples/groq/smart_scraper_schema_groq.py
@@ -4,7 +4,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os, json
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from dotenv import load_dotenv
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info
diff --git a/examples/integrations/indexify_node_example.py b/examples/integrations/indexify_node_example.py
index 07a184ec..a77b6bd2 100644
--- a/examples/integrations/indexify_node_example.py
+++ b/examples/integrations/indexify_node_example.py
@@ -8,7 +8,7 @@ from typing import List
from dotenv import load_dotenv
load_dotenv()
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.integrations import IndexifyNode
diff --git a/examples/local_models/search_graph_schema_ollama.py b/examples/local_models/search_graph_schema_ollama.py
index fb87954f..6720383c 100644
--- a/examples/local_models/search_graph_schema_ollama.py
+++ b/examples/local_models/search_graph_schema_ollama.py
@@ -4,7 +4,7 @@ Example of Search Graph
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/local_models/smart_scraper_schema_ollama.py b/examples/local_models/smart_scraper_schema_ollama.py
index 088e2eed..a732aa8d 100644
--- a/examples/local_models/smart_scraper_schema_ollama.py
+++ b/examples/local_models/smart_scraper_schema_ollama.py
@@ -3,7 +3,7 @@ Basic example of scraping pipeline using SmartScraper with schema
"""
import json
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info
diff --git a/examples/mistral/pdf_scraper_multi_mistral.py b/examples/mistral/pdf_scraper_multi_mistral.py
index e9f1613f..18b8a1f0 100644
--- a/examples/mistral/pdf_scraper_multi_mistral.py
+++ b/examples/mistral/pdf_scraper_multi_mistral.py
@@ -5,7 +5,7 @@ import os
import json
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import PdfScraperMultiGraph
load_dotenv()
diff --git a/examples/mistral/script_generator_schema_mistral.py b/examples/mistral/script_generator_schema_mistral.py
index b9c77285..beaca4c1 100644
--- a/examples/mistral/script_generator_schema_mistral.py
+++ b/examples/mistral/script_generator_schema_mistral.py
@@ -6,8 +6,7 @@ import os
from dotenv import load_dotenv
from scrapegraphai.graphs import ScriptCreatorGraph
from scrapegraphai.utils import prettify_exec_info
-
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
load_dotenv()
diff --git a/examples/mistral/search_graph_schema_mistral.py b/examples/mistral/search_graph_schema_mistral.py
index 7c71c0b1..d804d984 100644
--- a/examples/mistral/search_graph_schema_mistral.py
+++ b/examples/mistral/search_graph_schema_mistral.py
@@ -5,7 +5,7 @@ Example of Search Graph
import os
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
diff --git a/examples/mistral/smart_scraper_schema_mistral.py b/examples/mistral/smart_scraper_schema_mistral.py
index 3e1e505a..517bd743 100644
--- a/examples/mistral/smart_scraper_schema_mistral.py
+++ b/examples/mistral/smart_scraper_schema_mistral.py
@@ -5,7 +5,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os, json
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
load_dotenv()
diff --git a/examples/nemotron/script_generator_schema_nemotron.py b/examples/nemotron/script_generator_schema_nemotron.py
index 3f0713a4..09d0d682 100644
--- a/examples/nemotron/script_generator_schema_nemotron.py
+++ b/examples/nemotron/script_generator_schema_nemotron.py
@@ -7,7 +7,7 @@ from dotenv import load_dotenv
from scrapegraphai.graphs import ScriptCreatorGraph
from scrapegraphai.utils import prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
load_dotenv()
diff --git a/examples/nemotron/search_graph_schema_nemotron.py b/examples/nemotron/search_graph_schema_nemotron.py
index eec72daf..84150f53 100644
--- a/examples/nemotron/search_graph_schema_nemotron.py
+++ b/examples/nemotron/search_graph_schema_nemotron.py
@@ -9,7 +9,7 @@ load_dotenv()
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/nemotron/smart_scraper_schema_nemotron.py b/examples/nemotron/smart_scraper_schema_nemotron.py
index e1462e85..11ce4de2 100644
--- a/examples/nemotron/smart_scraper_schema_nemotron.py
+++ b/examples/nemotron/smart_scraper_schema_nemotron.py
@@ -5,7 +5,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os, json
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
load_dotenv()
diff --git a/examples/oneapi/search_graph_schema_oneapi.py b/examples/oneapi/search_graph_schema_oneapi.py
index 7fc44539..d99bca00 100644
--- a/examples/oneapi/search_graph_schema_oneapi.py
+++ b/examples/oneapi/search_graph_schema_oneapi.py
@@ -4,7 +4,7 @@ Example of Search Graph
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
# ************************************************
diff --git a/examples/oneapi/smart_scraper_schema_oneapi.py b/examples/oneapi/smart_scraper_schema_oneapi.py
index 0c011bb6..b12bbf66 100644
--- a/examples/oneapi/smart_scraper_schema_oneapi.py
+++ b/examples/oneapi/smart_scraper_schema_oneapi.py
@@ -2,7 +2,7 @@
Basic example of scraping pipeline using SmartScraper and OneAPI
"""
from typing import List
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info
diff --git a/examples/openai/pdf_scraper_multi_openai.py b/examples/openai/pdf_scraper_multi_openai.py
index 91e219e3..a405da43 100644
--- a/examples/openai/pdf_scraper_multi_openai.py
+++ b/examples/openai/pdf_scraper_multi_openai.py
@@ -5,7 +5,7 @@ import os
import json
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import PdfScraperMultiGraph
load_dotenv()
diff --git a/examples/openai/script_generator_schema_openai.py b/examples/openai/script_generator_schema_openai.py
index 5e542c53..e8e7d111 100644
--- a/examples/openai/script_generator_schema_openai.py
+++ b/examples/openai/script_generator_schema_openai.py
@@ -7,7 +7,7 @@ from dotenv import load_dotenv
from scrapegraphai.graphs import ScriptCreatorGraph
from scrapegraphai.utils import prettify_exec_info
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from typing import List
load_dotenv()
diff --git a/examples/openai/search_graph_schema_openai.py b/examples/openai/search_graph_schema_openai.py
index 571f08b0..c0440955 100644
--- a/examples/openai/search_graph_schema_openai.py
+++ b/examples/openai/search_graph_schema_openai.py
@@ -5,7 +5,7 @@ Example of Search Graph
import os
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SearchGraph
from scrapegraphai.utils import convert_to_csv, convert_to_json, prettify_exec_info
diff --git a/examples/openai/smart_scraper_schema_openai.py b/examples/openai/smart_scraper_schema_openai.py
index 0c1618d6..f1ce3d14 100644
--- a/examples/openai/smart_scraper_schema_openai.py
+++ b/examples/openai/smart_scraper_schema_openai.py
@@ -5,7 +5,7 @@ Basic example of scraping pipeline using SmartScraper with schema
import os, json
from typing import List
from dotenv import load_dotenv
-from pydantic import BaseModel, Field
+from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
load_dotenv()