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:
@ -88,6 +88,15 @@ function tryParse(str) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stringifies an object if it is not already a string.
|
||||
* @param {any} obj The object to stringify
|
||||
* @returns {string} A JSON string representation of the object.
|
||||
*/
|
||||
function stringify(obj) {
|
||||
return typeof obj === 'string' ? obj : JSON.stringify(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* A class that represents a tool definition.
|
||||
*/
|
||||
@ -571,7 +580,7 @@ export class ToolManager {
|
||||
id,
|
||||
displayName,
|
||||
name,
|
||||
parameters,
|
||||
parameters: stringify(parameters),
|
||||
result: toolResult,
|
||||
};
|
||||
result.invocations.push(invocation);
|
||||
|
Reference in New Issue
Block a user