Skip to content

Commit 5541f0b

Browse files
committed
Updating copyright and removing request setter from get eval endpoints.
Signed-off-by: Eric Evans <[email protected]>
1 parent a4e718a commit 5541f0b

File tree

2 files changed

+26
-35
lines changed

2 files changed

+26
-35
lines changed

src/aiq/front_ends/fastapi/fastapi_front_end_plugin_worker.py

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -266,45 +266,36 @@ def translate_job_to_response(job: JobInfo) -> AIQEvaluateStatusResponse:
266266
updated_at=job.updated_at,
267267
expires_at=job_store.get_expires_at(job))
268268

269-
async def get_job_status(job_id: str, http_request: Request) -> AIQEvaluateStatusResponse:
269+
def get_job_status(job_id: str) -> AIQEvaluateStatusResponse:
270270
"""Get the status of an evaluation job."""
271271
logger.info("Getting status for job %s", job_id)
272-
273-
async with session_manager.session(request=http_request):
274-
275-
job = job_store.get_job(job_id)
276-
if not job:
277-
logger.warning("Job %s not found", job_id)
278-
raise HTTPException(status_code=404, detail=f"Job {job_id} not found")
279-
logger.info(f"Found job {job_id} with status {job.status}")
280-
return translate_job_to_response(job)
281-
282-
async def get_last_job_status(http_request: Request) -> AIQEvaluateStatusResponse:
272+
job = job_store.get_job(job_id)
273+
if not job:
274+
logger.warning("Job %s not found", job_id)
275+
raise HTTPException(status_code=404, detail=f"Job {job_id} not found")
276+
logger.info(f"Found job {job_id} with status {job.status}")
277+
return translate_job_to_response(job)
278+
279+
def get_last_job_status() -> AIQEvaluateStatusResponse:
283280
"""Get the status of the last created evaluation job."""
284281
logger.info("Getting last job status")
285-
286-
async with session_manager.session(request=http_request):
287-
288-
job = job_store.get_last_job()
289-
if not job:
290-
logger.warning("No jobs found when requesting last job status")
291-
raise HTTPException(status_code=404, detail="No jobs found")
292-
logger.info("Found last job %s with status %s", job.job_id, job.status)
293-
return translate_job_to_response(job)
294-
295-
async def get_jobs(http_request: Request, status: str | None = None) -> list[AIQEvaluateStatusResponse]:
282+
job = job_store.get_last_job()
283+
if not job:
284+
logger.warning("No jobs found when requesting last job status")
285+
raise HTTPException(status_code=404, detail="No jobs found")
286+
logger.info("Found last job %s with status %s", job.job_id, job.status)
287+
return translate_job_to_response(job)
288+
289+
def get_jobs(status: str | None = None) -> list[AIQEvaluateStatusResponse]:
296290
"""Get all jobs, optionally filtered by status."""
297-
298-
async with session_manager.session(request=http_request):
299-
300-
if status is None:
301-
logger.info("Getting all jobs")
302-
jobs = job_store.get_all_jobs()
303-
else:
304-
logger.info("Getting jobs with status %s", status)
305-
jobs = job_store.get_jobs_by_status(status)
306-
logger.info("Found %d jobs", len(jobs))
307-
return [translate_job_to_response(job) for job in jobs]
291+
if status is None:
292+
logger.info("Getting all jobs")
293+
jobs = job_store.get_all_jobs()
294+
else:
295+
logger.info("Getting jobs with status %s", status)
296+
jobs = job_store.get_jobs_by_status(status)
297+
logger.info("Found %d jobs", len(jobs))
298+
return [translate_job_to_response(job) for job in jobs]
308299

309300
if self.front_end_config.evaluate.path:
310301
# Add last job endpoint first (most specific)

src/aiq/runtime/user_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)