From f4c73aa51a08238a9949f4e512fd2683083d46a2 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 24 Mar 2026 00:22:03 +0100 Subject: renamed skills -> tools --- htroot/AILab.html | 4 +- htroot/SkillsConfig_p.html | 185 ----------------------------- htroot/ToolsConfig_p.html | 184 ++++++++++++++++++++++++++++ htroot/env/templates/submenuAI.template | 2 +- source/net/yacy/htroot/SkillsConfig_p.java | 89 -------------- source/net/yacy/htroot/ToolsConfig_p.java | 86 ++++++++++++++ 6 files changed, 273 insertions(+), 277 deletions(-) delete mode 100644 htroot/SkillsConfig_p.html create mode 100644 htroot/ToolsConfig_p.html delete mode 100644 source/net/yacy/htroot/SkillsConfig_p.java create mode 100644 source/net/yacy/htroot/ToolsConfig_p.java diff --git a/htroot/AILab.html b/htroot/AILab.html index b3462048c..1b52b4817 100644 --- a/htroot/AILab.html +++ b/htroot/AILab.html @@ -318,14 +318,14 @@ Needs setup -

Enable/Disable Sills

+

Enable/Disable Tools

Superpowers for the YaCy Chat

Tools configuration
- Open skills configuration
+ Open tools configuration
Tune descriptions and set maxCallsPerTurn per tool (0 disables a tool).
diff --git a/htroot/SkillsConfig_p.html b/htroot/SkillsConfig_p.html deleted file mode 100644 index 3b8d5a52f..000000000 --- a/htroot/SkillsConfig_p.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - YaCy '#[clientname]#': Skills Config - #%env/templates/metas.template%# - - - - #%env/templates/header.template%# - #%env/templates/submenuAI.template%# - -

Skills

-

Add superpowers to the YaCy Chat. Skills may be disabled by setting maxCallsPerTurn to 0.

- - - #(status)# - ::
Tool settings were saved.
- #(/status)# - #(status_hasInvalidMaxCalls)# - ::
#[status_invalidMaxCalls]# invalid maxCallsPerTurn value(s) were reset to the previous values.
- #(/status_hasInvalidMaxCalls)# - -
- - -

Basic Skills

-
- #{basic_tools}# -
-
-

#[name]#

-
- - - -
-
- -
- #{/basic_tools}# -
- -

Visualization Skills

-
- #{visualization_tools}# -
-
-

#[name]#

-
- - - -
-
- -
- #{/visualization_tools}# -
- -

Data Retrieval Skills

-
- #{retrieval_tools}# -
-
-

#[name]#

-
- - - -
-
- -
- #{/retrieval_tools}# -
- -
- - - - #%env/templates/footer.template%# - - diff --git a/htroot/ToolsConfig_p.html b/htroot/ToolsConfig_p.html new file mode 100644 index 000000000..69f4f863a --- /dev/null +++ b/htroot/ToolsConfig_p.html @@ -0,0 +1,184 @@ + + + + YaCy '#[clientname]#': Tools Config + #%env/templates/metas.template%# + + + + #%env/templates/header.template%# + #%env/templates/submenuAI.template%# + +

Tools

+

Add superpowers to the YaCy Chat. Tools may be disabled by setting maxCallsPerTurn to 0.

+ + #(status)# + ::
Tool settings were saved.
+ #(/status)# + #(status_hasInvalidMaxCalls)# + ::
#[status_invalidMaxCalls]# invalid maxCallsPerTurn value(s) were reset to the previous values.
+ #(/status_hasInvalidMaxCalls)# + +
+ + +

Basic Tools

+
+ #{basic_tools}# +
+
+

#[name]#

+
+ + + +
+
+ +
+ #{/basic_tools}# +
+ +

Visualization Tools

+
+ #{visualization_tools}# +
+
+

#[name]#

+
+ + + +
+
+ +
+ #{/visualization_tools}# +
+ +

Data Retrieval Tools

+
+ #{retrieval_tools}# +
+
+

#[name]#

+
+ + + +
+
+ +
+ #{/retrieval_tools}# +
+ +
+ + + + #%env/templates/footer.template%# + + diff --git a/htroot/env/templates/submenuAI.template b/htroot/env/templates/submenuAI.template index 22e67ad6a..8265b9ff0 100644 --- a/htroot/env/templates/submenuAI.template +++ b/htroot/env/templates/submenuAI.template @@ -4,7 +4,7 @@
  • AI Lab
  • LLM Selection
  • RAG Config
  • -
  • Skills Config
  • +
  • Tools Config
  • AI Shield
  • Chat
  • diff --git a/source/net/yacy/htroot/SkillsConfig_p.java b/source/net/yacy/htroot/SkillsConfig_p.java deleted file mode 100644 index 11e1adea9..000000000 --- a/source/net/yacy/htroot/SkillsConfig_p.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * SkillsConfig_p - * Copyright 2026 by Michael Peter Christen - * First released 08.02.2026 at https://yacy.net - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program in the file lgpl21.txt - * If not, see . - */ - -package net.yacy.htroot; - -import java.util.List; - -import net.yacy.ai.ToolProvider; -import net.yacy.ai.ToolProvider.ToolConfig; -import net.yacy.cora.protocol.RequestHeader; -import net.yacy.search.Switchboard; -import net.yacy.server.serverObjects; -import net.yacy.server.serverSwitch; - -public class SkillsConfig_p { - - private static final String CONFIG_PREFIX = "ai.tools."; - private static final String DESCRIPTION_SUFFIX = ".description"; - private static final String MAX_CALLS_SUFFIX = ".maxCallsPerTurn"; - - public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) { - final Switchboard sb = (Switchboard) env; - final serverObjects prop = new serverObjects(); - sb.setConfig("ui.SkillsConfig_p.visited", "true"); - - int invalidMaxCalls = 0; - if (post != null && post.containsKey("save")) { - for (final ToolConfig tool : ToolProvider.listTools()) { - final String descKey = CONFIG_PREFIX + tool.name + DESCRIPTION_SUFFIX; - final String maxKey = CONFIG_PREFIX + tool.name + MAX_CALLS_SUFFIX; - final String configuredDescription = post.get(descKey, tool.description); - int configuredMaxCalls = tool.maxCallsPerTurn; - final String maxCallsString = post.get(maxKey, Integer.toString(tool.maxCallsPerTurn)).trim(); - try { - configuredMaxCalls = Integer.parseInt(maxCallsString); - } catch (final NumberFormatException e) { - invalidMaxCalls++; - } - if (configuredMaxCalls < 0) configuredMaxCalls = 0; - sb.setConfig(descKey, configuredDescription); - sb.setConfig(maxKey, Integer.toString(configuredMaxCalls)); - } - prop.put("status", "1"); - } else { - prop.put("status", "0"); - } - - prop.putNum("status_invalidMaxCalls", invalidMaxCalls); - prop.put("status_hasInvalidMaxCalls", invalidMaxCalls > 0 ? "1" : "0"); - - putToolGroup(prop, "basic_tools", ToolProvider.listBasicTools()); - putToolGroup(prop, "visualization_tools", ToolProvider.listVisualizationTools()); - putToolGroup(prop, "retrieval_tools", ToolProvider.listRetrievalTools()); - - return prop; - } - - /* - * Naming note: internally these are called "tools", but in the UI we call - * them "skills". Both terms refer to the same feature set. - */ - private static void putToolGroup(final serverObjects prop, final String keyPrefix, final List tools) { - int row = 0; - for (final ToolConfig tool : tools) { - prop.putHTML(keyPrefix + "_" + row + "_name", tool.name); - prop.putHTML(keyPrefix + "_" + row + "_description", tool.description); - prop.putNum(keyPrefix + "_" + row + "_maxCallsPerTurn", tool.maxCallsPerTurn); - row++; - } - prop.put(keyPrefix, row); - } -} diff --git a/source/net/yacy/htroot/ToolsConfig_p.java b/source/net/yacy/htroot/ToolsConfig_p.java new file mode 100644 index 000000000..7ba746507 --- /dev/null +++ b/source/net/yacy/htroot/ToolsConfig_p.java @@ -0,0 +1,86 @@ +/** + * ToolsConfig_p + * Copyright 2026 by Michael Peter Christen + * First released 08.02.2026 at https://yacy.net + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in the file lgpl21.txt + * If not, see . + */ + +package net.yacy.htroot; + +import java.util.List; + +import net.yacy.ai.ToolProvider; +import net.yacy.ai.ToolProvider.ToolConfig; +import net.yacy.cora.protocol.RequestHeader; +import net.yacy.search.Switchboard; +import net.yacy.server.serverObjects; +import net.yacy.server.serverSwitch; + +public class ToolsConfig_p { + + private static final String CONFIG_PREFIX = "ai.tools."; + private static final String DESCRIPTION_SUFFIX = ".description"; + private static final String MAX_CALLS_SUFFIX = ".maxCallsPerTurn"; + + public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) { + final Switchboard sb = (Switchboard) env; + final serverObjects prop = new serverObjects(); + sb.setConfig("ui.ToolsConfig_p.visited", "true"); + sb.setConfig("ui.SkillsConfig_p.visited", "true"); + + int invalidMaxCalls = 0; + if (post != null && post.containsKey("save")) { + for (final ToolConfig tool : ToolProvider.listTools()) { + final String descKey = CONFIG_PREFIX + tool.name + DESCRIPTION_SUFFIX; + final String maxKey = CONFIG_PREFIX + tool.name + MAX_CALLS_SUFFIX; + final String configuredDescription = post.get(descKey, tool.description); + int configuredMaxCalls = tool.maxCallsPerTurn; + final String maxCallsString = post.get(maxKey, Integer.toString(tool.maxCallsPerTurn)).trim(); + try { + configuredMaxCalls = Integer.parseInt(maxCallsString); + } catch (final NumberFormatException e) { + invalidMaxCalls++; + } + if (configuredMaxCalls < 0) configuredMaxCalls = 0; + sb.setConfig(descKey, configuredDescription); + sb.setConfig(maxKey, Integer.toString(configuredMaxCalls)); + } + prop.put("status", "1"); + } else { + prop.put("status", "0"); + } + + prop.putNum("status_invalidMaxCalls", invalidMaxCalls); + prop.put("status_hasInvalidMaxCalls", invalidMaxCalls > 0 ? "1" : "0"); + + putToolGroup(prop, "basic_tools", ToolProvider.listBasicTools()); + putToolGroup(prop, "visualization_tools", ToolProvider.listVisualizationTools()); + putToolGroup(prop, "retrieval_tools", ToolProvider.listRetrievalTools()); + + return prop; + } + + private static void putToolGroup(final serverObjects prop, final String keyPrefix, final List tools) { + int row = 0; + for (final ToolConfig tool : tools) { + prop.putHTML(keyPrefix + "_" + row + "_name", tool.name); + prop.putHTML(keyPrefix + "_" + row + "_description", tool.description); + prop.putNum(keyPrefix + "_" + row + "_maxCallsPerTurn", tool.maxCallsPerTurn); + row++; + } + prop.put(keyPrefix, row); + } +} -- cgit v1.2.3