Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix message merging strategy when multi-turn tool calling. #2986

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Leoyzen
Copy link
Contributor

@Leoyzen Leoyzen commented Jan 25, 2025

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

修复 #2984 问题。多轮 tool-calling 时,message 会将 role=tool 内容merge 进上一条 role=assistant 的内容中;但是连续的 tool calling 会导致消息列表会由user→assistant→tool→assistant→tool变为 user→assistant→assistant,导致后续校验报错。

本 PR 修复了该问题,在messages_join_observation时也会将连续的role=assistant的内容进行合并,以避免上述问题。

Experiment results

Paste your experiment result here(if needed).

@Leoyzen Leoyzen force-pushed the feature/multi-turn-tool-message-joining branch from d682b63 to 3de20f6 Compare January 25, 2025 14:26
@Leoyzen
Copy link
Contributor Author

Leoyzen commented Jan 25, 2025

@tastelikefeet Please give a review of this pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants