mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix tool call reuse between Claude and OAI
This commit is contained in:
@ -131,13 +131,14 @@ function convertClaudeMessages(messages, prefillString, useSysPrompt, humanMsgFi
|
||||
}
|
||||
|
||||
// Now replace all further messages that have the role 'system' with the role 'user'. (or all if we're not using one)
|
||||
const parse = (str) => typeof str === 'string' ? JSON.parse(str) : str;
|
||||
messages.forEach((message) => {
|
||||
if (message.role === 'assistant' && message.tool_calls) {
|
||||
message.content = message.tool_calls.map((tc) => ({
|
||||
type: 'tool_use',
|
||||
id: tc.id,
|
||||
name: tc.function.name,
|
||||
input: tc.function.arguments,
|
||||
input: parse(tc.function.arguments),
|
||||
}));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user