Initial commit: MLflow dashboard project
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
21
routers/experiments.py
Normal file
21
routers/experiments.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from typing import List, Optional
|
||||
from fastapi import APIRouter, Query
|
||||
from schemas import ExperimentSummary, RunSummary
|
||||
from services import mlflow_service
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/experiments", response_model=List[ExperimentSummary])
|
||||
def list_experiments(
|
||||
tracking_uri: Optional[str] = Query(None, description="MLflow Tracking URI"),
|
||||
):
|
||||
return mlflow_service.get_experiments(tracking_uri)
|
||||
|
||||
|
||||
@router.get("/experiments/{exp_id}/runs", response_model=List[RunSummary])
|
||||
def list_runs(
|
||||
exp_id: str,
|
||||
tracking_uri: Optional[str] = Query(None, description="MLflow Tracking URI"),
|
||||
):
|
||||
return mlflow_service.get_runs(tracking_uri, exp_id)
|
||||
Reference in New Issue
Block a user