jebin2 commited on
Commit
2d2a3f1
·
1 Parent(s): 16eca32
routers/gemini.py CHANGED
@@ -369,11 +369,10 @@ async def get_job_status(
369
 
370
  if job.status == "completed":
371
  response["completed_at"] = job.completed_at.isoformat() if job.completed_at else None
372
- response["output"] = job.output_data
373
 
374
- # For video jobs, add download URL
375
- # if job.job_type == "video" and job.output_data and (job.output_data.get("filename") or job.output_data.get("video_url")):
376
- # response["download_url"] = f"/gemini/download/{job.job_id}"
377
 
378
  if job.status == "failed":
379
  response["error"] = job.error_message
 
369
 
370
  if job.status == "completed":
371
  response["completed_at"] = job.completed_at.isoformat() if job.completed_at else None
 
372
 
373
+ # Return generated prompt if available (for animation_prompt jobs)
374
+ if job.output_data and "prompt" in job.output_data:
375
+ response["prompt"] = job.output_data["prompt"]
376
 
377
  if job.status == "failed":
378
  response["error"] = job.error_message
services/gemini_job_worker.py CHANGED
@@ -173,8 +173,10 @@ class GeminiJobProcessor(JobProcessor[GeminiJob]):
173
  logger.info(f"Generated prompt for job {job.job_id}: {prompt}")
174
 
175
  # Update input data with generated prompt for reference
176
- input_data["prompt"] = prompt
177
- job.input_data = input_data
 
 
178
  # We need to commit this change to DB so it persists
179
  # But session commit happens outside this method usually?
180
  # Actually process() calls this, and process() returns job,
 
173
  logger.info(f"Generated prompt for job {job.job_id}: {prompt}")
174
 
175
  # Update input data with generated prompt for reference
176
+ # Create a new dictionary to ensure SQLAlchemy detects the change
177
+ new_input_data = dict(input_data)
178
+ new_input_data["prompt"] = prompt
179
+ job.input_data = new_input_data
180
  # We need to commit this change to DB so it persists
181
  # But session commit happens outside this method usually?
182
  # Actually process() calls this, and process() returns job,