package com.ruoyi.platform.utils;

import org.mlflow.api.proto.Service.*;
import org.mlflow.tracking.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class
MlflowUtil {
    private static String trackingUri = "http://172.20.32.181:32005";
    private MlflowClient client;

    public MlflowUtil() {
        client = new MlflowClient(trackingUri);
    }

    public List<Experiment> getExperiments() {
        return client.listExperiments();
    }

    public List<RunInfo> getRuns(String experimentId) {
        return client.listRunInfos(experimentId);
    }

    public Run getData(String runId) {
        return client.getRun(runId);
    }
}
