Skip to content

Commit 1916b6b

Browse files
committed
temporary fix for default prompt_id
1 parent 796828e commit 1916b6b

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

backend/danswer/chat/process_message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def stream_chat_message_objects(
359359
# If a prompt override is specified via the API, use that with highest priority
360360
# but for saving it, we are just mapping it to an existing prompt
361361
prompt_id = new_msg_req.prompt_id
362-
if prompt_id is None and persona.prompts:
362+
if (prompt_id is None or prompt_id == 0) and persona.prompts:
363363
prompt_id = sorted(persona.prompts, key=lambda x: x.id)[-1].id
364364

365365
if reference_doc_ids is None and retrieval_options is None:

backend/danswer/prompts/prompt_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ def drop_messages_history_overflow(
169169
"""As message history grows, messages need to be dropped starting from the furthest in the past.
170170
The System message should be kept if at all possible and the latest user input which is inserted in the
171171
prompt template must be included"""
172-
print("XXXX1")
173172
final_messages: list[BaseMessage] = []
174-
print("XXXX2")
175173
messages, token_counts = cast(
176174
tuple[list[BaseMessage], list[int]], zip(*messages_with_token_cnts)
177175
)

0 commit comments

Comments
 (0)