Skip to content

Commit 43849c2

Browse files
committed
fix fallback
1 parent 2b76d6c commit 43849c2

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/databricks_ai_bridge/genie.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,12 @@ def ask_question(self, question, conversation_id: Optional[str] = None):
468468
# Fall back to deprecated REST methods
469469
logging.warning(f"MCP call failed, falling back to REST API: {e}")
470470

471-
if conversation_id:
472-
resp = self.create_message(conversation_id, question)
473-
return self.poll_for_result(conversation_id, resp["message_id"])
474-
else:
471+
if not conversation_id:
475472
resp = self.start_conversation(question)
476-
return self.poll_for_result(resp["conversation_id"], resp["message_id"])
473+
else:
474+
resp = self.create_message(conversation_id, question)
475+
476+
genie_response = self.poll_for_result(resp["conversation_id"], resp["message_id"])
477+
if not genie_response.conversation_id:
478+
genie_response.conversation_id = resp["conversation_id"]
479+
return genie_response

0 commit comments

Comments
 (0)