Skip to content

Python scraper based on AI

fix: params

PeriniMf4c40edbb68c
diff --git a/pydantic_class.py b/pydantic_class.py
new file mode 100644
index 00000000..87f2c56d
--- /dev/null
+++ b/pydantic_class.py
@@ -0,0 +1,5 @@
+
+from langchain_core.pydantic_v1 import BaseModel, Field
+
+class _Response(BaseModel):
+ title: str = Field(description='Title of the news')
diff --git a/yosoai/class_generator.py b/yosoai/class_generator.py
index c3a7835a..31729b37 100644
--- a/yosoai/class_generator.py
+++ b/yosoai/class_generator.py
@@ -6,12 +6,11 @@ from langchain_core.pydantic_v1 import Field
from langchain.output_parsers import PydanticOutputParser
class Generator:
- def __init__(self, values: list[dict], api_key: str, temperature_param: float = 0.0, model_name: str = "gpt-3.5-turbo") -> dict:
+ def __init__(self, api_key: str, temperature_param: float = 0.0, model_name: str = "gpt-3.5-turbo") -> dict:
"""
Initializes the Generator object.
Args:
- values (list): A list of values used for class creation.
api_key (str): The API key for accessing the language model.
temperature_param (float): A parameter controlling the randomness of the language model's output.
model_name (str): The name of the language model to be used (default: "gpt-3.5-turbo"). All
diff --git a/yosoai/pydantic_class.py b/yosoai/pydantic_class.py
index 7af62077..b04a1658 100644
--- a/yosoai/pydantic_class.py
+++ b/yosoai/pydantic_class.py
@@ -1,4 +1,4 @@
from langchain_core.pydantic_v1 import BaseModel, Field
class _Response(BaseModel):
- title: str = Field(description='Title of the news')
+ title_news: str = Field(description='Give me the name of the news')
diff --git a/yosoai/request.py b/yosoai/request.py
index 537b3018..7333d405 100644
--- a/yosoai/request.py
+++ b/yosoai/request.py
@@ -1,8 +1,8 @@
import time
from typing import List
from .getter import remover
-from .class_creator import create_class
from .class_generator import Generator
+from .class_creator import create_class
from .token_calculator import truncate_text_tokens
EMBEDDING_ENCODING = 'cl100k_base'