@@ -998,22 +998,26 @@ def collect_telemetry():
998
998
return
999
999
1000
1000
llm_response = construct_automation_created_message (automation , crontime , query_to_run , subject )
1001
- await save_to_conversation_log (
1002
- q ,
1003
- llm_response ,
1004
- user ,
1005
- meta_log ,
1006
- user_message_time ,
1007
- intent_type = "automation" ,
1008
- client_application = request .user .client_app ,
1009
- conversation_id = conversation_id ,
1010
- inferred_queries = [query_to_run ],
1011
- automation_id = automation .id ,
1012
- query_images = uploaded_images ,
1013
- train_of_thought = train_of_thought ,
1014
- raw_query_files = raw_query_files ,
1015
- tracer = tracer ,
1001
+ # Trigger task to save conversation to DB
1002
+ asyncio .create_task (
1003
+ save_to_conversation_log (
1004
+ q ,
1005
+ llm_response ,
1006
+ user ,
1007
+ meta_log ,
1008
+ user_message_time ,
1009
+ intent_type = "automation" ,
1010
+ client_application = request .user .client_app ,
1011
+ conversation_id = conversation_id ,
1012
+ inferred_queries = [query_to_run ],
1013
+ automation_id = automation .id ,
1014
+ query_images = uploaded_images ,
1015
+ train_of_thought = train_of_thought ,
1016
+ raw_query_files = raw_query_files ,
1017
+ tracer = tracer ,
1018
+ )
1016
1019
)
1020
+ # Send LLM Response
1017
1021
async for result in send_llm_response (llm_response , tracer .get ("usage" )):
1018
1022
yield result
1019
1023
return
0 commit comments