package tech.easyflow.ai.service;

import com.mybatisflex.core.service.IService;
import tech.easyflow.ai.entity.Model;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;

/**
 *  服务层。
 *
 * @author michael
 * @since 2024-08-23
 */
public interface ModelService extends IService<Model> {

    boolean addAiLlm(Model entity);

    Map<String, Object> verifyModelConfig(Model llm);

    Map<String, Map<String, List<Model>>> getList(Model entity);

    void removeByEntity(Model entity);

    Model getModelInstance(BigInteger modelId);

    Model getModelInstanceByInvokeCode(String invokeCode);

    void validateForSaveOrUpdate(Model entity, boolean isSave);

    List<Model> listInvokeModels();

    List<Model> listSelectableModels(Model entity, Boolean asTree, String sortKey, String sortType);

    Model updateInvokeConfig(BigInteger id, String invokeCode, Boolean publishEnabled);

    List<Model> batchUpdateInvokePublishStatus(List<BigInteger> ids, Boolean publishEnabled);
}
