Spaces:
Runtime error
Runtime error
| from sqlalchemy import ( | |
| Boolean, | |
| String, | |
| Integer, | |
| Float | |
| ) | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| from components.dbo.models.base import Base | |
| class LLMConfig(Base): | |
| """ | |
| Сущность, которая хранит параметры вызова ЛЛМ. | |
| """ | |
| __tablename__ = "llm_config" | |
| is_default: Mapped[bool] = mapped_column(Boolean, is_default=False) | |
| model: Mapped[String] = mapped_column(String) | |
| temperature: Mapped[float] = mapped_column(Float) | |
| top_p: Mapped[float] = mapped_column(Float) | |
| min_p: Mapped[float] = mapped_column(Float) | |
| frequency_penalty: Mapped[float] = mapped_column(Float) | |
| presence_penalty: Mapped[float] = mapped_column(Float) | |
| n_predict: Mapped[int] = mapped_column(Integer) | |
| seed: Mapped[int] = mapped_column(Integer) | |
| #TODO: вынести в базовый класс | |
| def to_dict(self): | |
| return {c.name: getattr(self, c.name) for c in self.__table__.columns} |