# !!!!! DO NOT EVER CHANGE THIS FILE MANUALLY -- AUTOGENERATED by orm2pydantic.py !!!!!
# Generated from module egp_api_backend.server.internal.orm.orm_fine_tuning_jobs in the egp-api-backend package for use in the EGP python SDK
# To regenerate this file, run:
# scaleapi/packages/egp-api-backend/scripts/orm2pydantic.sh

from scale_egp.utils.model_utils import BaseModel, Entity
from pydantic import Field

from datetime import (datetime)
from scale_egp.sdk.models.fine_tuning_jobs import (FineTuningJobStatus, FineTuningJobVendorConfiguration, TrainingDatasetORMSchemaTypeEnum)
from scale_egp.utils.model_utils import (BaseModel)
from scale_egp.utils.strenum_compat import (StrEnum)
from typing import (Optional)
DataSource = StrEnum('DataSource', [('S3', 'S3'), ('SHARE_POINT', 'SharePoint'), ('LOCAL_FILE', 'LocalFile'), ('LOCAL_CHUNKS', 'LocalChunks'), ('GOOGLE_DRIVE', 'GoogleDrive'), ('AZURE_BLOB_STORAGE', 'AzureBlobStorage'), ('CONFLUENCE', 'Confluence')])
class TrainingDatasetRequest(BaseModel):
    name: str = Field(..., description="The name of the dataset")
    schema_type: TrainingDatasetORMSchemaTypeEnum = Field(..., description="The schema type of the dataset, currently only GENERATION is supported")
    data_source: DataSource = Field(..., description="The data source of the dataset, used to determine how to parse the location")
    account_id: str = Field(..., description="The ID of the account that owns the given entity.", can_patch=False)


class TrainingDataset(Entity):
    name: str = Field(..., description="The name of the dataset")
    schema_type: TrainingDatasetORMSchemaTypeEnum = Field(..., description="The schema type of the dataset, currently only GENERATION is supported")
    data_source: DataSource = Field(..., description="The data source of the dataset, used to determine how to parse the location")
    id: str = Field(..., description="The unique identifier of the entity.")
    created_at: datetime = Field(..., description="The date and time when the entity was created in ISO format.")
    account_id: str = Field(..., description="The ID of the account that owns the given entity.", can_patch=False)
    created_by_user_id: str = Field(..., description="The user who originally created the entity.")


class FineTuningJobRequest(BaseModel):
    base_model_id: Optional[str] = Field(None)
    vendor_configuration: Optional[FineTuningJobVendorConfiguration] = Field(None)
    fine_tuned_model_id: Optional[str] = Field(None)
    training_dataset_id: str
    validation_dataset_id: Optional[str] = Field(None)
    account_id: str = Field(..., description="The ID of the account that owns the given entity.", can_patch=False)


class FineTuningJob(Entity):
    base_model_id: Optional[str] = Field(None)
    vendor_configuration: Optional[FineTuningJobVendorConfiguration] = Field(None)
    fine_tuned_model_id: Optional[str] = Field(None)
    training_dataset_id: str
    validation_dataset_id: Optional[str] = Field(None)
    status: FineTuningJobStatus
    id: str = Field(..., description="The unique identifier of the entity.")
    created_at: datetime = Field(..., description="The date and time when the entity was created in ISO format.")
    account_id: str = Field(..., description="The ID of the account that owns the given entity.", can_patch=False)
    created_by_user_id: str = Field(..., description="The user who originally created the entity.")


