feat: add conversation_id and user_id in chatflow/workflow system vars (#3771)

Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
takatost
2024-04-24 17:20:01 +08:00
committed by GitHub
parent a34e8cb0bd
commit 3da179f77b
14 changed files with 86 additions and 16 deletions

View File

@@ -238,8 +238,8 @@ def test__get_completion_model_prompt_messages():
prompt_rules = prompt_template['prompt_rules']
full_inputs = {**inputs, '#context#': context, '#query#': query, '#histories#': memory.get_history_prompt_text(
max_token_limit=2000,
ai_prefix=prompt_rules['human_prefix'] if 'human_prefix' in prompt_rules else 'Human',
human_prefix=prompt_rules['assistant_prefix'] if 'assistant_prefix' in prompt_rules else 'Assistant'
human_prefix=prompt_rules['human_prefix'] if 'human_prefix' in prompt_rules else 'Human',
ai_prefix=prompt_rules['assistant_prefix'] if 'assistant_prefix' in prompt_rules else 'Assistant'
)}
real_prompt = prompt_template['prompt_template'].format(full_inputs)