diff --git a/clientlibs/utils.js b/clientlibs/utils.js index 984a876..a1fb0e8 100644 --- a/clientlibs/utils.js +++ b/clientlibs/utils.js @@ -1354,8 +1354,6 @@ function textInferenceSettingsToggleHandler(settingsNode) { const frequencyPenaltyWidget = settingsNode.widgets.find(w => w && w.name === "frequencyPenalty"); const useToolsWidget = settingsNode.widgets.find(w => w && w.name === "useTools"); const toolsWidget = settingsNode.widgets.find(w => w && w.name === "tools"); - const useToolChoiceWidget = settingsNode.widgets.find(w => w && w.name === "useToolChoice"); - const toolChoiceWidget = settingsNode.widgets.find(w => w && w.name === "toolChoice"); function toggleWidgetState(useWidget, paramWidget) { if (!useWidget || !paramWidget) return; @@ -1382,7 +1380,6 @@ function textInferenceSettingsToggleHandler(settingsNode) { if (usePresencePenaltyWidget && presencePenaltyWidget) toggleWidgetState(usePresencePenaltyWidget, presencePenaltyWidget); if (useFrequencyPenaltyWidget && frequencyPenaltyWidget) toggleWidgetState(useFrequencyPenaltyWidget, frequencyPenaltyWidget); if (useToolsWidget && toolsWidget) toggleWidgetState(useToolsWidget, toolsWidget); - if (useToolChoiceWidget && toolChoiceWidget) toggleWidgetState(useToolChoiceWidget, toolChoiceWidget); } function videoSettingsToggleHandler(settingsNode) { diff --git a/modules/textInferenceInputs.py b/modules/textInferenceInputs.py index 1097488..923e4c7 100644 --- a/modules/textInferenceInputs.py +++ b/modules/textInferenceInputs.py @@ -38,11 +38,15 @@ class RunwareTextInferenceInputs: if isinstance(images_block, dict) and images_block.get("images"): imgs = images_block["images"] if isinstance(imgs, list) and len(imgs) > 0: - out["images"] = [str(x).strip() for x in imgs if x is not None and str(x).strip()] + filtered_imgs = [str(x).strip() for x in imgs if x is not None and str(x).strip()] + if filtered_imgs: + out["images"] = filtered_imgs if isinstance(videos_block, dict) and videos_block.get("videos"): vids = videos_block["videos"] if isinstance(vids, list) and len(vids) > 0: - out["videos"] = [str(x).strip() for x in vids if x is not None and str(x).strip()] + filtered_vids = [str(x).strip() for x in vids if x is not None and str(x).strip()] + if filtered_vids: + out["videos"] = filtered_vids return (out,) diff --git a/modules/textInferenceSettings.py b/modules/textInferenceSettings.py index 0737f61..4eb2dab 100644 --- a/modules/textInferenceSettings.py +++ b/modules/textInferenceSettings.py @@ -118,15 +118,6 @@ class RunwareTextInferenceSettings: "default": "[]", "tooltip": "JSON array for tools.", }), - "useToolChoice": ("BOOLEAN", { - "default": False, - "tooltip": "Include toolChoice in settings.", - }), - "toolChoice": ("STRING", { - "multiline": True, - "default": "{}", - "tooltip": "JSON object for toolChoice.", - }), "cache": ("RUNWARETEXTINFERENCESETTINGSCACHE", { "tooltip": "Connect Runware Text Inference Settings Cache for settings.cache.{scope, ttl}.", }), @@ -139,8 +130,8 @@ class RunwareTextInferenceSettings: CATEGORY = "Runware/Text" DESCRIPTION = ( "Optional text inference settings (systemPrompt, maxTokens, temperature, topP, topK, " - "stopSequences, presencePenalty, frequencyPenalty, tools, toolChoice, thinkingLevel, cache). " - "Connect to Runware Text Inference." + "stopSequences, presencePenalty, frequencyPenalty, tools, thinkingLevel, cache). " + "Connect to Runware Text Inference. For tool calling, use Runware Text Inference Tool Choice on the inference node." ) @staticmethod @@ -240,11 +231,6 @@ class RunwareTextInferenceSettings: if parsed_tools: out["tools"] = parsed_tools - if kwargs.get("useToolChoice", False): - parsed_choice = self._parse_json_setting(kwargs.get("toolChoice"), dict, "toolChoice") - if parsed_choice: - out["toolChoice"] = parsed_choice - tl = self._normalize_thinking_level(kwargs.get("thinkingLevel", "none")) if tl != "none": out["thinkingLevel"] = tl