fix: preserve native tool call ID in multi-turn tool calling (#32768)

Signed-off-by: wanglinian <wanglinian@stu.pku.edu.cn>
Signed-off-by: wangln19 <96399074+wangln19@users.noreply.github.com>
Signed-off-by: Roger Wang <hey@rogerw.io>
Co-authored-by: Roger Wang <hey@rogerw.io>
Co-authored-by: Isotr0py <2037008807@qq.com>
This commit is contained in:
wangln19
2026-01-27 10:22:35 +08:00
committed by GitHub
co-authored by Roger Wang Isotr0py
parent 5a93b9162b
commit 2d7053438a
7 changed files with 183 additions and 68 deletions
@@ -218,6 +218,10 @@ def get_logits_processors(
class FunctionCall(OpenAIBaseModel):
# Internal field to preserve native tool call ID from tool parser.
# Excluded from serialization to maintain OpenAI API compatibility
# (function object should only contain 'name' and 'arguments').
id: str | None = Field(default=None, exclude=True)
name: str
arguments: str