You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ("<think>"inmsg["content"]) and (notprevious_message_encounter_user_role):
193
+
logger.warning(f"Warning! Message content contains <think> tag, but no prior message has `user` role! This is not a common scenario. Please check your agent loop carefully.")
184
194
185
195
returntimeline
186
196
@@ -393,9 +403,9 @@ def patch_prompt_tokens(
393
403
) ->List[ExtendedMessage]:
394
404
"""
395
405
fix retokenization drift
396
-
prompt_text: [this llm call] the prompt in text format used in generation
397
-
prompt_token_ids: [this llm call] the prompt token ids used in generation (prompt_text->prompt_token_ids using tokenizer)
398
-
previous_ext_context: [from previous context] the context history
406
+
prompt_text = llm_output["prompt_text"]: [this llm call] the prompt in text format used in generation
407
+
prompt_token_ids = llm_output["prompt_token_ids"]: [this llm call] the prompt token ids used in generation (prompt_text->prompt_token_ids using tokenizer)
408
+
previous_ext_context: [from previous context] the context history
399
409
"""
400
410
401
411
# remove tailing, usually `<|im_start|> assistant`
0 commit comments