package com.infoepoch.pms.agent.platform.model.application.dto;

import com.infoepoch.pms.agent.platform.model.domain.AiModelConfig;
import lombok.Getter;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Map;

@Getter
public class ModelConfigResponse {

    private final String id;
    private final String providerId;
    private final String modelName;
    private final String modelType;
    private final String displayName;
    private final Integer maxTokens;
    private final BigDecimal temperature;
    private final Integer contextWindow;
    private final Integer vectorDimension;
    private final Boolean enableThinking;
    private final Boolean multiModel;
    private final Map<String, Object> customConfig;
    private final boolean active;
    private final LocalDateTime createdAt;
    private final LocalDateTime updatedAt;

    public ModelConfigResponse(AiModelConfig config) {
        this.id = config.getId();
        this.providerId = config.getProvider() != null ? config.getProvider().getId() : config.getProviderId();
        this.modelName = config.getModelName();
        this.modelType = config.getModelType();
        this.displayName = config.getDisplayName();
        this.maxTokens = config.getMaxTokens();
        this.temperature = config.getTemperature();
        this.contextWindow = config.getContextWindow();
        this.vectorDimension = config.getVectorDimension();
        this.enableThinking = config.getEnableThinking();
        this.multiModel = config.getMultiModel();
        this.customConfig = config.getCustomConfig();
        this.active = config.isActive();
        this.createdAt = config.getCreatedAt();
        this.updatedAt = config.getUpdatedAt();
    }
}
