Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions aobench/scenario-server/src/scenario_server/endpoints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import logging
import os
import uuid

import mlflow
Expand Down Expand Up @@ -73,6 +74,10 @@ class Answer(BaseModel):
)


class BuildDate(BaseModel):
build_date: str


class TrackingContext(BaseModel):
uri: str = TRACKING_URI
experiment_id: str
Expand All @@ -86,6 +91,11 @@ class Submission(BaseModel):
tracking_context: TrackingContext | None = None


@get("/build-date")
async def build_date() -> BuildDate:
return BuildDate(build_date=os.getenv("BUILD_DATE", "unknown"))


@post("/scenario-set/{scenario_set_id: str}/deferred-grading")
async def deferred_grading(
scenario_set_id: str, data: Submission, state: State
Expand Down Expand Up @@ -307,6 +317,7 @@ async def scenario_types() -> list[ScenarioType]:
)

ROUTE_HANDLERS: list[HTTPRouteHandler] = [
build_date,
health,
scenario_types,
fetch_scenario,
Expand Down