File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments