fix: MIDI rearrange tool spec double-wrapped, AI returns _unknown

REARRANGE_TOOL_SPEC already has {type:'function', function:{...}}
wrapper. callLLM's tools.map(t => ({type:'function', function:t}))
added ANOTHER wrapper, creating nested:
  {type:'function', function:{type:'function', function:{name}}}
which AI models couldn't parse -> function name became _unknown.
Fix: pass .function (inner spec) instead of the outer wrapper.
This commit is contained in:
2026-07-28 20:51:27 +07:00
parent 61f4b90af0
commit fc81f19b1c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -13941,7 +13941,7 @@ const App = () => {
apiKey, apiKey,
baseUrl: baseUrl.replace(/\/chat\/completions$/, '').replace(/\/$/, ''), baseUrl: baseUrl.replace(/\/chat\/completions$/, '').replace(/\/$/, ''),
messages, messages,
tools: [window.AIGateway.REARRANGE_TOOL_SPEC], tools: [window.AIGateway.REARRANGE_TOOL_SPEC.function],
toolChoice: 'auto' toolChoice: 'auto'
}); });
File diff suppressed because one or more lines are too long