Skip to content

Commit fd17df1

Browse files
committed
rm upload image prefix
1 parent ff580fa commit fd17df1

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

‎qwen_agent/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.0.13'
1+
__version__ = '0.0.14'
22
from .agent import Agent
33
from .multi_agent_hub import MultiAgentHub
44

‎qwen_agent/utils/utils.py‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def format_as_multimodal_message(
328328
content.append(ContentItem(text=v))
329329
if k in ('image', 'audio'):
330330
content.append(item)
331-
if k in ('file', 'image'):
331+
if k == 'file':
332332
# Move 'file' out of 'content' since it's not natively supported by models
333333
files.append(v)
334334
if add_upload_info and files and (msg.role in (SYSTEM, USER)):
@@ -338,16 +338,10 @@ def format_as_multimodal_message(
338338
has_zh = (lang == 'zh')
339339
upload = []
340340
for f in [get_basename_from_url(f) for f in files]:
341-
if is_image(f):
342-
if has_zh:
343-
upload.append(f'![图片]({f})')
344-
else:
345-
upload.append(f'![image]({f})')
341+
if has_zh:
342+
upload.append(f'[文件]({f})')
346343
else:
347-
if has_zh:
348-
upload.append(f'[文件]({f})')
349-
else:
350-
upload.append(f'[file]({f})')
344+
upload.append(f'[file]({f})')
351345
upload = ' '.join(upload)
352346
if has_zh:
353347
upload = f'(上传了 {upload}\n\n'

0 commit comments

Comments
 (0)