Skip to content

[Template] Support standalone tool observations - #9854

Draft
taking-lying-flat wants to merge 1 commit into
modelscope:mainfrom
taking-lying-flat:agent/fix-standalone-tool-observations
Draft

[Template] Support standalone tool observations#9854
taking-lying-flat wants to merge 1 commit into
modelscope:mainfrom
taking-lying-flat:agent/fix-standalone-tool-observations

Conversation

@taking-lying-flat

Copy link
Copy Markdown
Contributor

What changed

  • Normalize OpenAI assistant.tool_calls before direct template encoding, including messages without a content field.
  • Support standalone tool observations following a user message in the Swift template backend.
  • Add native standalone-observation formatting for ReAct, Hermes/Qwen, and GLM agent templates.
  • Reuse the same OpenAI tool-call normalization in dataset preprocessing.

Root cause

Direct template encoding accessed content before normalizing assistant.tool_calls, and the Swift encoder could not represent a user -> tool -> assistant sequence even when the model chat template supports standalone observations.

Compatibility

Existing assistant -> tool(s) behavior is unchanged. Standalone observations remain prompt-side and are excluded from labels.

Fixes #9843
Refs #8499

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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.

自定义数据不支持单独的tool

1 participant