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.
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)¶
Bases:
pydantic.BaseModel
Information about a tool.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class dataflow.api.routes.tools_routes_fixed.ToolInvokeRequest(/, **data)¶
Bases:
pydantic.BaseModel
Request to invoke a tool.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class dataflow.api.routes.tools_routes_fixed.ToolInvokeResponse(/, **data)¶
Bases:
pydantic.BaseModel
Response from tool invocation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class dataflow.api.routes.tools_routes_fixed.ToolSchema(/, **data)¶
Bases:
pydantic.BaseModel
Tool input/output schema information.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class dataflow.api.routes.tools_routes_fixed.ToolsListResponse(/, **data)¶
Bases:
pydantic.BaseModel
Response for tools list endpoint.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- dataflow.api.routes.tools_routes_fixed.component_to_tool_info(component)¶
Convert a ComponentInfo to ToolInfo.
- Parameters:
component (haive.dataflow.api.routes.utils.haive_discovery.ComponentInfo)
- Return type:
- dataflow.api.routes.tools_routes_fixed.discover_all_tools(force_refresh=False)¶
Discover all tools using the unified discovery system.
- dataflow.api.routes.tools_routes_fixed.discover_tools_fallback()¶
Fallback tool discovery if the main discovery fails.
- Return type:
list[haive.dataflow.api.routes.utils.haive_discovery.ComponentInfo]
- dataflow.api.routes.tools_routes_fixed.get_discovery_instance()¶
Get or create the discovery instance.
- Return type:
haive.dataflow.api.routes.utils.haive_discovery.HaiveComponentDiscovery
- async dataflow.api.routes.tools_routes_fixed.get_tool_categories()¶
Get all available tool categories and their tools.
- async dataflow.api.routes.tools_routes_fixed.get_tool_details(tool_name)¶
Get detailed information about a specific tool.
- async dataflow.api.routes.tools_routes_fixed.get_tool_schema_endpoint(tool_name)¶
Get the input/output schema for a specific tool.
- Parameters:
tool_name (str) – Name of the tool to get schema for
- Returns:
ToolSchema containing input and output schemas
- Return type:
- async dataflow.api.routes.tools_routes_fixed.get_tool_stats()¶
Get summary statistics about discovered tools.
- async dataflow.api.routes.tools_routes_fixed.invoke_tool_endpoint(request)¶
Invoke a tool with the provided arguments.
- Parameters:
request (ToolInvokeRequest) – Tool invocation request with tool name and arguments
- Returns:
ToolInvokeResponse with the result or error
- Return type:
- async dataflow.api.routes.tools_routes_fixed.list_tools(force_refresh=False)¶
List all available tools.
- Parameters:
force_refresh (bool) – Force refresh the tool cache
- Returns:
ToolsListResponse containing list of available tools and total count
- Return type:
- async dataflow.api.routes.tools_routes_fixed.refresh_tool_cache()¶
Refresh the tool discovery cache.
- async dataflow.api.routes.tools_routes_fixed.search_tools(query=None, category=None, tool_type=None)¶
Search for tools by query, category, or type.
- Parameters:
- Returns:
ToolsListResponse containing filtered list of tools
- Return type: