spring-projects / spring-projects/spring-ai
Why do some of my large model tool call requests not enter the tool but return directly?为什么有时我的大模型的工具调用请求没有进入工具,而是直接返回
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
In most cases, when I explicitly tell the model which tool to use, the model can accurately complete the call, but there are a few cases where the tool_resp request returned by the model is not processed by springAi and returned directly as the model, such as the following:
<tool_call>
{"name": "生成数据", "arguments": {"planId": "0920163013", "userName": "234234", "creditDocInfo": "{"creditType":"FSI","creditDesc":"FDSGV分","queryKey":"PHONE,ID_NO","subSysNames":"CRE-SERVICE,CRE-BATCH","reqType...
What is the problem? Why is the tool call in the <tool_call> tag not actually understood and executed by SpringAi?
在大部分情况下,当我明确告诉了模型应该使用哪个工具,模型都能精准的完成调用,但是存在少部分情况模型返回的tool_resp请求没有被springAi处理,直接作为模型的返回了,例如下面这样:
<tool_call>
{"name": "生成数据", "arguments": {"planId": "0920163013", "userName": "234234", "creditDocInfo": "{\"creditType\":\"FSI\",\"creditDesc\":\"FDSGV分\",\"queryKey\":\"PHONE,ID_NO\",\"subSysNames\":\"CRE-SERVICE,CRE-BATCH\",\"reqTypes\":\"SINGLE_ASYNC,BATCH\",\"interfaceId\":\"447172\",\"creditResult\":[{\"fieldName\":\"scoreid\",\"fieldFullName\":\"fsi.scoreid\",\"fieldDesc\":\"系统产生的唯一评分编号\",\"fieldType\":\"C(120)\"},{\"fieldName\":\"score\",\"fieldFullName\":\"fsi.score\",\"fieldDesc\":\"评分结果\",\"fieldType\":\"N(3)\"},{\"fieldName\":\"reason\",\"fieldFullName\":\"fsi.reason\",\"fieldDesc\":\"原因码\",\"fieldType\":\"C(20)\"}],\"releasePlanId\":\"105857\",\"releasePlanName\":\"【2025.11.18-2099.11.20】发布计划1118\",\"storyId\":\"196862\",\"version\":\"2025.11.18\",\"branchNo\":\"25.11.18\",\"sysStoryInfos\":[{\"storyId\":202210,\"storyName\":\"test数据源接入需求-CDPS-CSERVICE\",\"subSystemId\":\"6307\",\"subSystemName\":\"CDPS-CSERVICE\"},{\"storyId\":202222,\"storyName\":\"test数据源接入需求-CRE-SERVICE\",\"subSystemId\":\"6048\",\"subSystemName\":\"CRE-SERVICE\"},{\"storyId\":202223,\"storyName\":\"test数据源接入需求-DVS-RISKADSDWH\",\"subSystemId\":\"6166\",\"subSystemName\":\"CNCBDP-RISKADSDWH\"}],\"attachInfos\":[{\"fileName\":\"GDGGB源需求文档.docx\",\"fileUrl\":\"http://uat.233.234.com/proxy/get_file/1c343sdf48869a7b09e4a5259426.docx\"},{\"fileName\":\"接口文档.xlsx\",\"fileUrl\":\"http://uat.dfg.sdffd.com/proxy/get_file/076sdf486c3b12037df8593.xlsx\"}]}"}}}
</tool_call>
请问这是什么问题?为什么这个<tool_call>标签的工具调用没有真正被SpringAi理解和执行?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Spring AI's handling of model tool-call responses, using the shown <tool_call> payload as the reproduction input. Confirm whether this response format is supported and record the required model or response format, or a reproducible failure, as the completion criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100