From c5e36ab565e46f57ac36e527000c67b9442320cf Mon Sep 17 00:00:00 2001 From: sudipnext Date: Sun, 4 Jan 2026 17:33:05 +0545 Subject: [PATCH 1/2] fix: rename 'prompt' to 'content' in presentation generation API and update tests accordingly --- servers/fastapi/openai_spec.json | 7 ++++--- .../fastapi/tests/test_presentation_generation_api.py | 10 +++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/servers/fastapi/openai_spec.json b/servers/fastapi/openai_spec.json index 4a9e5e08..b226c5e4 100644 --- a/servers/fastapi/openai_spec.json +++ b/servers/fastapi/openai_spec.json @@ -79,9 +79,10 @@ "schemas": { "Body_generate_presentation_api_api_v1_ppt_presentation_generate_post": { "properties": { - "prompt": { + "content": { "type": "string", - "title": "Prompt" + "title": "Content", + "description": "The content for generating the presentation" }, "n_slides": { "type": "integer", @@ -121,7 +122,7 @@ } }, "type": "object", - "required": ["prompt"], + "required": ["content"], "title": "Body_generate_presentation_api_api_v1_ppt_presentation_generate_post" }, "PresentationPathAndEditPath": { diff --git a/servers/fastapi/tests/test_presentation_generation_api.py b/servers/fastapi/tests/test_presentation_generation_api.py index 5e5f9be5..3806dc61 100644 --- a/servers/fastapi/tests/test_presentation_generation_api.py +++ b/servers/fastapi/tests/test_presentation_generation_api.py @@ -123,7 +123,7 @@ class TestPresentationGenerationAPI: response = client.post( "/api/v1/ppt/presentation/generate", json={ - "prompt": "Create a presentation about artificial intelligence and machine learning", + "content": "Create a presentation about artificial intelligence and machine learning", "n_slides": 5, "language": "English", "export_as": "pdf", @@ -138,7 +138,7 @@ class TestPresentationGenerationAPI: response = client.post( "/api/v1/ppt/presentation/generate", json={ - "prompt": "Create a presentation about artificial intelligence and machine learning", + "content": "Create a presentation about artificial intelligence and machine learning", "n_slides": 5, "language": "English", "export_as": "pptx", @@ -149,7 +149,7 @@ class TestPresentationGenerationAPI: assert "presentation_id" in response.json() assert "pptx" in response.json()["path"] - def test_generate_presentation_with_no_prompt(self, client): + def test_generate_presentation_with_no_content(self, client): response = client.post( "/api/v1/ppt/presentation/generate", json={ @@ -166,7 +166,7 @@ class TestPresentationGenerationAPI: response = client.post( "/api/v1/ppt/presentation/generate", json={ - "prompt": "Create a presentation about artificial intelligence and machine learning", + "content": "Create a presentation about artificial intelligence and machine learning", "n_slides": 0, "language": "English", "export_as": "pdf", @@ -179,7 +179,7 @@ class TestPresentationGenerationAPI: response = client.post( "/api/v1/ppt/presentation/generate", json={ - "prompt": "Create a presentation about artificial intelligence and machine learning", + "content": "Create a presentation about artificial intelligence and machine learning", "n_slides": 5, "language": "English", "export_as": "invalid_type", From d623fa66700df9c7394875fdba9e3e5c1f95f907 Mon Sep 17 00:00:00 2001 From: sudipnext Date: Sun, 4 Jan 2026 17:49:22 +0545 Subject: [PATCH 2/2] fix: add fallback to placeholder icon when no icon is found in slide processing --- servers/fastapi/utils/process_slides.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/servers/fastapi/utils/process_slides.py b/servers/fastapi/utils/process_slides.py index 87aa3e21..b9ddb1de 100644 --- a/servers/fastapi/utils/process_slides.py +++ b/servers/fastapi/utils/process_slides.py @@ -51,7 +51,12 @@ async def process_slide_and_fetch_assets( for icon_path in icon_paths: icon_dict = get_dict_at_path(slide.content, icon_path) - icon_dict["__icon_url__"] = results.pop()[0] + icon_result = results.pop() + if icon_result and len(icon_result) > 0: + icon_dict["__icon_url__"] = icon_result[0] + else: + # Fallback to placeholder if no icon found + icon_dict["__icon_url__"] = "/static/icons/placeholder.svg" set_dict_at_path(slide.content, icon_path, icon_dict) return return_assets @@ -159,7 +164,12 @@ async def process_old_and_new_slides_and_fetch_assets( for i, new_icon in enumerate(new_icons): if new_icons_fetch_status[i]: - new_icon_dicts[i]["__icon_url__"] = new_icons[i][0] + icon_result = new_icons[i] + if icon_result and len(icon_result) > 0: + new_icon_dicts[i]["__icon_url__"] = icon_result[0] + else: + # Fallback to placeholder if no icon found + new_icon_dicts[i]["__icon_url__"] = "/static/icons/placeholder.svg" for i, new_image_dict in enumerate(new_image_dicts): set_dict_at_path(new_slide_content, new_image_dict_paths[i], new_image_dict)