mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +00:00
Store conversation ID for new conversations as a string, not UUID
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()}
|
||||
|
||||
Reference in New Issue
Block a user