mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 06:35:15 +00:00
Add an option to include/exclude attachments from previous messages in the chat prompt
This commit is contained in:
parent
b4d2a00e20
commit
2dee3a66ff
4 changed files with 8 additions and 4 deletions
|
|
@ -217,8 +217,8 @@ def generate_chat_prompt(user_input, state, **kwargs):
|
|||
user_key = f"user_{row_idx}"
|
||||
enhanced_user_msg = user_msg
|
||||
|
||||
# Add attachment content if present
|
||||
if user_key in metadata and "attachments" in metadata[user_key]:
|
||||
# Add attachment content if present AND if past attachments are enabled
|
||||
if (state.get('include_past_attachments', True) and user_key in metadata and "attachments" in metadata[user_key]):
|
||||
attachments_text = ""
|
||||
for attachment in metadata[user_key]["attachments"]:
|
||||
filename = attachment.get("name", "file")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue