Browse the Python API a module at a time with script_list_api and script_describe_api

script_search_api ranked the API by an agent's words, so a goal phrased in other words found the wrong entries.
Agents now list what a module or class holds with script_list_api and read one entry's whole documentation
with script_describe_api.
This commit is contained in:
SoftFever committed 2026-11-22 18:08:23 +08:00
1 parent ee42f3922c
commit 3c6752abf9
12 files changed
+234 -87

No files matched your search

+2 -2
View File
@@ -702,7 +702,7 @@ except tools.ToolError as error:
REQUIRE_FALSE(close.empty());
CHECK(close.front() == "app_state");
// script_search_api documents both, as it does every function of the package.
// script_describe_api documents both, as it does every function of the package.
std::set<std::string> documented;
for (const nlohmann::json& entry : Slic3r::GUI::Mcp::python_api_reference())
if (entry["kind"] == "function" && !entry["doc"].get<std::string>().empty())
@@ -713,7 +713,7 @@ except tools.ToolError as error:
TEST_CASE("every public member of the orca package has documentation and named parameters", "[PluginHost][Python]")
{
// script_search_api serves this documentation to agents writing scripts and plugins: a member without it, or
// script_list_api and script_describe_api serve this documentation to agents writing scripts and plugins: a member without it, or
// with a parameter pybind11 names argN, is one they can only guess at. A constant's documentation is
// the documentation that names it, and a class's goes on with what its constructors say; an enum's
// constructor takes one of the values its documentation lists.