added gemini too
Browse files- controller.py +1 -1
- gemini_report_generator.py +7 -6
controller.py
CHANGED
@@ -351,7 +351,7 @@ async def csv_chat(request: Dict, authorization: str = Header(None)):
|
|
351 |
if generate_report is True:
|
352 |
report_files = await generate_csv_report(csv_url, query)
|
353 |
if report_files is not None:
|
354 |
-
return {"
|
355 |
|
356 |
if if_initial_chat_question(query):
|
357 |
answer = await asyncio.to_thread(
|
|
|
351 |
if generate_report is True:
|
352 |
report_files = await generate_csv_report(csv_url, query)
|
353 |
if report_files is not None:
|
354 |
+
return {"answer": jsonable_encoder(report_files)}
|
355 |
|
356 |
if if_initial_chat_question(query):
|
357 |
answer = await asyncio.to_thread(
|
gemini_report_generator.py
CHANGED
@@ -350,12 +350,13 @@ async def generate_csv_report(csv_url: str, query: str) -> FileBoxProps:
|
|
350 |
# Return empty response but log the files we found
|
351 |
if 'csv_files' in locals() and 'image_files' in locals():
|
352 |
logger.info(f"Files that were generated but not processed: CSV: {result.get('csv_files', [])}, Images: {result.get('image_files', [])}")
|
353 |
-
return FileBoxProps(
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
)
|
|
|
359 |
|
360 |
|
361 |
# if __name__ == "__main__":
|
|
|
350 |
# Return empty response but log the files we found
|
351 |
if 'csv_files' in locals() and 'image_files' in locals():
|
352 |
logger.info(f"Files that were generated but not processed: CSV: {result.get('csv_files', [])}, Images: {result.get('image_files', [])}")
|
353 |
+
# return FileBoxProps(
|
354 |
+
# files=Files(
|
355 |
+
# csv_files=[],
|
356 |
+
# image_files=[]
|
357 |
+
# )
|
358 |
+
# )
|
359 |
+
return None
|
360 |
|
361 |
|
362 |
# if __name__ == "__main__":
|