mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-06-25 21:11:11 +08:00
fix: params
This commit is contained in:
parent
134b964495
commit
f4c40edbb6
5
pydantic_class.py
Normal file
5
pydantic_class.py
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
||||
|
||||
class _Response(BaseModel):
|
||||
title: str = Field(description='Title of the news')
|
||||
@ -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
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user