fix: params

This commit is contained in:
PeriniM 2024-02-07 13:52:12 +01:00
parent 134b964495
commit f4c40edbb6
4 changed files with 8 additions and 4 deletions

5
pydantic_class.py Normal file
View File

@ -0,0 +1,5 @@
from langchain_core.pydantic_v1 import BaseModel, Field
class _Response(BaseModel):
title: str = Field(description='Title of the news')

View File

@ -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

View File

@ -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')

View File

@ -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'