dataflow.api.routes.tools_routes_fixed¶
Tools API routes using the unified discovery system.
This module provides FastAPI routes for discovering and listing all available tools in the Haive ecosystem using the haive-core discovery system.
Attributes¶
Classes¶
Information about a tool. |
|
Request to invoke a tool. |
|
Response from tool invocation. |
|
Tool input/output schema information. |
|
Response for tools list endpoint. |
Functions¶
|
Convert a ComponentInfo to ToolInfo. |
|
Discover all tools using the unified discovery system. |
Fallback tool discovery if the main discovery fails. |
|
Get or create the discovery instance. |
|
|
Get all available tool categories and their tools. |
|
Get detailed information about a specific tool. |
|
Get the input/output schema for a specific tool. |
|
Get summary statistics about discovered tools. |
|
Invoke a tool with the provided arguments. |
|
List all available tools. |
|
Refresh the tool discovery cache. |
|
Search for tools by query, category, or type. |
Module Contents¶
- class dataflow.api.routes.tools_routes_fixed.ToolInfo(/, **data: Any)¶
Bases:
pydantic.BaseModelInformation about a tool.
- class dataflow.api.routes.tools_routes_fixed.ToolInvokeRequest(/, **data: Any)¶
Bases:
pydantic.BaseModelRequest to invoke a tool.
- class dataflow.api.routes.tools_routes_fixed.ToolInvokeResponse(/, **data: Any)¶
Bases:
pydantic.BaseModelResponse from tool invocation.
- result: Any = None¶
- class dataflow.api.routes.tools_routes_fixed.ToolSchema(/, **data: Any)¶
Bases:
pydantic.BaseModelTool input/output schema information.
- class dataflow.api.routes.tools_routes_fixed.ToolsListResponse(/, **data: Any)¶
Bases:
pydantic.BaseModelResponse for tools list endpoint.
- dataflow.api.routes.tools_routes_fixed.component_to_tool_info(component: haive.dataflow.api.routes.utils.haive_discovery.ComponentInfo) ToolInfo¶
Convert a ComponentInfo to ToolInfo.
- dataflow.api.routes.tools_routes_fixed.discover_all_tools(force_refresh: bool = False) list[haive.dataflow.api.routes.utils.haive_discovery.ComponentInfo]¶
Discover all tools using the unified discovery system.
- dataflow.api.routes.tools_routes_fixed.discover_tools_fallback() list[haive.dataflow.api.routes.utils.haive_discovery.ComponentInfo]¶
Fallback tool discovery if the main discovery fails.
- dataflow.api.routes.tools_routes_fixed.get_discovery_instance() haive.dataflow.api.routes.utils.haive_discovery.HaiveComponentDiscovery¶
Get or create the discovery instance.
- async dataflow.api.routes.tools_routes_fixed.get_tool_categories() dict[str, list[str]]¶
Get all available tool categories and their tools.
- Returns:
Dictionary mapping categories to tool names
- async dataflow.api.routes.tools_routes_fixed.get_tool_details(tool_name: str) dict[str, Any]¶
Get detailed information about a specific tool.
- Parameters:
tool_name – Name of the tool to get details for
- Returns:
Detailed information about the tool
- async dataflow.api.routes.tools_routes_fixed.get_tool_schema_endpoint(tool_name: str) ToolSchema¶
Get the input/output schema for a specific tool.
- Parameters:
tool_name – Name of the tool to get schema for
- Returns:
ToolSchema containing input and output schemas
- async dataflow.api.routes.tools_routes_fixed.get_tool_stats() dict[str, Any]¶
Get summary statistics about discovered tools.
- Returns:
Summary statistics
- async dataflow.api.routes.tools_routes_fixed.invoke_tool_endpoint(request: ToolInvokeRequest) ToolInvokeResponse¶
Invoke a tool with the provided arguments.
- Parameters:
request – Tool invocation request with tool name and arguments
- Returns:
ToolInvokeResponse with the result or error
- async dataflow.api.routes.tools_routes_fixed.list_tools(force_refresh: bool = False) ToolsListResponse¶
List all available tools.
- Parameters:
force_refresh – Force refresh the tool cache
- Returns:
ToolsListResponse containing list of available tools and total count
- async dataflow.api.routes.tools_routes_fixed.refresh_tool_cache() dict[str, Any]¶
Refresh the tool discovery cache.
- Returns:
Status and count of discovered tools
- async dataflow.api.routes.tools_routes_fixed.search_tools(query: str | None = None, category: str | None = None, tool_type: str | None = None) ToolsListResponse¶
Search for tools by query, category, or type.
- Parameters:
query – Search query to match against tool names and descriptions
category – Filter by category (e.g., ‘search’, ‘development’, ‘database’)
tool_type – Filter by type (‘tool’ or ‘toolkit’)
- Returns:
ToolsListResponse containing filtered list of tools
- dataflow.api.routes.tools_routes_fixed.logger¶
- dataflow.api.routes.tools_routes_fixed.router¶