From 03cb86ee46d9e477fec14348f6baed63b83c2b2f Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sun, 17 Dec 2023 21:28:33 +0530 Subject: [PATCH] Update typing and object assignment for new text to image method return --- src/khoj/routers/api.py | 2 +- src/khoj/routers/helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/khoj/routers/api.py b/src/khoj/routers/api.py index d800da94..a243e4dc 100644 --- a/src/khoj/routers/api.py +++ b/src/khoj/routers/api.py @@ -732,7 +732,7 @@ async def chat( await sync_to_async(save_to_conversation_log)( q, image, user, meta_log, intent_type="text-to-image", inferred_queries=[improved_image_prompt] ) - content_obj = {"image": image, "intentType": "text-to-image", "inferredQueries": [improved_image_prompt]} + content_obj = {"image": image, "intentType": "text-to-image", "inferredQueries": [improved_image_prompt]} # type: ignore[assignment] return Response(content=json.dumps(content_obj), media_type="application/json", status_code=status_code) # Get the (streamed) chat response from the LLM of choice. diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 1c6b437e..ff063cab 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -266,7 +266,7 @@ def generate_chat_response( return chat_response, metadata -async def text_to_image(message: str) -> Tuple[Optional[str], int]: +async def text_to_image(message: str) -> Tuple[Optional[str], int, Optional[str]]: status_code = 200 image = None