diff --git a/src/khoj/routers/api.py b/src/khoj/routers/api.py index 73e7fee30..854285a55 100644 --- a/src/khoj/routers/api.py +++ b/src/khoj/routers/api.py @@ -574,7 +574,7 @@ async def post_automation( try: # Use the query to run as the scheduling request if the scheduling request is unset automation = await schedule_automation( - query_to_run, subject, crontime, timezone, q, user, calling_url, conversation.id + query_to_run, subject, crontime, timezone, q, user, calling_url, str(conversation.id) ) except Exception as e: logger.error(f"Error creating automation {q} for {user.email}: {e}", exc_info=True) @@ -679,7 +679,7 @@ def edit_job( # Create new Conversation Session associated with this new task conversation = ConversationAdapters.create_conversation_session(user, request.user.client_app, title=title) - conversation_id = conversation.id + conversation_id = str(conversation.id) automation_metadata["conversation_id"] = conversation_id # Modify automation with updated query, subject diff --git a/src/khoj/routers/helpers.py b/src/khoj/routers/helpers.py index 0f60b1003..6950b8b00 100644 --- a/src/khoj/routers/helpers.py +++ b/src/khoj/routers/helpers.py @@ -1132,7 +1132,7 @@ def scheduled_chat( # Replace the original conversation_id with the conversation_id if conversation_id: # encode the conversation_id to avoid any issues with special characters - query_dict["conversation_id"] = [quote(conversation_id)] + query_dict["conversation_id"] = [quote(str(conversation_id))] # Restructure the original query_dict into a valid JSON payload for the chat API json_payload = {key: values[0] for key, values in query_dict.items()}