Skip to content

Python scraper based on AI

add private class

VinciGit00d124a6d9e863
diff --git a/.gitignore b/.gitignore
index f97e834d..c14ce406 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
.DS_Store
.DS_Store?
._*
-__pycache__/
\ No newline at end of file
+__pycache__/
+.DS_Store
+.env
diff --git a/ClassGenerator.py b/ClassGenerator.py
index 9d240ac6..8d8abb8b 100644
--- a/ClassGenerator.py
+++ b/ClassGenerator.py
@@ -1,6 +1,6 @@
import os
from dotenv import load_dotenv
-from AmazScraper.pydantic_class import Response
+from AmazScraper.pydantic_class import _Response
from AmazScraper.class_creator import create_class
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
@@ -15,7 +15,7 @@ class Generator:
def __init__(self, values: list):
create_class(values)
- self.parser = PydanticOutputParser(pydantic_object=Response)
+ self.parser = PydanticOutputParser(pydantic_object=_Response)
self.prompt = PromptTemplate(
template="Answer the user query.\n{format_instructions}\n{query}\n",
diff --git a/pydantic_class.py b/pydantic_class.py
index 4599c765..e9b554d1 100644
--- a/pydantic_class.py
+++ b/pydantic_class.py
@@ -1,4 +1,5 @@
+
from langchain_core.pydantic_v1 import BaseModel, Field
class _Response(BaseModel):
- title_swebsite: str = Field(description='Title of the items')
+ title: str = Field(description='Title of the news')