feat(claude): support strict tool use via ToolInfo.Extra#750
Conversation
9a65785 to
a6cb781
Compare
288a031 to
be4d750
Compare
|
@m11y thanks for your pr. you add strict tool use, but changed openai's tool choice, could you explain this? I think this changes the semantics for |
|
Thanks for catching this. You are right: my compatibility shortcut changed the semantics for I pushed Validated with: cd libs/acl/openai && GOTOOLCHAIN=go1.25.5 go test -gcflags="all=-N -l" . |
|
@m11y 针对ark, 当前 PR 虽然会把 |
所以,当前 PR 让 ark 具体 strict 调用能力,等后续 |
那针对ark的修改,暂且就是无效的吧 |
|
You are right about Ark. The previous Ark change only stored I pushed |
Summary
ToolInfo.Extra["strict"]is set totrue, the Claude adapter now passesstrict: trueon theToolParamChanges
toAnthropicToolParam(): checktool.Extra["strict"]and setToolParam.StrictaccordinglyTestToAnthropicToolParam_StricttestMotivation
Without
strict: true, Claude may return astringfor a field declared as"type": "array"in the tool schema. The string contains a serialized JSON array, but with improper escaping of nested quotes, making it unparseable. With strict mode enabled, the API guarantees schema conformance.