This commit is contained in:
parent
bf67e1c54b
commit
b7cc7cb394
2 changed files with 16 additions and 6 deletions
|
|
@ -829,9 +829,14 @@
|
||||||
console.log("Parsed action:", action);
|
console.log("Parsed action:", action);
|
||||||
|
|
||||||
if (action.type === "invoke_tool") {
|
if (action.type === "invoke_tool") {
|
||||||
// Send the display text so it shows correctly in chat
|
// Check if tool needs parameters
|
||||||
// The backend will recognize this as a tool request
|
if (action.prompt_for_params) {
|
||||||
|
// Need parameters, send text as message
|
||||||
window.sendMessage(sugg.text);
|
window.sendMessage(sugg.text);
|
||||||
|
} else {
|
||||||
|
// No params needed - invoke tool directly
|
||||||
|
window.sendMessage("/tool " + action.tool);
|
||||||
|
}
|
||||||
} else if (action.type === "send_message") {
|
} else if (action.type === "send_message") {
|
||||||
window.sendMessage(
|
window.sendMessage(
|
||||||
action.message || sugg.text,
|
action.message || sugg.text,
|
||||||
|
|
|
||||||
|
|
@ -1041,9 +1041,14 @@
|
||||||
console.log("Parsed action:", action);
|
console.log("Parsed action:", action);
|
||||||
|
|
||||||
if (action.type === "invoke_tool") {
|
if (action.type === "invoke_tool") {
|
||||||
// Send the display text so it shows correctly in chat
|
// Check if tool needs parameters
|
||||||
// The backend will recognize this as a tool request
|
if (action.prompt_for_params) {
|
||||||
|
// Need parameters, send text as message
|
||||||
window.sendMessage(sugg.text);
|
window.sendMessage(sugg.text);
|
||||||
|
} else {
|
||||||
|
// No params needed - invoke tool directly
|
||||||
|
window.sendMessage("/tool " + action.tool);
|
||||||
|
}
|
||||||
} else if (action.type === "send_message") {
|
} else if (action.type === "send_message") {
|
||||||
window.sendMessage(
|
window.sendMessage(
|
||||||
action.message || sugg.text,
|
action.message || sugg.text,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue