diff --git a/haystack_experimental/dataclasses/tool.py b/haystack_experimental/dataclasses/tool.py index ecd6fc15..279b87d6 100644 --- a/haystack_experimental/dataclasses/tool.py +++ b/haystack_experimental/dataclasses/tool.py @@ -212,9 +212,9 @@ def from_openapi(cls, spec: Union[str, Path], operation_name: str, **kwargs) -> :returns: Tool instance for the specified operation :raises ValueError: If the OpenAPI specification is invalid or cannot be loaded """ - from haystack_experimental.tools.openapi import create_tool_from_openapi_spec + from haystack_experimental.tools.openapi import _create_tool_from_openapi_spec - return create_tool_from_openapi_spec(spec=spec, operation_name=operation_name, **kwargs) + return _create_tool_from_openapi_spec(spec=spec, operation_name=operation_name, **kwargs) def _remove_title_from_schema(schema: Dict[str, Any]): diff --git a/haystack_experimental/tools/openapi.py b/haystack_experimental/tools/openapi.py index 1ff4fb9d..32657e95 100644 --- a/haystack_experimental/tools/openapi.py +++ b/haystack_experimental/tools/openapi.py @@ -31,7 +31,7 @@ class OpenAPIKwargs(TypedDict, total=False): allowed_operations: List[str] # A list of operations to include in the OpenAPI client. -def create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, **kwargs) -> "Tool": +def _create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, **kwargs) -> "Tool": """ Create a Tool instance from an OpenAPI specification and a specific operation name. @@ -52,7 +52,7 @@ def create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, * # Remove None values from the dictionary config = {k: v for k, v in config.items() if v is not None} - tools = create_tools_from_openapi_spec(spec=spec, **config) + tools = _create_tools_from_openapi_spec(spec=spec, **config) # Ensure we have only one tool if len(tools) != 1: @@ -65,7 +65,7 @@ def create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, * return tools[0] -def create_tools_from_openapi_spec(spec: Union[str, Path], **kwargs: OpenAPIKwargs) -> List["Tool"]: +def _create_tools_from_openapi_spec(spec: Union[str, Path], **kwargs: OpenAPIKwargs) -> List["Tool"]: """ Create Tool instances from an OpenAPI specification.